re PR c/59708 (clang-compatible checked arithmetic builtins)
authorJakub Jelinek <jakub@redhat.com>
Wed, 3 Dec 2014 20:35:08 +0000 (21:35 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 3 Dec 2014 20:35:08 +0000 (21:35 +0100)
PR c/59708
* expmed.c (expand_widening_mult): Return const0_rtx if
coeff is 0.

From-SVN: r218331

gcc/ChangeLog
gcc/expmed.c

index eff109f584c3b801258f1cb4bed619e6bdf11083..aa2f9589e5f5acd85c2d0335b8c05fc37f6233c0 100644 (file)
@@ -1,5 +1,9 @@
 2014-12-03  Jakub Jelinek  <jakub@redhat.com>
 
+       PR c/59708
+       * expmed.c (expand_widening_mult): Return const0_rtx if
+       coeff is 0.
+
        * doc/gimple.texi (gimple_build_assign_with_ops): Remove.
        (gimple_build_assign): Document the new overloads.
 
index 0304e46ebb350c8a9a7ab19a525ac996bb12e15e..708f04f11c5bcd8b1013009b4fed0475e4da5362 100644 (file)
@@ -3289,6 +3289,9 @@ expand_widening_mult (machine_mode mode, rtx op0, rtx op1, rtx target,
       enum mult_variant variant;
       struct algorithm algorithm;
 
+      if (coeff == 0)
+       return CONST0_RTX (mode);
+
       /* Special case powers of two.  */
       if (EXACT_POWER_OF_2_OR_ZERO_P (coeff))
        {