]> gcc.gnu.org Git - gcc.git/commitdiff
cse.c (exp_equiv_p): For GCSE...
authorEric Botcazou <ebotcazou@adacore.com>
Sun, 20 Jul 2014 21:00:51 +0000 (21:00 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Sun, 20 Jul 2014 21:00:51 +0000 (21:00 +0000)
* 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

gcc/ChangeLog
gcc/cse.c

index 0e5a2985eeaa079142ecdb4863e1b31fd7861dd9..efb67bac4c0b5c58eaf67c97497d84700586ec8b 100644 (file)
@@ -1,3 +1,8 @@
+2014-07-20  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * cse.c (exp_equiv_p) <MEM>: For GCSE, return 0 for expressions with
+       different trapping status if -fnon-call-exceptions is enabled.
+
 2014-07-20  Eric Botcazou  <ebotcazou@adacore.com>
 
        * expr.c (store_field): Handle VOIDmode for calls that return values
index bb88b52aa36850ea00efc2128c862963f442efbd..34f93643cdfee61dd675d5e75fc9bb370e8d643a 100644 (file)
--- 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;
 
This page took 0.099603 seconds and 5 git commands to generate.