Bug 56708 - g++ (gcc-c++-2.96-85.i386.rpm) generates incorrect code
Summary: g++ (gcc-c++-2.96-85.i386.rpm) generates incorrect code
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gcc   
(Show other bugs)
Version: 7.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-11-26 08:07 UTC by David Warme
Modified: 2007-04-18 16:38 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-10-02 00:52:15 UTC
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 08:11 UTC, David Warme
no flags Details

Description David Warme 2001-11-26 08:07:32 UTC
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 08:11:25 UTC
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 10:08:50 UTC
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 22:35:45 UTC
> 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-02 00:52:15 UTC
Fixed.


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