re PR tree-optimization/63898 (r217560 caused segfault building 462.libquantum from...
authorRichard Biener <rguenther@suse.de>
Mon, 17 Nov 2014 09:31:33 +0000 (09:31 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 17 Nov 2014 09:31:33 +0000 (09:31 +0000)
2014-11-17  Richard Biener  <rguenther@suse.de>

PR middle-end/63898
* match.pd: Guard X / CST -> X * CST' transform against
zero CST.

From-SVN: r217650

gcc/ChangeLog
gcc/match.pd

index 543e24b..ff93f9a 100644 (file)
@@ -1,3 +1,9 @@
+2014-11-17  Richard Biener  <rguenther@suse.de>
+
+       PR middle-end/63898
+       * match.pd: Guard X / CST -> X * CST' transform against
+       zero CST.
+
 2014-11-17  Terry Guo  <terry.guo@arm.com>
 
        * config/arm/thumb1.md (*addsi3_cbranch_scratch): Updated to UAL
index 127c7d9..da6599c 100644 (file)
@@ -166,7 +166,8 @@ along with GCC; see the file COPYING3.  If not see
  (simplify
   (rdiv @0 cst@1)
   (if (optimize)
-   (if (flag_reciprocal_math)
+   (if (flag_reciprocal_math
+       && !real_zerop (@1))
     (with
      { tree tem = fold_binary (RDIV_EXPR, type, build_one_cst (type), @1); }
      (if (tem)