On Wed, Oct 05, 2016 at 04:40:50PM -0400, Fritz Reese wrote: > When union type symbols are compared and they contain maps containing > characters with different lengths, their type symbols should have > different backend declarations otherwise the gimple tree explodes. > Strangely enough the gimple checker only explodes with '-g' enabled > and certain other specific conditions, however the problem seems > clear. See the attached testcase for an example, and the attached > patch for a fix. > > RFC: My only concern is that this patch would technically also change > the way components are compared between derived types and class types, > not just union/map types. However from what I can tell if two derived > types are declared with character components of different lengths then > the two types should have distinct backend declarations anyway. If > anyone can think of any issues this patch might cause with derived > types/class types then I'd be okay guarding the new if statement to > only run for union/structure types. But with all my tests it doesn't > seem to result in any concrete differences. > > The patch does pass all regression tests on x86_64-redhat-linux. I > will give it a couple days for the RFC before committing. > > --- > Fritz Reese > > 2016-10-05 Fritz Reese <fritzore...@gmail.com> > > Fix ICE due to map typespecs with different sized charlens being > copied. > > * gcc/fortran/interface.c (compare_components): Check charlens. > > * gcc/testsuite/gfortran.dg/dec_union_11.f90: New testcase. >
Patch looks ok to me. -- Steve