Bug 48367 - [4.7 Regression] 200.sixtrack/301.apsi in SPEC CPU 2000 are miscompiled
Summary: [4.7 Regression] 200.sixtrack/301.apsi in SPEC CPU 2000 are miscompiled
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.7.0
: P3 normal
Target Milestone: 4.7.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-30 14:51 UTC by H.J. Lu
Modified: 2011-04-12 16:15 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description H.J. Lu 2011-03-30 14:51:14 UTC
On Linux/ia32, revision 171716 gave

  Running 200.sixtrack ref peak lnx32-gcc default
*** Miscompare of inp.out, see /export/gnu/import/svn/gcc-test-spec/spec/2000/i6
86/spec/benchspec/CFP2000/200.sixtrack/run/00000004/inp.out.mis
  Running 301.apsi ref peak lnx32-gcc default
*** Miscompare of APO11, see /export/gnu/import/svn/gcc-test-spec/spec/2000/i686
/spec/benchspec/CFP2000/301.apsi/run/00000004/APO11.mis
*** Miscompare of APO6, see /export/gnu/import/svn/gcc-test-spec/spec/2000/i686/
spec/benchspec/CFP2000/301.apsi/run/00000004/APO6.mis
*** Miscompare of APO8, see /export/gnu/import/svn/gcc-test-spec/spec/2000/i686/
spec/benchspec/CFP2000/301.apsi/run/00000004/APO8.mis
*** Miscompare of APV, see /export/gnu/import/svn/gcc-test-spec/spec/2000/i686/s
pec/benchspec/CFP2000/301.apsi/run/00000004/APV.mis

Revision 171623 is OK.
Comment 1 H.J. Lu 2011-03-30 16:19:40 UTC
It is caused by revision 171649:

http://gcc.gnu.org/ml/gcc-cvs/2011-03/msg01074.html
Comment 2 H.J. Lu 2011-03-30 16:26:14 UTC
I used "-O3 -funroll-loops -msse2 -mfpmath=sse -ffast-math" to
compile it.
Comment 3 H.J. Lu 2011-03-30 16:53:11 UTC
It still fails at revision 171734.
Comment 4 Vladimir Makarov 2011-03-30 23:17:58 UTC
I've started to work on this.  Probably it will take day or two to fix it is hard to find a wrong code in a big program as apsi.
Comment 5 Vladimir Makarov 2011-03-31 01:04:47 UTC
Author: vmakarov
Date: Thu Mar 31 01:04:43 2011
New Revision: 171767

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=171767
Log:
2011-03-30  Vladimir Makarov  <vmakarov@redhat.com>

	PR middle-end/48367
	* ira-costs.c (find_costs_and_classes): Fix a typo in i_mem_cost
	calculation.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/ira-costs.c
Comment 6 Vladimir Makarov 2011-03-31 01:05:33 UTC
  The problem was in a typo in ira-costs.c which in some cases results in assigning INT_MAX to memory_cost and as consequence ALL_REGS to some allocnos.  After some optimizations the allocno which got a hard reg and corresponds to loop which contains subloops and never referenced in its loop is spilled in function move_spill_restore and because it is never referenced in the loop, it got zero costs for all hard regs.

In reload, the allocno is assigned to a mmx hard register through IRA which corrupted by sse registers usage in other program places.

I'll sent a patch soon to fix this.
Comment 7 H.J. Lu 2011-04-12 16:15:20 UTC
Fixed as of revision 172273:

http://gcc.gnu.org/ml/gcc-testresults/2011-04/msg00958.html