aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorBernd Schmidt <bernds@codesourcery.com>2011-09-13 20:40:53 +0000
committerBernd Schmidt <bernds@gcc.gnu.org>2011-09-13 20:40:53 +0000
commit43052d458619645b576eff628bedcd02cdad2a2e (patch)
treed7f07a98f652d9df0af95a74a6a37c347bbe58d7 /gcc
parenta5baf3b8ced93d9a633f3994bc649f0892f0d306 (diff)
downloadgcc-43052d458619645b576eff628bedcd02cdad2a2e.zip
gcc-43052d458619645b576eff628bedcd02cdad2a2e.tar.gz
gcc-43052d458619645b576eff628bedcd02cdad2a2e.tar.bz2
cfgcleanup.c (try_head_merge_bb): If get_condition returns NULL for a jump that is a cc0 insn...
* 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.c-torture/compile/20110913-1.c: New test. From-SVN: r178834
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/cfgcleanup.c18
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20110913-1.c26
4 files changed, 52 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 47a09ae..74b187a 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2011-09-13 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-09-13 Richard Sandiford <rdsandiford@googlemail.com>
* config/v850/v850.md: Use match_test rather than eq/ne symbol_ref
diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c
index 396057c..20a409c 100644
--- a/gcc/cfgcleanup.c
+++ b/gcc/cfgcleanup.c
@@ -2214,7 +2214,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)
@@ -2376,7 +2383,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
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 67ccf26..95a0643 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2011-09-13 Bernd Schmidt <bernds@codesourcery.com>
+
+ * gcc.c-torture/compile/20110913-1.c: New test.
+
2011-09-13 Janus Weil <janus@gcc.gnu.org>
PR fortran/50379
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
index 0000000..e435a14
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20110913-1.c
@@ -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;
+}