diff options
author | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-07-20 21:00:51 +0000 |
---|---|---|
committer | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-07-20 21:00:51 +0000 |
commit | 4ee783fce4dc44066f34741c27cae86fc08e33c7 (patch) | |
tree | 1c4e16db6a44569a60735424bb076e93f3c03a36 /gcc/cse.c | |
parent | e0fb89d5fe71281d5a9708bc05a43f848c87e8be (diff) | |
download | gcc-4ee783fce4dc44066f34741c27cae86fc08e33c7.tar.gz |
* cse.c (exp_equiv_p) <MEM>: For GCSE, return 0 for expressions with
different trapping status if -fnon-call-exceptions is enabled.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@212879 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cse.c')
-rw-r--r-- | gcc/cse.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/cse.c b/gcc/cse.c index bb88b52aa36..34f93643cdf 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; |