Re: match.pd: x+x -> 2*x

2016-04-26 Thread Richard Biener
On Tue, Apr 26, 2016 at 1:37 PM, Marc Glisse wrote: > On Tue, 26 Apr 2016, Richard Biener wrote: > >> Note that I think >> >> /* (X /[ex] A) * A -> X. */ >> (simplify >> (mult (convert? (exact_div @0 @1)) @1) >> /* Look through a sign-changing conversion. */ >> (convert

Re: match.pd: x+x -> 2*x

2016-04-26 Thread Marc Glisse
On Tue, 26 Apr 2016, Richard Biener wrote: Note that I think /* (X /[ex] A) * A -> X. */ (simplify (mult (convert? (exact_div @0 @1)) @1) /* Look through a sign-changing conversion. */ (convert @0)) has a bug as we use operand_equal_p for comparing @1 but that treats equal but different

Re: match.pd: x+x -> 2*x

2016-04-26 Thread Richard Biener
On Mon, Apr 25, 2016 at 9:21 PM, Marc Glisse wrote: > Hello, > > a simple transform to replace a more complicated one in fold-const.c. > > This patch breaks the testcase gcc.dg/gomp/loop-1.c. Indeed, the C front-end > folds too eagerly > newrhs = c_fully_fold (newrhs,

match.pd: x+x -> 2*x

2016-04-25 Thread Marc Glisse
Hello, a simple transform to replace a more complicated one in fold-const.c. This patch breaks the testcase gcc.dg/gomp/loop-1.c. Indeed, the C front-end folds too eagerly newrhs = c_fully_fold (newrhs, false, NULL); in build_modify_expr, and by the time the OMP code checks that the