Bug 57027 - gcc 2.96 miscompiles some constructs with optimization -O2 or -O3
Summary: gcc 2.96 miscompiles some constructs with optimization -O2 or -O3
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gcc
Version: 7.2
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-12-03 16:33 UTC by David Rasmussen
Modified: 2007-04-18 16:38 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-10-02 00:59:56 UTC
Embargoed:


Attachments (Terms of Use)

Description David Rasmussen 2001-12-03 16:33:48 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 
1.0.2914)

Description of problem:
Quote from correspondence with Jakub:
The problem is with const in const Move move argument - the readonly
argument is first loaded into normal r/w pseudo register, then regmove
decides (seeing the pseudo is not read-only) to merge 2 different pseudo
registers together (move>>15 with move, since move is not used after that),
later on due to high register preassure reload reloads this into the stack
slot of the move argument (which is marked as unchanging though, because 
the
argument is const) and later on flow just kills the move=move>>15, since 
the
memory is marked read-only. In fact, all gccs up to 3.0.x are just papering
over this issue AFAIK, in gcc 3.1 this is solved for good.

Short term I'd propose you just get rid of the "const" in const Move move,
since you don't gain anything from it, I'll see if I can do something about
it such that it doesn't destabilize the compiler and doesn't result in
severe performance regressions either.


Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. Jakub knows...
2.
3.
	

Additional info:

Comment 1 Richard Henderson 2004-10-02 00:59:56 UTC
Argh.  No test case, or even a pointer to a test case.  But quote
from Jakub says this is fixed for gcc 3.1, so I'll believe him.


Note You need to log in before you can comment on or make changes to this bug.