]> gcc.gnu.org Git - gcc.git/commit
tree-optimization/114121 - chrec_fold_{plus,multiply} and recursion
authorRichard Biener <rguenther@suse.de>
Tue, 12 Mar 2024 13:00:05 +0000 (14:00 +0100)
committerRichard Biener <rguenther@suse.de>
Tue, 12 Mar 2024 14:16:05 +0000 (15:16 +0100)
commit73dac51b32575f980289c073969c6d825963d076
tree8f8c177e6ec6ecad21c83e601c75a9836d4673f9
parent4aa87b856067d4911de8fb66b3a27659dc75ca6d
tree-optimization/114121 - chrec_fold_{plus,multiply} and recursion

The following addresses endless recursion in the
chrec_fold_{plus,multiply} functions when handling sign-conversions.
We only need to apply tricks when we'd fail (there's a chrec in the
converted operand) and we need to make sure to not turn the other
operand into something worse (for the chrec-vs-chrec case).

PR tree-optimization/114121
* tree-chrec.cc (chrec_fold_plus_1): Guard recursion with
converted operand properly.
(chrec_fold_multiply): Likewise.  Handle missed recursion.

* gcc.dg/torture/pr114312.c: New testcase.
gcc/testsuite/gcc.dg/torture/pr114312.c [new file with mode: 0644]
gcc/tree-chrec.cc
This page took 0.063838 seconds and 5 git commands to generate.