[Bug middle-end/20983] [4.0/4.1/4.2/4.3 Regression] varargs functions force va_list variable to stack unnecessarily

2007-12-06 Thread jakub at gcc dot gnu dot org


--- Comment #13 from jakub at gcc dot gnu dot org  2007-12-06 13:25 ---
Subject: Bug 20983

Author: jakub
Date: Thu Dec  6 13:25:37 2007
New Revision: 130650

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=130650
Log:
PR middle-end/20983
* tree-ssa-ccp.c (optimize_stdarg_builtin): New function.
(execute_fold_all_builtins): Call it for BUILT_IN_VA_START,
BUILT_IN_VA_COPY and BUILT_IN_VA_END.

* target.h (struct ggc_target): Add expand_builtin_va_start
hook.
* target-def.h (TARGET_EXPAND_BUILTIN_VA_START): Define.
(TARGET_INITIALIZER): Add it.
* builtins.c (expand_builtin_va_start): Use
targetm.expand_builtin_va_start hook instead of
EXPAND_BUILTIN_VA_START macro.
* alpha/alpha.c (alpha_va_start): Made static.
(override_options): Clear targetm.expand_builtin_va_start if
TARGET_UNICOSMK.
(TARGET_EXPAND_BUILTIN_VA_START): Define.
* alpha/unicosmk.h (EXPAND_BUILTIN_VA_START): Remove.
* alpha/alpha.h (EXPAND_BUILTIN_VA_START): Remove.
* alpha/alpha-protos.h (alpha_va_start): Remove prototype.
* xtensa/xtensa.h (EXPAND_BUILTIN_VA_START): Remove.
* xtensa/xtensa.c (TARGET_EXPAND_BUILTIN_VA_START): Define.
(xtensa_va_start): Made static.
* xtensa/xtensa-protos.h (xtensa_va_start): Remove prototype.
* pa/pa-protos.h (hppa_va_start): Remove prototype.
* pa/pa.h (EXPAND_BUILTIN_VA_START): Remove.
* pa/pa.c (hppa_va_start): Made static, add prototype.
(TARGET_EXPAND_BUILTIN_VA_START): Define.
* frv/frv.c (frv_expand_builtin_va_start): Made static, add prototype.
(TARGET_EXPAND_BUILTIN_VA_START): Define.
* frv/frv-protos.h (frv_expand_builtin_va_start): Remove prototype.
* frv/frv.h (EXPAND_BUILTIN_VA_START): Remove.
* i386/i386.c (override_options): Clear
targetm.expand_builtin_va_start if -m32 or 64-bit MS ABI.
(ix86_va_start): Made static.
(TARGET_EXPAND_BUILTIN_VA_START): Define.
* i386/i386.h (EXPAND_BUILTIN_VA_START): Remove.
* i386/i386-protos.h (ix86_va_start, ix86_va_arg): Remove prototypes.
* iq2000/iq2000-protos.h (iq2000_va_start): Remove prototype.
* iq2000/iq2000.h (EXPAND_BUILTIN_VA_START): Remove.
* iq2000/iq2000.c (iq2000_va_start): Made static, add prototype.
(TARGET_EXPAND_BUILTIN_VA_START): Define.
* rs6000/rs6000-protos.h (rs6000_va_start): Remove prototype.
* rs6000/rs6000.c (rs6000_va_start): Made static, add prototype.
(TARGET_EXPAND_BUILTIN_VA_START): Define.
(rs6000_override_options): Clear targetm.expand_builtin_va_start if
DEFAULT_ABI != ABI_V4.
* rs6000/rs6000.h (EXPAND_BUILTIN_VA_START): Remove.
* spu/spu.c (spu_va_start): Made static, add prototype.
(TARGET_EXPAND_BUILTIN_VA_START): Define.
* spu/spu.h (EXPAND_BUILTIN_VA_START): Remove.
* spu/spu-protos.h spu_va_start): Remove prototype.
* stormy16/stormy16.h (EXPAND_BUILTIN_VA_START): Remove.
* stormy16/stormy16-protos.h (xstormy16_expand_builtin_va_start):
Remove prototype.
* stormy16/stormy16.c (xstormy16_expand_builtin_va_start): Made
static.
(TARGET_EXPAND_BUILTIN_VA_START): Define.
* s390/s390-protos.h (s390_va_start): Remove prototype.
* s390/s390.c (s390_va_start): Made static.
(TARGET_EXPAND_BUILTIN_VA_START): Define.
* s390/s390.h (EXPAND_BUILTIN_VA_START): Remove.
* mn10300/mn10300.h (EXPAND_BUILTIN_VA_START): Remove.
* mn10300/mn10300-protos.h (mn10300_va_start): Remove prototype.
* mn10300/mn10300.c (mn10300_va_start): Made static, add prototype.
(TARGET_EXPAND_BUILTIN_VA_START): Define.
* arc/arc.c (arc_va_start): Made static, add prototype.
(TARGET_EXPAND_BUILTIN_VA_START): Define.
* arc/arc.h (EXPAND_BUILTIN_VA_START): Remove.
* arc/arc-protos.h (arc_va_start): Remove prototype.
* mt/mt-protos.h (mt_va_start): Remove prototype.
* sparc/sparc.c (sparc_va_start): Made static, add prototype.
(TARGET_EXPAND_BUILTIN_VA_START): Define.
* sparc/sparc-protos.h (sparc_va_start): Remove prototype.
* sparc/sparc.h (EXPAND_BUILTIN_VA_START): Remove.
* sh/sh.c (sh_va_start): Made static, add prototype.
(TARGET_EXPAND_BUILTIN_VA_START): Define.
* sh/sh-protos.h (sh_va_start): Remove prototype.
* sh/sh.h (EXPAND_BUILTIN_VA_START): Remove.
* mips/mips-protos.h (mips_va_start): Remove prototype.
* mips/mips.h (EXPAND_BUILTIN_VA_START): Remove.
* mips/mips.c (mips_va_start): Made static.
(TARGET_EXPAND_BUILTIN_VA_START): Define.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/builtins.c
trunk/gcc/config/alpha/alpha-protos.h
trunk/gcc/config/alpha/alpha.c

[Bug middle-end/20983] [4.0/4.1/4.2/4.3 Regression] varargs functions force va_list variable to stack unnecessarily

2007-12-06 Thread jakub at gcc dot gnu dot org


--- Comment #14 from jakub at gcc dot gnu dot org  2007-12-06 13:28 ---
Fixed on the trunk.


-- 

jakub at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20983



[Bug middle-end/20983] [4.0/4.1/4.2/4.3 Regression] varargs functions force va_list variable to stack unnecessarily

2007-12-06 Thread rguenth at gcc dot gnu dot org


--- Comment #15 from rguenth at gcc dot gnu dot org  2007-12-06 16:54 
---
WONTFIX on the branches, adjusting target milestone.


-- 

rguenth at gcc dot gnu dot org changed:

   What|Removed |Added

  Known to fail||4.1.3 4.2.2
   Target Milestone|4.1.3   |4.3.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20983



[Bug middle-end/20983] [4.0/4.1/4.2/4.3 Regression] varargs functions force va_list variable to stack unnecessarily

2007-11-16 Thread jakub at gcc dot gnu dot org


--- Comment #12 from jakub at gcc dot gnu dot org  2007-11-16 12:15 ---
Posted patch: http://gcc.gnu.org/ml/gcc-patches/2007-11/msg00895.html


-- 

jakub at gcc dot gnu dot org changed:

   What|Removed |Added

URL||http://gcc.gnu.org/ml/gcc-
   ||patches/2007-
   ||11/msg00895.html


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20983



[Bug middle-end/20983] [4.0/4.1/4.2/4.3 Regression] varargs functions force va_list variable to stack unnecessarily

2007-11-15 Thread jakub at gcc dot gnu dot org


--- Comment #11 from jakub at gcc dot gnu dot org  2007-11-15 17:42 ---
Testing a patch which addresses the simple pointer va_list targets (i386,
non-v4-abi ppc{,64}, etc.).


-- 

jakub at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |jakub at gcc dot gnu dot org
   |dot org |
 Status|NEW |ASSIGNED
   Last reconfirmed|2006-07-05 09:23:01 |2007-11-15 17:42:02
   date||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20983



[Bug middle-end/20983] [4.0/4.1/4.2/4.3 Regression] varargs functions force va_list variable to stack unnecessarily

2007-06-18 Thread pinskia at gcc dot gnu dot org


--- Comment #10 from pinskia at gcc dot gnu dot org  2007-06-18 06:55 
---
For -O1, it is even worse.  I think we need to mark va_start/va_end as cannot
call clober their inputs at the tree level.  This should at least fix the -O1
issue.  It might also help code gen in other cases which I am not thinking of
currently.


-- 

pinskia at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||pinskia at gcc dot gnu dot
   ||org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20983



[Bug middle-end/20983] [4.0/4.1/4.2/4.3 Regression] varargs functions force va_list variable to stack unnecessarily

2007-02-14 Thread mmitchel at gcc dot gnu dot org


-- 

mmitchel at gcc dot gnu dot org changed:

   What|Removed |Added

   Target Milestone|4.1.2   |4.1.3


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20983