On Wed, Nov 12, 2014 at 9:55 AM, H.J. Lu <hjl.to...@gmail.com> wrote: > On Tue, Nov 11, 2014 at 5:13 AM, Richard Biener <rguent...@suse.de> wrote: >> >> This merges patterns from associate_plusminus and adjusts them with >> details from their fold-const.c pendants. It also fixes missing >> flag_sanitize checks on negate contraction on the way. >> >> This shows places where folds STRIP_NOPs was important (but also >> shows where it may create wrong code - sth the patch doesn't fix >> yet). Without the conditonal convert handling on the negate >> contraction we regress quite a few GENERIC folding testcases. >> >> Note that the other explicit reassocation patterns are handled >> by folds associate: piece which I am sure we don't implement >> fully by the few patterns (OTOH on GIMPLE we have a reassoc >> pass for that anyway). So not too many patterns were removed >> from fold. >> >> Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk. >> >> Richard. >> >> 2014-11-11 Richard Biener <rguent...@suse.de> >> >> * match.pd: Implement patterns from associate_plusminus >> and factor in differences from the fold-const.c implementation. >> * fold-const.c (fold_binary_loc): Remove patterns here. >> * tree-ssa-forwprop.c (associate_plusminus): Remove. >> (pass_forwprop::execute): Don't call it. >> * tree.c (tree_nop_conversion_p): New function, factored >> from tree_nop_conversion. >> * tree.h (tree_nop_conversion_p): Declare. >> > > This caused: > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63836 >
It is dup of https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63821 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63835 I checked in this patch and closed the PR. -- H.J. --- Index: ChangeLog =================================================================== --- ChangeLog (revision 217440) +++ ChangeLog (working copy) @@ -1,3 +1,8 @@ +2014-11-12 H.J. Lu <hongjiu...@intel.com> + + PR tree-optimization/63835 + * gcc.dg/pr63835.c: New test. + 2014-11-12 Alan Lawrence <alan.lawre...@arm.com> * gcc.target/aarch64/simd/vqdmlal_high_lane_s16_indices_1.c: New test. Index: gcc.dg/pr63835.c =================================================================== --- gcc.dg/pr63835.c (revision 0) +++ gcc.dg/pr63835.c (working copy) @@ -0,0 +1,16 @@ +/* { dg-do compile } */ +/* { dg-options "-Os" } */ + +int a; + +int +fn1 (int p) +{ + return -p; +} + +void +fn2 () +{ + fn1 (-(unsigned int) a); +}