tree-optimization/100519 - avoid reassociating asm goto defs
authorRichard Biener <rguenther@suse.de>
Tue, 11 May 2021 12:59:59 +0000 (14:59 +0200)
committerRichard Biener <rguenther@suse.de>
Wed, 12 May 2021 11:12:46 +0000 (13:12 +0200)
commitcd36bbb2281ada10b5e1df143ecf64b88cdb8119
tree983629752943d4991d80d334edce7b9ff7a89da9
parentac18ded230f1559f271f8d66121b2f16805f0b27
tree-optimization/100519 - avoid reassociating asm goto defs

This splits can_associate_p into checks for SSA defs and checks
for the type so it can be called from is_reassociable_op to
catch cases not catched by the earlier fix.

2021-05-11  Richard Biener  <rguenther@suse.de>

PR tree-optimization/100519
* tree-ssa-reassoc.c (can_associate_p): Split into...
(can_associate_op_p): ... this
(can_associate_type_p): ... and this.
(is_reassociable_op): Call can_associate_op_p.
(break_up_subtract_bb): Call the appropriate predicates.
(reassociate_bb): Likewise.

* gcc.dg/torture/pr100519.c: New testcase.
gcc/testsuite/gcc.dg/torture/pr100519.c [new file with mode: 0644]
gcc/tree-ssa-reassoc.c