aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/decl.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2019-06-29 07:30:22 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2019-06-29 07:30:22 +0000
commitd9888378d38544bc1261d533d250096144931fd9 (patch)
tree4970fa3a3f18be9ea163164468ae2d1e8c96556f /gcc/ada/gcc-interface/decl.c
parentb1af4cb2903711183e62f922fc235d48c7a738bb (diff)
downloadgcc-d9888378d38544bc1261d533d250096144931fd9.zip
gcc-d9888378d38544bc1261d533d250096144931fd9.tar.gz
gcc-d9888378d38544bc1261d533d250096144931fd9.tar.bz2
decl.c (set_nonaliased_component_on_array_type): Add missing guard for the presence of TYPE_CANONICAL.
* gcc-interface/decl.c (set_nonaliased_component_on_array_type): Add missing guard for the presence of TYPE_CANONICAL. (set_reverse_storage_order_on_array_type): Likewise. From-SVN: r272811
Diffstat (limited to 'gcc/ada/gcc-interface/decl.c')
-rw-r--r--gcc/ada/gcc-interface/decl.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index 4d33814..e38986b 100644
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -6150,7 +6150,8 @@ static void
set_nonaliased_component_on_array_type (tree type)
{
TYPE_NONALIASED_COMPONENT (type) = 1;
- TYPE_NONALIASED_COMPONENT (TYPE_CANONICAL (type)) = 1;
+ if (TYPE_CANONICAL (type))
+ TYPE_NONALIASED_COMPONENT (TYPE_CANONICAL (type)) = 1;
}
/* Set TYPE_REVERSE_STORAGE_ORDER on an array type built by means of
@@ -6160,7 +6161,8 @@ static void
set_reverse_storage_order_on_array_type (tree type)
{
TYPE_REVERSE_STORAGE_ORDER (type) = 1;
- TYPE_REVERSE_STORAGE_ORDER (TYPE_CANONICAL (type)) = 1;
+ if (TYPE_CANONICAL (type))
+ TYPE_REVERSE_STORAGE_ORDER (TYPE_CANONICAL (type)) = 1;
}
/* Return true if DISCR1 and DISCR2 represent the same discriminant. */