Bug 56708 - g++ (gcc-c++-2.96-85.i386.rpm) generates incorrect code
g++ (gcc-c++-2.96-85.i386.rpm) generates incorrect code
Status: CLOSED CURRENTRELEASE
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
7.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-11-26 03:07 EST by David Warme
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:
Environment:
Last Closed: 2004-10-01 20:52:15 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
C++ source file for which g++ (gcc-c++-2.96-85.i386.rpm) gives bad code (3.53 KB, text/plain)
2001-11-26 03:11 EST, David Warme
no flags Details

  None (edit)
Description David Warme 2001-11-26 03:07:32 EST
From Bugzilla Helper:
User-Agent: Mozilla/4.75 [en] (X11; U; Linux 2.2.16-22smp i686)

Description of problem:
Incorrect code is generated to evaluate the third argument (&g_array [n])
in the constructor call "new reae_ArcPnode (...)" (last assignment
statement
in the file.  The value g_array.d_array is added to an uninitialized stack
location instead of the proper array offset.

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


How reproducible:
Always

Steps to Reproduce:
1. Get the source file "foo.cc".
2. g++ -S -O2 foo.cc
3. Examine generated "foo.s" file.  Search for "sprintf", which is called
right
   near the point where the bad code is generated.  On my system, the bad
   code can be found by searching backwards for the string "-104(%ebp)"
   which is the uninitialized stack location to which the array base is
added.
	

Actual Results:  The erroneous instruction is:

	addl	%eax, -104(%ebp)

Unfortunately, -104(%ebp) is uninitialized at this point.

Expected Results:  Should generate correct code.  For example, code
that placed the value 16*n into location -104(%ebp).

Additional info:
Comment 1 David Warme 2001-11-26 03:11:25 EST
Created attachment 38524 [details]
C++ source file for which g++ (gcc-c++-2.96-85.i386.rpm) gives bad code
Comment 2 Jakub Jelinek 2001-11-28 05:08:50 EST
Cannot reproduce this with gcc-c++-2.96-101 or (unless I screwed up)
gcc-c++-2.96-86. If the fixing release was really 2.96-86, then I'd guess
it is #40069 (don't want to spent time debugging whether it really is that
or not). Anyway, can you try a more recent gcc?
Comment 3 David Warme 2001-11-28 17:35:45 EST
> Anyway, can you try a more recent gcc?

OK, so how do I get copies of gcc-{c|c++|f77|objc}-2.96-86.i386.rpm?
The newest stuff I see advertised for download for RH 7.0 is 2.96-85,
which is what I have?
Comment 4 Richard Henderson 2004-10-01 20:52:15 EDT
Fixed.

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