simplify-rtx.c (simplify_binary_operation_1): Do not simplify a division of 0 if...
authorEric Botcazou <ebotcazou@adacore.com>
Wed, 14 Jun 2017 10:40:34 +0000 (10:40 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Wed, 14 Jun 2017 10:40:34 +0000 (10:40 +0000)
* simplify-rtx.c (simplify_binary_operation_1) <UDIV>: Do not simplify
a division of 0 if non-call exceptions are enabled.

From-SVN: r249188

gcc/ChangeLog
gcc/simplify-rtx.c

index 8205b0e984a5f9cf37bd7cb9d1f2e1c2c91964d9..c6e657259ec609740373aa778519668a9cfb68b0 100644 (file)
@@ -1,3 +1,8 @@
+2017-06-14  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * simplify-rtx.c (simplify_binary_operation_1) <UDIV>: Do not simplify
+       a division of 0 if non-call exceptions are enabled.
+
 2017-06-14  Andrew Pinski  <apinski@cavium.com>
            Naveen H.S  <Naveen.Hurugalawadi@cavium.com>
 
index 7cab26a0e34889df6de3268606a9506013765a86..e8af7f34050372ab4fd413d822531663e5b0d1ac 100644 (file)
@@ -3194,7 +3194,8 @@ simplify_binary_operation_1 (enum rtx_code code, machine_mode mode,
 
     case UDIV:
       /* 0/x is 0 (or x&0 if x has side-effects).  */
-      if (trueop0 == CONST0_RTX (mode))
+      if (trueop0 == CONST0_RTX (mode)
+         && !cfun->can_throw_non_call_exceptions)
        {
          if (side_effects_p (op1))
            return simplify_gen_binary (AND, mode, op1, trueop0);