diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2012-10-18 15:46:04 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2012-10-18 15:46:04 +0000 |
commit | 1a17bd35048b702b3c5eb2ece720588a77e842c1 (patch) | |
tree | d84b88ed326331e10e4d041c61d14b4c0fbe5bb0 /gcc/loop-invariant.c | |
parent | 27a9462d4f83c099758d1cd3c176a1f8198e90a1 (diff) | |
download | gcc-1a17bd35048b702b3c5eb2ece720588a77e842c1.tar.gz |
loop-invariant.c: Include target.h.
* loop-invariant.c: Include target.h.
(check_dependency): Return false for an uninitialized argument register
that is likely to be spilled.
* Makefile.in (loop-invariant.o): Add $(TARGET_H).
From-SVN: r192566
Diffstat (limited to 'gcc/loop-invariant.c')
-rw-r--r-- | gcc/loop-invariant.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/gcc/loop-invariant.c b/gcc/loop-invariant.c index a420569fd43..854b41c2ed6 100644 --- a/gcc/loop-invariant.c +++ b/gcc/loop-invariant.c @@ -47,6 +47,7 @@ along with GCC; see the file COPYING3. If not see #include "cfgloop.h" #include "expr.h" #include "recog.h" +#include "target.h" #include "function.h" #include "flags.h" #include "df.h" @@ -784,7 +785,22 @@ check_dependency (basic_block bb, df_ref use, bitmap depends_on) defs = DF_REF_CHAIN (use); if (!defs) - return true; + { + unsigned int regno = DF_REF_REGNO (use); + + /* If this is the use of an uninitialized argument register that is + likely to be spilled, do not move it lest this might extend its + lifetime and cause reload to die. This can occur for a call to + a function taking complex number arguments and moving the insns + preparing the arguments without moving the call itself wouldn't + gain much in practice. */ + if ((DF_REF_FLAGS (use) & DF_HARD_REG_LIVE) + && FUNCTION_ARG_REGNO_P (regno) + && targetm.class_likely_spilled_p (REGNO_REG_CLASS (regno))) + return false; + + return true; + } if (defs->next) return false; |