The SPEC CPU2000 test sixtrack gets comparison failures on powerpc64-linux when compiled with current GCC mainline with "-m64 -O2 -fmodulo-sched". The minimized testcase demonstrates the problem. It starts failing with sources as of 20050405.
Created attachment 8694 [details] minimized testcase
The testcase starts failing with this patch from rakdver: http://gcc.gnu.org/ml/gcc-cvs/2005-04/msg00301.html
As far as I can tell, the code at .final_cleanup dump is correct, so the patch most likely reveals some latent bug in sms or one of the later passes.
There are other SPEC CPU2000 comparison failures on powerpc64-linux with "-m64 -O2 -fmodulo-sched" that resist attempts to minimize the testcases. apsi has been failing since: http://gcc.gnu.org/ml/gcc-cvs/2005-04/msg00893.html from kazu and lucas has been failing since: http://gcc.gnu.org/ml/gcc-cvs/2005-04/msg01289.html from radkver. While trying to minimize the apsi failure I added write statements that caused apsi to segfault; for example, write the value of I just inside the loop using it in DCDTZ with: 1327a1328,1329 > write(6,1001) i > 1001 format(' i = ',i3) I'm adding the information to this PR because I don't have test cases to submit for the apsi and lucas failures in new PRs, and hope that the information might be useful to Mostafa or anyone else who looks into this PR. There were other failures with these options earlier this month that have since gone away, making it look even more like latent bugs in the modulo scheduling code. All of these SPEC CPU2000 failures are with the small "test" input.
Is seems like this is not an SMS bug, sixtrack is failing for me with -m64 -O2 without -fmodulo-sched. Jania, have you checked that and have a different results?
sixtrack works fine for me with "-m64 -O2" with both SPEC's test input and its ref output, for all of my daily builds since 20050503, while with the addition of -fmodulo-sched it gets miscompares. lucas is now passing again, but apsi is still gettting miscompares with "-m64 -O2 -fmodulo-sched". Every week or so I run SPEC CPU2000 with GCC mainline built the previous night and run the tests using "test" input, for each of about 40 sets of GCC command line options with -m32 and then with -m64. This has found several regressions (21272, 21155, 21054, 21048, 21030, 20813 in the last month). Almost all of the failures I see are ICEs; the ones reported here with -fmodulo-sched are the only runtime failures I've seen for a long time. I'm running the tests now with the 20050508 compiler (last night's build failed) and will let you know if failures with other options look related to this one. The only known problem right now is PR 21155, intermittent ICEs with -ftree-vectorize.
sixtrack and the testcase smsbug.f still fail on powerpc64-linux when compiled with mainline GCC with the options "-m64 -O2 -fmodulo-sched". The other failures with those options mentioned in comment #4 have gone away.
Janis, can you try this patch? Index: modulo-sched.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/modulo-sched.c,v retrieving revision 1.29 diff -c -p -r1.29 modulo-sched.c *** modulo-sched.c 28 Apr 2005 02:25:22 -0000 1.29 --- modulo-sched.c 17 May 2005 11:47:00 -0000 *************** undo_generate_reg_moves (partial_schedul *** 597,602 **** --- 597,603 ---- delete_insn (crr); crr = prev; } + SCHED_FIRST_REG_MOVE (u) = NULL_RTX; } while (reg_move_replaces)
Subject: Re: wrong code in sixtrack for -fmodulo-sched The patch fixes the problem with sixtrack. I suspected that a latent problem was causing the earlier failures in lucas and apsi which have since gone away. They failed on 20050429, but with the patch applied to sources from that date they pass. Yea!
Subject: Bug 21138 CVSROOT: /cvs/gcc Module name: gcc Changes by: hagog@gcc.gnu.org 2005-06-01 05:26:45 Modified files: gcc : ChangeLog modulo-sched.c Log message: 2005-06-01 Mostafa Hagog <mustafa@il.ibm.com> * modulo-sched.c (undo_generate_reg_moves ): Fix PR 21138. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.8968&r2=2.8969 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/modulo-sched.c.diff?cvsroot=gcc&r1=1.30&r2=1.31
Fixed.