diff options
author | hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-10-07 10:30:12 +0000 |
---|---|---|
committer | hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-10-07 10:30:12 +0000 |
commit | 2be65b687d9638d4c83d355c0772e5a18f8eefbf (patch) | |
tree | 14b22810ab7d692ae426b99afe666ef1bbc8f757 | |
parent | f555c5f32e1919898e49dc68a67d6e6d46d6b6ac (diff) | |
download | gcc-2be65b687d9638d4c83d355c0772e5a18f8eefbf.tar.gz |
Merge ix86_maybe_switch_abi with ix86_set_current_function
ix86_maybe_switch_abi is called to late during RTL expansion and we
use the stale information from compilation of the previous function.
aggregate_value_p uses call_used_regs. aggregate_value_p is used by
IPA and return value optimization, which are called before
ix86_maybe_switch_abi is called. This patch merges ix86_maybe_switch_abi
with ix86_set_current_function.
PR target/67850
* config/i386/i386.c (ix86_maybe_switch_abi): Merged with ...
(ix86_set_current_function): This.
(TARGET_EXPAND_TO_RTL_HOOK): Removed.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@228565 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/config/i386/i386.c | 22 |
2 files changed, 15 insertions, 14 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bcbbde486f3..23560024d0f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2015-10-07 H.J. Lu <hongjiu.lu@intel.com> + + PR target/67850 + * config/i386/i386.c (ix86_maybe_switch_abi): Merged with ... + (ix86_set_current_function): This. + (TARGET_EXPAND_TO_RTL_HOOK): Removed. + 2015-10-07 Richard Biener <rguenther@suse.de> * tree-vectorizer.h (stmt_vec_info_vec): Use vec<stmt_vec_info>. diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 38953ddc4ae..c44f0af9528 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -6367,6 +6367,14 @@ ix86_set_current_function (tree fndecl) TREE_TARGET_GLOBALS (new_tree) = save_target_globals_default_opts (); } ix86_previous_fndecl = fndecl; + + /* 64-bit MS and SYSV ABI have different set of call used registers. + Avoid expensive re-initialization of init_regs each time we switch + function context. */ + if (TARGET_64BIT + && (call_used_regs[SI_REG] + == (cfun->machine->call_abi == MS_ABI))) + reinit_regs (); } @@ -7502,17 +7510,6 @@ ix86_call_abi_override (const_tree fndecl) cfun->machine->call_abi = ix86_function_abi (fndecl); } -/* 64-bit MS and SYSV ABI have different set of call used registers. Avoid - expensive re-initialization of init_regs each time we switch function context - since this is needed only during RTL expansion. */ -static void -ix86_maybe_switch_abi (void) -{ - if (TARGET_64BIT && - call_used_regs[SI_REG] == (cfun->machine->call_abi == MS_ABI)) - reinit_regs (); -} - /* Return 1 if pseudo register should be created and used to hold GOT address for PIC code. */ bool @@ -53911,9 +53908,6 @@ ix86_operands_ok_for_move_multiple (rtx *operands, bool load, #undef TARGET_CAN_INLINE_P #define TARGET_CAN_INLINE_P ix86_can_inline_p -#undef TARGET_EXPAND_TO_RTL_HOOK -#define TARGET_EXPAND_TO_RTL_HOOK ix86_maybe_switch_abi - #undef TARGET_LEGITIMATE_ADDRESS_P #define TARGET_LEGITIMATE_ADDRESS_P ix86_legitimate_address_p |