diff options
author | Jakub Jelinek <jakub@redhat.com> | 2007-12-06 14:25:37 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2007-12-06 14:25:37 +0100 |
commit | d7bd8aebf66a8a05e02b6b3e6be7169e13532380 (patch) | |
tree | cef18ea9cceaa7495e72439b79c224d9d6d77889 /gcc/config/arc | |
parent | 4e9012fdc67829c5d302e2c1e9aaaf3058a8fc53 (diff) | |
download | gcc-d7bd8aebf66a8a05e02b6b3e6be7169e13532380.zip gcc-d7bd8aebf66a8a05e02b6b3e6be7169e13532380.tar.gz gcc-d7bd8aebf66a8a05e02b6b3e6be7169e13532380.tar.bz2 |
re PR middle-end/20983 (varargs functions force va_list variable to stack unnecessarily)
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.
From-SVN: r130650
Diffstat (limited to 'gcc/config/arc')
-rw-r--r-- | gcc/config/arc/arc-protos.h | 2 | ||||
-rw-r--r-- | gcc/config/arc/arc.c | 6 | ||||
-rw-r--r-- | gcc/config/arc/arc.h | 5 |
3 files changed, 5 insertions, 8 deletions
diff --git a/gcc/config/arc/arc-protos.h b/gcc/config/arc/arc-protos.h index 9eadf35..c9fc51a 100644 --- a/gcc/config/arc/arc-protos.h +++ b/gcc/config/arc/arc-protos.h @@ -17,8 +17,6 @@ You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>. */ -extern void arc_va_start (tree, rtx); - #ifdef RTX_CODE extern enum machine_mode arc_select_cc_mode (enum rtx_code, rtx, rtx); diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c index a1e04af..5b2e7b8 100644 --- a/gcc/config/arc/arc.c +++ b/gcc/config/arc/arc.c @@ -89,6 +89,7 @@ static void arc_output_function_prologue (FILE *, HOST_WIDE_INT); static void arc_output_function_epilogue (FILE *, HOST_WIDE_INT); static void arc_file_start (void); static void arc_internal_label (FILE *, const char *, unsigned long); +static void arc_va_start (tree, rtx); static void arc_setup_incoming_varargs (CUMULATIVE_ARGS *, enum machine_mode, tree, int *, int); static bool arc_rtx_costs (rtx, int, int, int *); @@ -144,6 +145,9 @@ static bool arc_pass_by_reference (CUMULATIVE_ARGS *, enum machine_mode, #undef TARGET_SETUP_INCOMING_VARARGS #define TARGET_SETUP_INCOMING_VARARGS arc_setup_incoming_varargs +#undef TARGET_EXPAND_BUILTIN_VA_START +#define TARGET_EXPAND_BUILTIN_VA_START arc_va_start + struct gcc_target targetm = TARGET_INITIALIZER; /* Implement TARGET_HANDLE_OPTION. */ @@ -2274,7 +2278,7 @@ arc_ccfsm_record_branch_deleted (void) current_insn_set_cc_p = last_insn_set_cc_p; } -void +static void arc_va_start (tree valist, rtx nextarg) { /* See arc_setup_incoming_varargs for reasons for this oddity. */ diff --git a/gcc/config/arc/arc.h b/gcc/config/arc/arc.h index 05f4aad..17412fc 100644 --- a/gcc/config/arc/arc.h +++ b/gcc/config/arc/arc.h @@ -1086,8 +1086,3 @@ enum arc_function_type { #define ARC_INTERRUPT_P(TYPE) \ ((TYPE) == ARC_FUNCTION_ILINK1 || (TYPE) == ARC_FUNCTION_ILINK2) /* Compute the type of a function from its DECL. */ - - -/* Implement `va_start' for varargs and stdarg. */ -#define EXPAND_BUILTIN_VA_START(valist, nextarg) \ - arc_va_start (valist, nextarg) |