diff mbox

[Revised] Fix PR46037

Message ID 20110112062033.GA20131@bromo.med.uc.edu
State New
Headers show

Commit Message

Jack Howarth Jan. 12, 2011, 6:20 a.m. UTC
Current gcc trunk is unable to lto-bootstrap on darwin due to a
bug in darwin_override_options() where debug_hooks->var_location is
tested prematurely for setting flag_var_tracking_uninit. This can be
solved by switching the test for setting flag_var_tracking_uninit to
check write_symbols instead. The existing check on debug_info_level
also has to be enhanced to honor the current setting of flag_gtoggle.
Bootstrap and regression tested with a normal and lto-bootstrap on
x86_64-apple-darwin10. Okay for gcc trunk?
                Jack
ps I also removed the unnecessary parentheses from the test
on generating_for_darwin_version for consistent formatting. These
changes also appear to eliminate the regression...

XPASS: gcc.dg/tree-ssa/20040204-1.c scan-tree-dump-times optimized "link_error" 0

at -m32/-m64 on x86_64-apple-darwin10.



2011-01-12  Jan Hubicka  <jh@suse.cz>
            Jack Howarth <howarth@bromo.med.uc.edu>

	PR target/46037
	* config/darwin.c (darwin_override_options): Honor flag_gtoggle
	when checking debug_info_level. Test write_symbols instead of
	debug_hooks->var_location when setting flag_var_tracking_uninit.

Comments

Mike Stump Jan. 12, 2011, 11:10 a.m. UTC | #1
On Jan 11, 2011, at 10:20 PM, Jack Howarth <howarth@bromo.med.uc.edu> wrote:
>   Current gcc trunk is unable to lto-bootstrap on darwin due to a
> bug in darwin_override_options() where debug_hooks->var_location is
> tested prematurely for setting flag_var_tracking_uninit.

> Okay for gcc trunk?

Ok.
Jack Howarth Jan. 13, 2011, 1:54 p.m. UTC | #2
On Wed, Jan 12, 2011 at 03:10:13AM -0800, Mike Stump wrote:
> On Jan 11, 2011, at 10:20 PM, Jack Howarth <howarth@bromo.med.uc.edu> wrote:
> >   Current gcc trunk is unable to lto-bootstrap on darwin due to a
> > bug in darwin_override_options() where debug_hooks->var_location is
> > tested prematurely for setting flag_var_tracking_uninit.
> 
> > Okay for gcc trunk?
> 
> Ok.

Testresults for the revised patch using a lto-bootstrap with...

profiledbootstrap BOOT_CFLAGS="-g -O3" with --enable-build-with-cxx

on x86_64-apple-darwin10 at http://gcc.gnu.org/ml/gcc-testresults/2011-01/msg01087.html
with no regressions as well with revised patch applied. Likewise a lto-bootstrap
on powerpc-apple-darwin9 works. Can one of you commit this into gcc trunk? Thanks.
         Jack
diff mbox

Patch

Index: gcc/config/darwin.c
===================================================================
--- gcc/config/darwin.c	(revision 168683)
+++ gcc/config/darwin.c	(working copy)
@@ -2616,9 +2616,10 @@  darwin_override_options (void)
     }
 
   if (flag_var_tracking
-      && (generating_for_darwin_version >= 9)
-      && debug_info_level >= DINFO_LEVEL_NORMAL
-      && debug_hooks->var_location != do_nothing_debug_hooks.var_location)
+      && generating_for_darwin_version >= 9
+      && (flag_gtoggle ? (debug_info_level == DINFO_LEVEL_NONE)
+      : (debug_info_level >= DINFO_LEVEL_NORMAL))
+      && write_symbols == DWARF2_DEBUG)
     flag_var_tracking_uninit = 1;
 
   if (MACHO_DYNAMIC_NO_PIC_P)