From 53bc4b3a0db8af545f0b4757b6e1aa0102c21d0f Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Mon, 17 Nov 2014 09:31:33 +0000 Subject: [PATCH] re PR tree-optimization/63898 (r217560 caused segfault building 462.libquantum from cpu2006) 2014-11-17 Richard Biener PR middle-end/63898 * match.pd: Guard X / CST -> X * CST' transform against zero CST. From-SVN: r217650 --- gcc/ChangeLog | 6 ++++++ gcc/match.pd | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 543e24b84e4..ff93f9af531 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2014-11-17 Richard Biener + + PR middle-end/63898 + * match.pd: Guard X / CST -> X * CST' transform against + zero CST. + 2014-11-17 Terry Guo * config/arm/thumb1.md (*addsi3_cbranch_scratch): Updated to UAL diff --git a/gcc/match.pd b/gcc/match.pd index 127c7d9b5e4..da6599c750d 100644 --- a/gcc/match.pd +++ b/gcc/match.pd @@ -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) -- 2.30.2