https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114978
--- Comment #16 from chenglulu <chenglulu at loongson dot cn> --- The performance degradation on LoongArch is caused by one commit: commit e0e9499aeffdaca88f0f29334384aa5f710a81a4 (HEAD -> trunk) Author: Richard Biener <rguent...@suse.de> Date: Tue Mar 19 12:24:08 2024 +0100 tree-optimization/114151 - revert PR114074 fix The following reverts the chrec_fold_multiply fix and only keeps handling of constant overflow which keeps the original testcase fixed. A better solution might involve ranger improvements or tracking of assumptions during SCEV analysis similar to what niter analysis does. PR tree-optimization/114151 PR tree-optimization/114269 PR tree-optimization/114322 PR tree-optimization/114074 * tree-chrec.cc (chrec_fold_multiply): Restrict the use of unsigned arithmetic when actual overflow on constant operands is observed. * gcc.dg/pr68317.c: Revert last change. The scores before and after this patch are: (-g -Ofast -march=la464) r14-9539: 12.3 r14-9540: 9.26