[gcc/devel/omp/gcc-9] decl.c (set_nonaliased_component_on_array_type): Add missing guard for the presence of TYPE_CANONICA

Tobias Burnus burnus@gcc.gnu.org
Thu Mar 5 14:04:00 GMT 2020


https://gcc.gnu.org/g:ec90f3516117d1145ed994c0c25e8d21c54181b6

commit ec90f3516117d1145ed994c0c25e8d21c54181b6
Author: Eric Botcazou <ebotcazou@gcc.gnu.org>
Date:   Sat Jun 29 07:30:57 2019 +0000

    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: r272812

Diff:
---
 gcc/ada/ChangeLog            | 12 ++++++++----
 gcc/ada/gcc-interface/decl.c |  6 ++++--
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 259b814..00b6c25 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,14 +1,18 @@
-2019-06-18  Arnaud Charlet  <charlet@adacore.com>
+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.
 
-PR ada/80590
+2019-06-18  Arnaud Charlet  <charlet@adacore.com>
 
+	PR ada/80590
 	* sem_ch5.adb (Analyze_Loop_Statement): Avoid exception propagation
 	during normal processing.
 
 2019-06-17  Arnaud Charlet  <charlet@adacore.com>
 
-PR ada/80590
-
+	PR ada/80590
 	* exp_ch9.adb (Expand_N_Delay_Relative_Statement): Swap the two
 	conditions to avoid a unnecessary exception propagation in the default
 	case.
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index aa88b00..b8ee793 100644
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -6147,7 +6147,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
@@ -6157,7 +6158,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.  */



More information about the Gcc-cvs mailing list