This is the mail archive of the gcc-patches@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]

[rtlopt] better setting of flag_var_tracking


Hi,

this patch changes when var-tracking is called.
It is always called when user wants it (-fvar-tracking)
and never when user does not want it (-fno-var-tracking).
Otherwise it is called when compiling with optimization and
debug output and debug output supports var_location hook
(optimize >= 1 && debug_info_level >= DINFO_LEVEL_NORMAL
 && debug_hooks->var_location != do_nothing_debug_hooks.var_location)

Bootstrapped i386 (athlon).

Josef

2003-01-26  Josef Zlomek  <zlomekj@suse.cz>

	* toplev.c (rest_of_compilation): Run variable tracking
	(only) if flag_var_tracking != 0.
	(parse_options_and_default_flags): do not set flag_var_tracking
	when optimize >= 1.
	(process_options): If user has not specified flag_var_tracking set
	it according to optimize, debug_info_level and debug_hooks.

Index: toplev.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/toplev.c,v
retrieving revision 1.668.2.31
diff -c -3 -p -r1.668.2.31 toplev.c
*** toplev.c	25 Jan 2003 11:45:39 -0000	1.668.2.31
--- toplev.c	26 Jan 2003 15:02:23 -0000
*************** tree current_function_func_begin_label;
*** 384,392 ****
  
  int flag_eliminate_dwarf2_dups = 0;
  
! /* Nonzero if we should track variables.  */
  
! int flag_var_tracking = 0;
  
  /* Nonzero if generating code to do profiling.  */
  
--- 384,395 ----
  
  int flag_eliminate_dwarf2_dups = 0;
  
! /* Nonzero if we should track variables.  When
!    flag_var_tracking == AUTODETECT_FLAG_VAR_TRACKING it will be set according
!    to optimize, debug_info_level and debug_hooks in process_options ().  */
 
! #define AUTODETECT_FLAG_VAR_TRACKING 2
! int flag_var_tracking = AUTODETECT_FLAG_VAR_TRACKING;
  
  /* Nonzero if generating code to do profiling.  */
  
*************** rest_of_compilation (decl)
*** 3708,3715 ****
      }
    compute_alignments ();
  
!   /* Is the condition correct?  */
!   if (debug_info_level >= DINFO_LEVEL_NORMAL && flag_var_tracking)
      {
        /* Track the variables, ie. compute where the variable is stored
         in each position in function.  */
--- 3711,3717 ----
      }
    compute_alignments ();
  
!   if (flag_var_tracking)
      {
        /* Track the variables, ie. compute where the variable is stored
         in each position in function.  */
*************** parse_options_and_default_flags (argc, a
*** 5049,5055 ****
  
    if (optimize >= 1)
      {
-       flag_var_tracking = 1;
        flag_defer_pop = 1;
        flag_thread_jumps = 1;
  #ifdef DELAY_SLOTS
--- 5051,5056 ----
*************** process_options ()
*** 5369,5374 ****
--- 5370,5385 ----
    if (write_symbols == VMS_DEBUG || write_symbols == VMS_AND_DWARF2_DEBUG)
      debug_hooks = &vmsdbg_debug_hooks;
  #endif
+ 
+   /* Now we know which debug output will be used so we can set
+      flag_var_tracking if user has not specified it.  */
+   if (flag_var_tracking == AUTODETECT_FLAG_VAR_TRACKING)
+     {
+       /* User has not specified -f(no-)var-tracking so autodetect it.  */
+       flag_var_tracking
+ 	= (optimize >= 1 && debug_info_level >= DINFO_LEVEL_NORMAL
+ 	   && debug_hooks->var_location != do_nothing_debug_hooks.var_location);
+     }
  
    /* If auxiliary info generation is desired, open the output file.
       This goes in the same directory as the source file--unlike


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