From 4ee783fce4dc44066f34741c27cae86fc08e33c7 Mon Sep 17 00:00:00 2001 From: ebotcazou Date: Sun, 20 Jul 2014 21:00:51 +0000 Subject: [PATCH] * cse.c (exp_equiv_p) : 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 --- gcc/ChangeLog | 5 +++++ gcc/cse.c | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0e5a2985eea..efb67bac4c0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2014-07-20 Eric Botcazou + * cse.c (exp_equiv_p) : For GCSE, return 0 for expressions with + different trapping status if -fnon-call-exceptions is enabled. + +2014-07-20 Eric Botcazou + * expr.c (store_field): Handle VOIDmode for calls that return values in multiple locations. 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; -- 2.11.4.GIT