aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorFritz Reese <fritzoreese@gmail.com>2016-09-30 11:37:23 +0000
committerFritz Reese <foreese@gcc.gnu.org>2016-09-30 11:37:23 +0000
commit00074dd8e31adf8bd445e4af7ed27dda77985ab4 (patch)
tree3521e5546753b47fbef1a3f3a00dd267561893de /gcc/fortran
parent26f391e8067e96e4fba7b531eda9fb80023f2fd2 (diff)
downloadgcc-00074dd8e31adf8bd445e4af7ed27dda77985ab4.zip
gcc-00074dd8e31adf8bd445e4af7ed27dda77985ab4.tar.gz
gcc-00074dd8e31adf8bd445e4af7ed27dda77985ab4.tar.bz2
Fix ICE caused by union types comparing equal to structures.
2016-09-30 Fritz Reese <fritzoreese@gmail.com> Fix ICE caused by union types comparing equal to structures. PR fortran/77782 * gcc/fortran/interface.c (gfc_compare_derived_types): Use gfc_compare_union_types to compare union types. PR fortran/77782 * gcc/testsuite/gfortran.dg/dec_structure_16.f90: New testcase. From-SVN: r240651
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog6
-rw-r--r--gcc/fortran/interface.c4
2 files changed, 10 insertions, 0 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index ea28ae5..03955d6 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,9 @@
+2016-09-30 Fritz Reese <fritzoreese@gmail.com>
+
+ PR fortran/77782
+ * interface.c (gfc_compare_derived_types): Use gfc_compare_union_types
+ to compare union types.
+
2016-09-30 Andre Vehreschild <vehre@gcc.gnu.org>
* trans-array.c (gfc_array_allocate): Use the token from coarray's
diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c
index 5883e39..3f6774e 100644
--- a/gcc/fortran/interface.c
+++ b/gcc/fortran/interface.c
@@ -589,6 +589,10 @@ gfc_compare_derived_types (gfc_symbol *derived1, gfc_symbol *derived2)
gcc_assert (derived1 && derived2);
+ /* Compare UNION types specially. */
+ if (derived1->attr.flavor == FL_UNION || derived2->attr.flavor == FL_UNION)
+ return gfc_compare_union_types (derived1, derived2);
+
/* Special case for comparing derived types across namespaces. If the
true names and module names are the same and the module name is
nonnull, then they are equal. */