aboutsummaryrefslogtreecommitdiff
path: root/gcc/optabs.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2004-03-02 16:46:06 -0800
committerRichard Henderson <rth@gcc.gnu.org>2004-03-02 16:46:06 -0800
commit27ab3e91289ff7946c6a477de84bddb707d3f74d (patch)
tree89c4a2eac8c27b87bff6eb652865b74686befcd2 /gcc/optabs.c
parent0b1d67d23b3498243272f751414b157054be4515 (diff)
downloadgcc-27ab3e91289ff7946c6a477de84bddb707d3f74d.zip
gcc-27ab3e91289ff7946c6a477de84bddb707d3f74d.tar.gz
gcc-27ab3e91289ff7946c6a477de84bddb707d3f74d.tar.bz2
re PR middle-end/11767 (different code behaviour with -fnon-call-exceptions -fprofile-arcs)
PR middle-end/11767 * coverage.c (coverage_counter_ref): Set MEM_NOTRAP_P. * optabs.c (prepare_cmp_insn): Force trapping memories to registers before the compare, if flag_non_call_exceptions. * g++.dg/other/profile1.C: New. From-SVN: r78805
Diffstat (limited to 'gcc/optabs.c')
-rw-r--r--gcc/optabs.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/optabs.c b/gcc/optabs.c
index cf3099b..0826782 100644
--- a/gcc/optabs.c
+++ b/gcc/optabs.c
@@ -3650,6 +3650,16 @@ prepare_cmp_insn (rtx *px, rtx *py, enum rtx_code *pcomparison, rtx size,
return;
}
+ /* Don't allow operands to the compare to trap, as that can put the
+ compare and branch in different basic blocks. */
+ if (flag_non_call_exceptions)
+ {
+ if (may_trap_p (x))
+ x = force_reg (mode, x);
+ if (may_trap_p (y))
+ y = force_reg (mode, y);
+ }
+
*px = x;
*py = y;
if (can_compare_p (*pcomparison, mode, purpose))