[debuglocus] do not generate debuglocus unless -g

Andrew MacLeod amacleod@redhat.com
Mon Apr 13 20:13:00 GMT 2009


Aldy Hernandez wrote:
> This patch prevents us from generating debuglocus info when it's
> irrelevant.
>
> Tested on x86-64 Linux.
>
> OK for branch?
>
> 	* tree-into-ssa.c (rewrite_stmt): Generate debuglocus info if
> 	GENERATE_DEBUGLOCUS_P.
> 	(rewrite_add_phi_arguments): Same.
> 	(rewrite_into_ssa): Same.
> 	* debuglocus.c (debuglocus_bitmap_verify): Error out unless
> 	GENERATE_DEBUGLOCUS_P.
> 	* debuglocus.h (GENERATE_DEBUGLOCUS_P): New.
> 	* tree-ssa-phiopt.c (conditional_replacement): Update debuglocus
> 	info if GENERATE_DEBUGLOCUS_P.
> 	* tree-inline.c (copy_phis_for_bb): Same.
> 	* tree-outof-ssa.c (insert_copy_on_edge): Same.
> 	* Makefile.in (DEBUGLOCUS_H): New.
> 	Replace all debuglocus.h entries with $(DEBUGLOCUS_H).
>
>   
hmm. I'd rather change it to check at a lower level than within the callers.

If you check for the debug level in create_debuglocus_table(), and don't 
create the table, then you can modify create_debuglocus() to not create 
a debuglocus if there is no table. The ripple effect is you will need to 
change the main interface routine which is 
replace_locus_with_debuglocus() to handle a NULL debuglocus from the 
create_ routine, and not do a replacement, ie just leave the locus as it 
is.  Then doesn't the rest all fall into place?  The other routines will 
simply never find a debuglocus since they were never created, and things 
would progress as normally.  And you wouldn't have to clutter up the 
code with checks in the current places, or in the future places. Just 
the few creation routines that initially create debuglocus's.

It would take ever so slightly a hair longer at compile time, but it 
keeps the same compile path which is useful.

Andrew



More information about the Gcc-patches mailing list