]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
cfgcleanup.c (try_head_merge_bb): If get_condition returns NULL for a jump that is...
authorBernd Schmidt <bernds@codesourcery.com>
Wed, 2 Nov 2011 10:47:44 +0000 (10:47 +0000)
committerJulian Brown <jules@gcc.gnu.org>
Wed, 2 Nov 2011 10:47:44 +0000 (10:47 +0000)
gcc/
* cfgcleanup.c (try_head_merge_bb): If get_condition returns
NULL for a jump that is a cc0 insn, pick the previous insn for
move_before.

gcc/testsuite/
* gcc.c-torture/compile/20110907.c: New file.

From-SVN: r180766

gcc/ChangeLog
gcc/cfgcleanup.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/20110913-1.c [new file with mode: 0644]

index 9d13db9862e3d5f581440ec6b4ef62f494b59572..2afead1bcd7e32b3e21ba8eeb6166b067a27dcc5 100644 (file)
@@ -1,3 +1,9 @@
+2011-11-02  Bernd Schmidt  <bernds@codesourcery.com>
+
+       * cfgcleanup.c (try_head_merge_bb): If get_condition returns
+       NULL for a jump that is a cc0 insn, pick the previous insn for
+       move_before.
+
 2011-11-01  Uros Bizjak  <ubizjak@gmail.com>
 
        * config/i386/i386.md (splitters for int-float conversion): Use
index aaa0ea5d232e955a4de91c33a87a1251add41383..0a644980032b3d5bddc206032b4d34933cb82202 100644 (file)
@@ -1969,7 +1969,14 @@ try_head_merge_bb (basic_block bb)
 
   cond = get_condition (jump, &move_before, true, false);
   if (cond == NULL_RTX)
-    move_before = jump;
+    {
+#ifdef HAVE_cc0
+      if (reg_mentioned_p (cc0_rtx, jump))
+       move_before = prev_nonnote_nondebug_insn (jump);
+      else
+#endif
+       move_before = jump;
+    }
 
   for (ix = 0; ix < nedges; ix++)
     if (EDGE_SUCC (bb, ix)->dest == EXIT_BLOCK_PTR)
@@ -2131,7 +2138,14 @@ try_head_merge_bb (basic_block bb)
       jump = BB_END (final_dest_bb);
       cond = get_condition (jump, &move_before, true, false);
       if (cond == NULL_RTX)
-       move_before = jump;
+       {
+#ifdef HAVE_cc0
+         if (reg_mentioned_p (cc0_rtx, jump))
+           move_before = prev_nonnote_nondebug_insn (jump);
+         else
+#endif
+           move_before = jump;
+       }
     }
 
   do
index 2f6d6576a74b52fc95e4406345fa01290689304a..89409d2085663ad1f8a6fc8a78b1f1d32db20c5c 100644 (file)
@@ -1,3 +1,7 @@
+2011-11-02  Bernd Schmidt  <bernds@codesourcery.com>
+
+       * gcc.c-torture/compile/20110907.c: New file.
+
 2011-10-29  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/50901
diff --git a/gcc/testsuite/gcc.c-torture/compile/20110913-1.c b/gcc/testsuite/gcc.c-torture/compile/20110913-1.c
new file mode 100644 (file)
index 0000000..e435a14
--- /dev/null
@@ -0,0 +1,26 @@
+struct ieee754_double {
+  double d;
+};
+extern const float __exp_deltatable[178];
+float __ieee754_expf (float x)
+{
+  static const float himark = 88.72283935546875;
+  static const float lomark = -103.972084045410;
+  if (__builtin_isless(x, himark) && __builtin_isgreater(x, lomark))
+    {
+      int tval;
+      double x22, t, result, dx;
+      float delta;
+      struct ieee754_double ex2_u;
+      dx -= t;
+      tval = (int) (t * 512.0);
+      if (t >= 0)
+       delta = - __exp_deltatable[tval];
+      else
+       delta = __exp_deltatable[-tval];
+      x22 = (0.5000000496709180453 * dx + 1.0000001192102037084) * dx + delta;
+      result = x22 * ex2_u.d + ex2_u.d;
+      return (float) result;
+    }
+  return x;
+}