]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR target/10072 ([Sparc] internal compiler error: in trunc_int_for_mode, at explow...
authorEric Botcazou <ebotcazou@libertysurf.fr>
Mon, 24 Mar 2003 11:29:11 +0000 (12:29 +0100)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Mon, 24 Mar 2003 11:29:11 +0000 (11:29 +0000)
PR target/10072
* combine.c (simplify_if_then_else): Check that the mode
has MODE_INT class before applying the (OP Z (mult COND C2))
transformation.

From-SVN: r64785

gcc/ChangeLog
gcc/combine.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/ultrasp5.c [new file with mode: 0644]

index a470d16cad8b45bd3452a722bf171cebcf00a9fa..9bc5b91838adee98389da1eec2e0f1d6b58af1d9 100644 (file)
@@ -1,3 +1,10 @@
+2003-03-23  Eric Botcazou  <ebotcazou@libertysurf.fr>
+
+       PR target/10072
+       * combine.c (simplify_if_then_else): Check that the mode
+       has MODE_INT class before applying the (OP Z (mult COND C2))
+       transformation.
+
 2003-03-23  Eric Botcazou  <ebotcazou@libertysurf.fr>
 
        PR optimization/9414
        * doc/tm.texi (REGISTER_TARGET_PRAGMAS): Update
 
 See ChangeLog.8 for earlier changes.
+
index cd7261bf1eb41f55d41ae68ce1d73ad35ce181dd..dd017062daaaceab49e39f8606e5d4afeaec93c0 100644 (file)
@@ -4969,7 +4969,9 @@ simplify_if_then_else (x)
      neither 1 or -1, but it isn't worth checking for.  */
 
   if ((STORE_FLAG_VALUE == 1 || STORE_FLAG_VALUE == -1)
-      && comparison_p && mode != VOIDmode && ! side_effects_p (x))
+      && comparison_p
+      && GET_MODE_CLASS (mode) == MODE_INT
+      && ! side_effects_p (x))
     {
       rtx t = make_compound_operation (true_rtx, SET);
       rtx f = make_compound_operation (false_rtx, SET);
index b79658197548db02896b255b15930a46b82519ba..d5fbd913f719cb6266c5019aad74a71bff657d8e 100644 (file)
@@ -1,3 +1,7 @@
+2003-03-23  Eric Botcazou  <ebotcazou@libertysurf.fr>
+
+       * gcc.dg/ultrasp5.c: New test.
+
 2003-03-23  Arpad Beszedes <beszedes@cc.u-szeged.hu>
 
        PR middle-end/9967
diff --git a/gcc/testsuite/gcc.dg/ultrasp5.c b/gcc/testsuite/gcc.dg/ultrasp5.c
new file mode 100644 (file)
index 0000000..c366007
--- /dev/null
@@ -0,0 +1,12 @@
+/* PR target/10072 */
+/* Originator: Peter van Hoof <p.van-hoof@qub.ac.uk>
+/* { dg-do compile } */
+/* { dg-options "-O1 -mcpu=ultrasparc -ffast-math" { target sparc-*-* } } */
+
+void p(int v)
+{
+  int i=v,j;
+  float a,b,c,x[i];
+
+  x[i] = (a/(((b)>(c)) ? (b) : (c)) - (((i) == (j)) ? 1.f : 0.f));
+}