This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: 4.0 regression: missing debug info for global variables in C with -O2


Andrew Pinski wrote:

> You can reproduce it using:
> static int i;
> int main(void)
> {
>    i += 3;
>    i *= 5;
>    return 0;
> }
> 
> and readelf and looking for the DW_TAG_variable tag.

Yes; in fact 'main' is even superfluous.  Just compile

  int var;

with -S -O2 -g on gcc 3.4 and 4.0 and look at the resulting
assembler file, the difference is quite obvious ...

Bye,
Ulrich


-- 
  Dr. Ulrich Weigand
  Linux on zSeries Development
  Ulrich.Weigand@de.ibm.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]