This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: 4.0 regression: missing debug info for global variables in C with -O2
- From: Ulrich Weigand <uweigand at de dot ibm dot com>
- To: pinskia at physics dot uc dot edu (Andrew Pinski)
- Cc: gcc at gcc dot gnu dot org, uweigand at de dot ibm dot com (Ulrich Weigand), mark at codesourcery dot com, pinskia at physics dot uc dot edu (Andrew Pinski)
- Date: Mon, 30 May 2005 22:13:19 +0200 (CEST)
- Subject: 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