aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2019-06-29 07:32:09 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2019-06-29 07:32:09 +0000
commit1fb5a6163d49f66604ad4b1e3f5f3d9c26723a90 (patch)
treed484db9887d02453d7a5752e47506d47035a5108 /gcc
parentead7354efaee7cf0575b4d2c7bbdc5abf01b49a7 (diff)
downloadgcc-1fb5a6163d49f66604ad4b1e3f5f3d9c26723a90.zip
gcc-1fb5a6163d49f66604ad4b1e3f5f3d9c26723a90.tar.gz
gcc-1fb5a6163d49f66604ad4b1e3f5f3d9c26723a90.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: r272814
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog6
-rw-r--r--gcc/ada/gcc-interface/decl.c6
2 files changed, 10 insertions, 2 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index f51693a..e8a8e1c 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,9 @@
+2019-06-29 Eric Botcazou <ebotcazou@adacore.com>
+
+ * 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.
+
2019-05-28 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.c (walk_nesting_tree): New static function.
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index ebc441c..3a5126a 100644
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -6307,7 +6307,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
@@ -6317,7 +6318,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. */