A reduced testcase from https://codeforces.com/blog/entry/97433 $ cat test.c int z = 5; int a[6] = {0, 0, 0, 0, 0, 1}; int main() { for (int x = 5; x; x--) for (int y = z; y >= x; y--) a[y - x] += a[y]; if (a[0] != 7) __builtin_abort (); return 0; } $ gcc-7.3.0 -O3 test.c && ./a.out $ gcc-8.3.0 -O3 test.c && ./a.out Aborted $ gcc-9.3.0 -O3 test.c && ./a.out Aborted $ gcc-9.4.1 -O3 test.c && ./a.out Aborted $ gcc-10.3.0 -O3 test.c && ./a.out Only GCC versions 8.x and 9.x are affected and the bug is triggered by "-O3" or "-O1 -ftree-vectorize" optimization option.
Thanks for the report. Using -march=core2 started with r8-5008-ga52206ae28ed3e55 and was fixed with r10-4758-ge9acf80c96d68191.
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>: https://gcc.gnu.org/g:660e5834667a9efdb4d400dfb83caa48c9dd9f9b commit r12-6175-g660e5834667a9efdb4d400dfb83caa48c9dd9f9b Author: Richard Biener <rguenther@suse.de> Date: Mon Jan 3 09:56:13 2022 +0100 Add testcase for PR103615 This adds a testcase for a fixed wrong-code bug. 2022-01-03 Richard Biener <rguenther@suse.de> PR tree-optimization/103615 * gcc.dg/torture/pr103615.c: New testcase.