tree-optimization/104700 - adjust constant handling in PRE
authorRichard Biener <rguenther@suse.de>
Mon, 28 Feb 2022 07:36:25 +0000 (08:36 +0100)
committerRichard Biener <rguenther@suse.de>
Mon, 28 Feb 2022 09:34:25 +0000 (10:34 +0100)
commit37b583b9d7719f663656ce65ac822c11471fb540
tree688009606fb37efc520d70c7b49e75c4154c1c64
parentf485b0ed7d06482d2f212ff0d9f5519a4f2c9a15
tree-optimization/104700 - adjust constant handling in PRE

The following refactors find_or_generate_expression to more properly
handle constant valued SSA names thereby simplifying the code and
avoiding ICEing after the last change to NARY processing.

2022-02-28  Richard Biener  <rguenther@suse.de>

PR tree-optimization/104700
* tree-ssa-pre.cc (get_or_alloc_expr_for): Remove and inline
into ...
(find_or_generate_expression): ... here, simplifying code.

* gcc.dg/pr104700-2.c: New testcase.
* gcc.dg/torture/pr104700-1.c: Likewise.
gcc/testsuite/gcc.dg/pr104700-2.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/torture/pr104700-1.c [new file with mode: 0644]
gcc/tree-ssa-pre.cc