Commit 1a17bd35 by Eric Botcazou Committed by Eric Botcazou

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
parent 27a9462d
2012-10-18 Eric Botcazou <ebotcazou@adacore.com>
* 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).
2012-10-18 Eric Botcazou <ebotcazou@adacore.com>
* except.c (sjlj_emit_function_enter): Remove unused variable.
2012-10-18 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
......@@ -3101,7 +3101,7 @@ loop-iv.o : loop-iv.c $(CONFIG_H) $(SYSTEM_H) coretypes.h dumpfile.h \
intl.h $(DIAGNOSTIC_CORE_H) $(DF_H) $(HASHTAB_H)
loop-invariant.o : loop-invariant.c $(CONFIG_H) $(SYSTEM_H) coretypes.h dumpfile.h \
$(RTL_H) $(BASIC_BLOCK_H) hard-reg-set.h $(CFGLOOP_H) $(EXPR_H) $(RECOG_H) \
$(TM_H) $(TM_P_H) $(FUNCTION_H) $(FLAGS_H) $(DF_H) \
$(TM_H) $(TM_P_H) $(FUNCTION_H) $(FLAGS_H) $(DF_H) $(TARGET_H) \
$(OBSTACK_H) $(HASHTAB_H) $(EXCEPT_H) $(PARAMS_H) $(REGS_H) ira.h
cfgloopmanip.o : cfgloopmanip.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) \
$(BASIC_BLOCK_H) hard-reg-set.h $(CFGLOOP_H) \
......
......@@ -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;
......
2012-10-18 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/loop_optimization13.ad[sb]: New test.
* gnat.dg/loop_optimization13_pkg.ads: New helper.
2012-10-18 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
* gcc.target/arm/neon/vfmaQf32.c: New testcase.
......
-- { dg-do compile }
-- { dg-options "-O" }
with Loop_Optimization13_Pkg; use Loop_Optimization13_Pkg;
package body Loop_Optimization13 is
function F (A : Rec) return Rec is
N : constant Integer := A.V'Length / L;
Res : Rec
:= (True, new Complex_Vector' (0 .. A.V'Length / L - 1 => (0.0, 0.0)));
begin
for I in 0 .. L - 1 loop
for J in 0 .. N - 1 loop
Res.V (J) := Res.V (J) + A.V (I * N + J);
end loop;
end loop;
return Res;
end;
end Loop_Optimization13;
with Ada.Numerics.Complex_Types; use Ada.Numerics.Complex_Types;
package Loop_Optimization13 is
type Complex_Vector is array (Integer range <>) of Complex;
type Complex_Vector_Ptr is access Complex_Vector;
type Rec (Kind : Boolean := False) is record
case Kind is
when True => V : Complex_Vector_Ptr;
when False => null;
end case;
end record;
function F (A : Rec) return Rec;
end Loop_Optimization13;
package Loop_Optimization13_Pkg is
L : Integer;
end Loop_Optimization13_Pkg;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment