http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50640

--- Comment #26 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-09-11 
13:44:44 UTC ---
The solution of comment 3, fixed by comment 24 seems to break the test case of
PR fortran/53718.

Reverting the patch (comment 24, except for unrelated class.c part) fixes the
issue of PR 53718. For some reason, reverting the patch no longer triggers the
issue of this PR, i.e. gfortran.dg/select_type_12.f03 gives no ICE.

Hence, it seems as if comment 2 no longer applies.


To recap (rough version): gfortran generates in MAIN__ the nested function
__copy_MAIN___T1 and assigns it (function pointer) to a field of the static
struct __vtab_MAIN___T1. But __copy_MAIN___T1 does not get called in MAIN__ but
only in "foo" which is also a nested function of MAIN__ - thus,
__vtab_MAIN___T1 didn't get marked as referenced, causing the ICE.

The patch in comment 24 hoisted the "__copy_MAIN___T1" out of MAIN__ into the
TU space.


Does anyone see a reason why the patch shouldn't be revered? (I assume one of
Richard's patches in May fixed the issue. That probably means that one has to
find another solution for 4.7. Suggestions?)

Comments - especially from the middle-end side?

Reply via email to