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]

C PATCH to emit_local_var


Dealing with temp slots can be expensive in functions with lots of
variables.  Really the data structure needs to be fixed, but this small
optimization can't hurt.

Tested i686-pc-linux-gnu, applied to trunk and tree-ssa.

2003-05-13  Jason Merrill  <jason@redhat.com>

        * c-semantics.c (emit_local_var): Don't mess with temp slots if
        there's no initializer.

*** c-semantics.c.~1~	2003-05-12 05:09:05.000000000 -0400
--- c-semantics.c	2003-05-08 03:25:47.000000000 -0400
*************** emit_local_var (decl)
*** 281,294 ****
  	expand_decl (decl);
      }
  
!   /* Actually do the initialization.  */
!   if (stmts_are_full_exprs_p ())
!     expand_start_target_temps ();
  
!   expand_decl_init (decl);
  
!   if (stmts_are_full_exprs_p ())
!     expand_end_target_temps ();
  }
  
  /* Helper for generating the RTL at the beginning of a scope.  */
--- 281,297 ----
  	expand_decl (decl);
      }
  
!   if (DECL_INITIAL (decl))
!     {
!       /* Actually do the initialization.  */
!       if (stmts_are_full_exprs_p ())
! 	expand_start_target_temps ();
  
!       expand_decl_init (decl);
  
!       if (stmts_are_full_exprs_p ())
! 	expand_end_target_temps ();
!     }
  }
  
  /* Helper for generating the RTL at the beginning of a scope.  */

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