aboutsummaryrefslogtreecommitdiff
path: root/gcc/cse.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2014-07-20 21:00:51 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2014-07-20 21:00:51 +0000
commite304caa4e59b92e063bda89e29147bd7237eac3a (patch)
tree1c4e16db6a44569a60735424bb076e93f3c03a36 /gcc/cse.c
parentd6cd6e226f990518183cb2c87ced5d9ae70bb4d5 (diff)
downloadgcc-e304caa4e59b92e063bda89e29147bd7237eac3a.zip
gcc-e304caa4e59b92e063bda89e29147bd7237eac3a.tar.gz
gcc-e304caa4e59b92e063bda89e29147bd7237eac3a.tar.bz2
cse.c (exp_equiv_p): For GCSE...
* cse.c (exp_equiv_p) <MEM>: For GCSE, return 0 for expressions with different trapping status if -fnon-call-exceptions is enabled. From-SVN: r212879
Diffstat (limited to 'gcc/cse.c')
-rw-r--r--gcc/cse.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/cse.c b/gcc/cse.c
index bb88b52..34f9364 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -2687,6 +2687,13 @@ exp_equiv_p (const_rtx x, const_rtx y, int validate, bool for_gcse)
the same attributes share the same mem_attrs data structure. */
if (MEM_ATTRS (x) != MEM_ATTRS (y))
return 0;
+
+ /* If we are handling exceptions, we cannot consider two expressions
+ with different trapping status as equivalent, because simple_mem
+ might accept one and reject the other. */
+ if (cfun->can_throw_non_call_exceptions
+ && (MEM_NOTRAP_P (x) != MEM_NOTRAP_P (y)))
+ return 0;
}
break;