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]

[PATCH][4.3] Backport fix for PR39496


This backports disabling the use of local calling-conventions at -O0.

Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to the
branch.

Richard.

Index: gcc/ChangeLog
===================================================================
*** gcc/ChangeLog	(revision 146581)
--- gcc/ChangeLog	(working copy)
***************
*** 1,3 ****
--- 1,13 ----
+ 2009-04-22  Richard Guenther  <rguenther@suse.de>
+ 
+ 	Backport from mainline:
+ 	PR target/39496
+ 	* config/i386/i386.c (ix86_function_regparm): Don't optimize
+ 	local functions using regparm calling conventions when not
+ 	optimizing.
+ 	(ix86_function_sseregparm): Similarly for sseregparm calling
+ 	conventions.
+ 
  2009-04-14  Uros Bizjak  <ubizjak@gmail.com>
  
  	Backport from mainline:
Index: gcc/config/i386/i386.c
===================================================================
*** gcc/config/i386/i386.c	(revision 146581)
--- gcc/config/i386/i386.c	(working copy)
*************** ix86_function_regparm (const_tree type,
*** 3239,3245 ****
  
    /* Use register calling convention for local functions when possible.  */
    if (decl && TREE_CODE (decl) == FUNCTION_DECL
!       && flag_unit_at_a_time && !profile_flag)
      {
        /* FIXME: remove this CONST_CAST when cgraph.[ch] is constified.  */
        struct cgraph_local_info *i = cgraph_local_info (CONST_CAST_TREE(decl));
--- 3239,3245 ----
  
    /* Use register calling convention for local functions when possible.  */
    if (decl && TREE_CODE (decl) == FUNCTION_DECL
!       && flag_unit_at_a_time && optimize && !profile_flag)
      {
        /* FIXME: remove this CONST_CAST when cgraph.[ch] is constified.  */
        struct cgraph_local_info *i = cgraph_local_info (CONST_CAST_TREE(decl));
*************** ix86_function_sseregparm (const_tree typ
*** 3326,3332 ****
  
    /* For local functions, pass up to SSE_REGPARM_MAX SFmode
       (and DFmode for SSE2) arguments in SSE registers.  */
!   if (decl && TARGET_SSE_MATH && flag_unit_at_a_time && !profile_flag)
      {
        /* FIXME: remove this CONST_CAST when cgraph.[ch] is constified.  */
        struct cgraph_local_info *i = cgraph_local_info (CONST_CAST_TREE(decl));
--- 3326,3333 ----
  
    /* For local functions, pass up to SSE_REGPARM_MAX SFmode
       (and DFmode for SSE2) arguments in SSE registers.  */
!   if (decl && TARGET_SSE_MATH
!       && flag_unit_at_a_time && optimize && !profile_flag)
      {
        /* FIXME: remove this CONST_CAST when cgraph.[ch] is constified.  */
        struct cgraph_local_info *i = cgraph_local_info (CONST_CAST_TREE(decl));
Index: gcc/testsuite/ChangeLog
===================================================================
*** gcc/testsuite/ChangeLog	(revision 146581)
--- gcc/testsuite/ChangeLog	(working copy)
***************
*** 1,3 ****
--- 1,10 ----
+ 2009-04-22  Richard Guenther  <rguenther@suse.de>
+ 
+ 	Backport from mainline:
+ 	PR target/39496
+ 	* gcc.target/i386/pr39496.c: New test.
+ 	* g++.dg/other/pr39496.C: New test.
+ 
  2009-04-14  Uros Bizjak  <ubizjak@gmail.com>
  
  	Backport from mainline:


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