Unfortunately, but 8603 seems to cause internal compiler errors on select files when using -O3. -O{s,0,1,2} are unaffected. I'm attaching pp.i (preprocessed pp.c from libperl), and flist.i (preprocessed flist.c from rsync) as test cases. gcc-4.3.4 does not exhibit this failure, but when patched from bug 8603, it fails. gcc-4.4.1 does not exhibit this failure, but gcc-4.4.2, which includes the patch from 8603, does fail.
Created attachment 19061 [details] Test Case 1 - pp.i - preprocessed pp.c from libperl
Created attachment 19062 [details] Test Case 2 - flist.i - preprocessed flist.c from rsync
Both files compile OK with 4.5 cross from x86_64-pc-linux-gnu. Probably a target specific patch should be backported from mainline to 4.3 and 4.4 branches.
Confirmed with 4.4 cross.
This reduced testcase fails also on 4.5: --cut here-- int make_file (int a, int b) { int foo = a * sizeof (int); if (b) foo += sizeof (int); return foo; } --cut here--
Created attachment 19067 [details] patch to fix mode of scratch register in *cmp_s{add,sub}_si{,di} This patch fixes wrong modes of scratch register in *cmp_s{add,sub}_si{,di} patterns.
I can confirm that the attached patch fixes the issue. Thanks!
Subject: Bug 42113 Author: uros Date: Sun Nov 22 09:30:50 2009 New Revision: 154423 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=154423 Log: PR target/42113 * config/alpha/alpha.md (*cmp_sadd_si): Change mode of scratch register to SImode. (*cmp_sadd_sidi): Ditto. (*cmp_ssub_si): Ditto. (*cmp_ssub_sidi): Ditto. testsuite/ChangeLog: PR target/42113 * gcc.target/alpha/pr42113.c: New test. Added: trunk/gcc/testsuite/gcc.target/alpha/pr42113.c Modified: trunk/gcc/ChangeLog trunk/gcc/config/alpha/alpha.md trunk/gcc/testsuite/ChangeLog
WRT the test suite: should it be /* { dg-options "-O2" } */ or /* { dg-options "-O3" } */ That is, -O2 or -O3? I could only produce the internal compiler error with -O3, and not at all with -Os, -O0, -O1, -O2.
Subject: Re: [4.3/4.4/4.5 Regression] Internal Compiler error with -O3, breaking commit known On 11/22/2009 06:52 PM, mattst88 at gmail dot com wrote: > ------- Comment #9 from mattst88 at gmail dot com 2009-11-22 17:52 ------- > WRT the test suite: should it be > > /* { dg-options "-O2" } */ > > or > > /* { dg-options "-O3" } */ > > That is, -O2 or -O3? I could only produce the internal compiler error with -O3, > and not at all with -Os, -O0, -O1, -O2. > The testcase also fails with -O2,. Uros.
Subject: Bug 42113 Author: uros Date: Mon Nov 23 21:14:32 2009 New Revision: 154464 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=154464 Log: PR target/42113 * config/alpha/alpha.md (*cmp_sadd_si): Change mode of scratch register to SImode. (*cmp_sadd_sidi): Ditto. (*cmp_ssub_si): Ditto. (*cmp_ssub_sidi): Ditto. testsuite/ChangeLog: PR target/42113 * gcc.target/alpha/pr42113.c: New test. Added: branches/gcc-4_4-branch/gcc/testsuite/gcc.target/alpha/pr42113.c Modified: branches/gcc-4_4-branch/gcc/ChangeLog branches/gcc-4_4-branch/gcc/config/alpha/alpha.md branches/gcc-4_4-branch/gcc/testsuite/ChangeLog
Subject: Bug 42113 Author: uros Date: Mon Nov 23 21:27:30 2009 New Revision: 154465 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=154465 Log: PR target/42113 * config/alpha/alpha.md (*cmp_sadd_si): Change mode of scratch register to SImode. (*cmp_sadd_sidi): Ditto. (*cmp_ssub_si): Ditto. (*cmp_ssub_sidi): Ditto. testsuite/ChangeLog: PR target/42113 * gcc.target/alpha/pr42113.c: New test. Added: branches/gcc-4_3-branch/gcc/testsuite/gcc.target/alpha/pr42113.c Modified: branches/gcc-4_3-branch/gcc/ChangeLog branches/gcc-4_3-branch/gcc/config/alpha/alpha.md branches/gcc-4_3-branch/gcc/testsuite/ChangeLog
Fixed.
Subject: Bug 42113 Author: uros Date: Fri Mar 26 18:45:56 2010 New Revision: 157759 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=157759 Log: PR target/42113 * config/alpha/alpha.md (*cmp_sadd_si): Change mode of scratch register to DImode. Split to DImode comparison operator. Use SImode subreg of scratch register in the multiplication. (*cmp_sadd_sidi): Ditto. (*cmp_ssub_si): Ditto. (*cmp_ssub_sidi): Ditto. Modified: trunk/gcc/ChangeLog trunk/gcc/config/alpha/alpha.md
Subject: Bug 42113 Author: uros Date: Sat Mar 27 12:09:24 2010 New Revision: 157774 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=157774 Log: PR target/42113 * config/alpha/alpha.md (*cmp_sadd_si): Change mode of scratch register to DImode. Split to DImode comparison operator. Use SImode subreg of scratch register in the multiplication. (*cmp_sadd_sidi): Ditto. (*cmp_ssub_si): Ditto. (*cmp_ssub_sidi): Ditto. Modified: branches/gcc-4_4-branch/gcc/ChangeLog branches/gcc-4_4-branch/gcc/config/alpha/alpha.md
Subject: Bug 42113 Author: uros Date: Sat Mar 27 12:15:50 2010 New Revision: 157775 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=157775 Log: PR target/42113 * config/alpha/alpha.md (*cmp_sadd_si): Change mode of scratch register to DImode. Split to DImode comparison operator. Use SImode subreg of scratch register in the multiplication. (*cmp_sadd_sidi): Ditto. (*cmp_ssub_si): Ditto. (*cmp_ssub_sidi): Ditto. Modified: branches/gcc-4_3-branch/gcc/ChangeLog branches/gcc-4_3-branch/gcc/config/alpha/alpha.md
Fixed in a better way.