Fix ICE due to comparison between UNION components.
authorFritz Reese <fritzoreese@gmail.com>
Wed, 5 Oct 2016 20:24:48 +0000 (20:24 +0000)
committerFritz Reese <foreese@gcc.gnu.org>
Wed, 5 Oct 2016 20:24:48 +0000 (20:24 +0000)
commit908b82964e0985f2f97e5848ba10cda7e77ce8cb
treecfed710cce62e264fecedd6ec5bb21f948f6c83a
parent3bd034d0181e3f8ed26baac2e69c6b3bba2eb05c
Fix ICE due to comparison between UNION components.

2016-10-05  Fritz Reese  <fritzoreese@gmail.com>

Fix ICE due to comparison between UNION components.

gcc/fortran/
* interface.c (gfc_compare_types): Don't compare BT_UNION components
until we know they're both UNIONs.
* interface.c (gfc_compare_union_types): Guard against empty
components.

gcc/testsuite/gfortran.dg/
* dec_union_9.f90: New testcase.
* dec_union_10.f90: New testcase.

From-SVN: r240810
gcc/fortran/ChangeLog
gcc/fortran/interface.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/dec_union_10.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/dec_union_9.f90 [new file with mode: 0644]