]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
decl.c (set_nonaliased_component_on_array_type): Add missing guard for the presence...
authorEric Botcazou <ebotcazou@adacore.com>
Sat, 29 Jun 2019 07:32:09 +0000 (07:32 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Sat, 29 Jun 2019 07:32:09 +0000 (07:32 +0000)
* 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

gcc/ada/ChangeLog
gcc/ada/gcc-interface/decl.c

index f51693a2611e1762737c202001526f36bb228a16..e8a8e1c89036c64f8e8ebd9242f9a284c8bec556 100644 (file)
@@ -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.
index ebc441ccc94be149f35444e229c2e818e3550ae5..3a5126ad3dad3c7915791227ca381dfff1b364fd 100644 (file)
@@ -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.  */