]> gcc.gnu.org Git - gcc.git/commit
tree-optimization/96370 - make reassoc expr rewrite more robust
authorRichard Biener <rguenther@suse.de>
Thu, 30 Jul 2020 08:24:42 +0000 (10:24 +0200)
committerRichard Biener <rguenther@suse.de>
Fri, 11 Sep 2020 12:10:29 +0000 (14:10 +0200)
commit819fc71b49af8366e6b23d2b57ebb6fb66f1a292
tree5b0e3a1f005017f1d8c5d7d6bb5910d987f47925
parenta568a893f38a9cd32ddffd32bb9b6636deeeb5f1
tree-optimization/96370 - make reassoc expr rewrite more robust

In the face of the more complex tricks in reassoc with respect
to negate processing it can happen that the expression rewrite
is fooled to recurse on a leaf and pick up a bogus expression
code.  The following patch makes the expression rewrite more
robust in providing the expression code to it directly since
it is the same for all operations in a chain.

2020-07-30  Richard Biener  <rguenther@suse.de>

PR tree-optimization/96370
* tree-ssa-reassoc.c (rewrite_expr_tree): Add operation
code parameter and use it instead of picking it up from
the stmt that is being rewritten.
(reassociate_bb): Pass down the operation code.

* gcc.dg/pr96370.c: New testcase.

(cherry picked from commit 2c558d2655cb22f472c83e8296b5cd2a92365cd3)
gcc/testsuite/gcc.dg/pr96370.c [new file with mode: 0644]
gcc/tree-ssa-reassoc.c
This page took 0.082598 seconds and 6 git commands to generate.