aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/gigi.h
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2012-06-15 10:41:13 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2012-06-15 10:41:13 +0000
commitf71d5704ba64939d2e70d055659cb2d72cbce40e (patch)
tree148a3d7dce2cb42680ee7534e42f3dec39e30ca7 /gcc/ada/gcc-interface/gigi.h
parent2da02156af964dbd197f19cbd7fea003a73aacb3 (diff)
downloadgcc-f71d5704ba64939d2e70d055659cb2d72cbce40e.zip
gcc-f71d5704ba64939d2e70d055659cb2d72cbce40e.tar.gz
gcc-f71d5704ba64939d2e70d055659cb2d72cbce40e.tar.bz2
re PR ada/53592 (ICE on assignment to component of vector_type)
PR ada/53592 * gcc-interface/gigi.h (maybe_vector_array): Make static inline. * gcc-interface/utils.c (maybe_vector_array): Delete. * gcc-interface/trans.c (gnat_to_gnu) <N_Indexed_Component>: Mark the array object as addressable if it has vector type and is on the LHS. From-SVN: r188653
Diffstat (limited to 'gcc/ada/gcc-interface/gigi.h')
-rw-r--r--gcc/ada/gcc-interface/gigi.h18
1 files changed, 14 insertions, 4 deletions
diff --git a/gcc/ada/gcc-interface/gigi.h b/gcc/ada/gcc-interface/gigi.h
index e2aac80..cfa52b0 100644
--- a/gcc/ada/gcc-interface/gigi.h
+++ b/gcc/ada/gcc-interface/gigi.h
@@ -783,10 +783,6 @@ extern tree remove_conversions (tree exp, bool true_address);
likewise return an expression pointing to the underlying array. */
extern tree maybe_unconstrained_array (tree exp);
-/* If EXP's type is a VECTOR_TYPE, return EXP converted to the associated
- TYPE_REPRESENTATIVE_ARRAY. */
-extern tree maybe_vector_array (tree exp);
-
/* Return an expression that does an unchecked conversion of EXPR to TYPE.
If NOTRUNC_P is true, truncation operations should be suppressed. */
extern tree unchecked_convert (tree type, tree expr, bool notrunc_p);
@@ -1033,6 +1029,20 @@ extern void enumerate_modes (void (*f) (const char *, int, int, int, int, int,
/* Convenient shortcuts. */
#define VECTOR_TYPE_P(TYPE) (TREE_CODE (TYPE) == VECTOR_TYPE)
+/* If EXP's type is a VECTOR_TYPE, return EXP converted to the associated
+ TYPE_REPRESENTATIVE_ARRAY. */
+
+static inline tree
+maybe_vector_array (tree exp)
+{
+ tree etype = TREE_TYPE (exp);
+
+ if (VECTOR_TYPE_P (etype))
+ exp = convert (TYPE_REPRESENTATIVE_ARRAY (etype), exp);
+
+ return exp;
+}
+
static inline unsigned HOST_WIDE_INT
ceil_pow2 (unsigned HOST_WIDE_INT x)
{