summaryrefslogtreecommitdiff
path: root/gcc/loop-invariant.c
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2012-10-18 15:46:04 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2012-10-18 15:46:04 +0000
commit520a90d9ed08cfacf20f2133b8dc668a0f650b02 (patch)
treed84b88ed326331e10e4d041c61d14b4c0fbe5bb0 /gcc/loop-invariant.c
parent72b3292b367aaef4b89600888c0f87c5e2d04e7b (diff)
downloadgcc-520a90d9ed08cfacf20f2133b8dc668a0f650b02.tar.gz
* 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). git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@192566 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/loop-invariant.c')
-rw-r--r--gcc/loop-invariant.c18
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;