Bug 57027 - gcc 2.96 miscompiles some constructs with optimization -O2 or -O3
gcc 2.96 miscompiles some constructs with optimization -O2 or -O3
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Brian Brock
Depends On:
  Show dependency treegraph
Reported: 2001-12-03 11:33 EST by David Rasmussen
Modified: 2007-04-18 12:38 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-10-01 20:59:56 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

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

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 
argument is const) and later on flow just kills the move=move>>15, since 
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:

Steps to Reproduce:
1. Jakub knows...

Additional info:
Comment 1 Richard Henderson 2004-10-01 20:59:56 EDT
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.