From 1ddde8dca28e6e8d35db1782938d33e5320145e2 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Fri, 2 Oct 2015 09:18:34 +0000 Subject: ada-tree.h (DECL_RESTRICTED_ALIASING_P): New flag. * gcc-interface/ada-tree.h (DECL_RESTRICTED_ALIASING_P): New flag. * gcc-interface/decl.c (gnat_to_gnu_param): For parameters passed by reference but whose type isn't by-ref and whose mechanism hasn't been forced to by-ref, set the DECL_RESTRICTED_ALIASING_P flag directly on them instead of changing their type. * gcc-interface/trans.c (scan_rhs_r): New helper function. (independent_iterations_p): New predicate. (Loop_Statement_to_gnu): For a loop with an iteration scheme, set an ivdep pragma if the iterations are independent. From-SVN: r228377 --- gcc/ada/gcc-interface/ada-tree.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'gcc/ada/gcc-interface/ada-tree.h') diff --git a/gcc/ada/gcc-interface/ada-tree.h b/gcc/ada/gcc-interface/ada-tree.h index 5f6d0a1..6864451 100644 --- a/gcc/ada/gcc-interface/ada-tree.h +++ b/gcc/ada/gcc-interface/ada-tree.h @@ -369,6 +369,21 @@ do { \ in the main unit, i.e. the full declaration is available. */ #define DECL_TAFT_TYPE_P(NODE) DECL_LANG_FLAG_0 (TYPE_DECL_CHECK (NODE)) +/* Nonzero in a PARM_DECL passed by reference but for which only a restricted + form of aliasing is allowed. The first restriction comes explicitly from + the RM 6.2(12) clause: there is no read-after-write dependency between a + store based on such a PARM_DECL and a load not based on this PARM_DECL, + so stores based on such PARM_DECLs can be sunk past all loads based on + a distinct object. The second restriction can be inferred from the same + clause: there is no write-after-write dependency between a store based + on such a PARM_DECL and a store based on a distinct such PARM_DECL, as + the compiler would be allowed to pass the parameters by copy and the + order of assignment to actual parameters after a call is arbitrary as + per the RM 6.4.1(17) clause, so stores based on distinct such PARM_DECLs + can be swapped. */ +#define DECL_RESTRICTED_ALIASING_P(NODE) \ + DECL_LANG_FLAG_0 (PARM_DECL_CHECK (NODE)) + /* Nonzero in a DECL if it is always used by reference, i.e. an INDIRECT_REF is needed to access the object. */ #define DECL_BY_REF_P(NODE) DECL_LANG_FLAG_1 (NODE) -- cgit v1.1