https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114312
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution|--- |FIXED --- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> --- Meh, fixed by commit 73dac51b32575f980289c073969c6d825963d076 (origin/master, origin/HEAD) Author: Richard Biener <rguent...@suse.de> Date: Tue Mar 12 14:00:05 2024 +0100 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.