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:
Created attachment 38524 [details] C++ source file for which g++ (gcc-c++-2.96-85.i386.rpm) gives bad code
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?
> 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?
Fixed.