Created attachment 21886 [details] test case Hello, This was working until a few days ago, now it's broken: the compiler gives a bogus error message, and then ICEs. Trunk at r164617: ======================================================== [sfilippo@localhost bug24]$ gfortran -v Using built-in specs. COLLECT_GCC=gfortran COLLECT_LTO_WRAPPER=/usr/local/gnu46/libexec/gcc/x86_64-unknown-linux-gnu/4.6.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: ../gcc/configure --prefix=/usr/local/gnu46 --enable-languages=c,c++,fortran : (reconfigured) ../gcc/configure --prefix=/usr/local/gnu46 --enable-languages=c,c++,fortran : (reconfigured) ../gcc/configure --prefix=/usr/local/gnu46 --enable-languages=c,c++,fortran : (reconfigured) ../gcc/configure --prefix=/usr/local/gnu46 --enable-languages=c,c++,fortran : (reconfigured) ../gcc/configure --prefix=/usr/local/gnu46 --enable-languages=c,c++,fortran,lto --no-create --no-recursion : (reconfigured) ../gcc/configure --prefix=/usr/local/gnu46 --enable-languages=c,c++,fortran,lto --no-create --no-recursion : (reconfigured) ../gcc/configure --prefix=/usr/local/gnu46 --enable-languages=c,c++,fortran,lto --no-create --no-recursion : (reconfigured) ../gcc/configure --prefix=/usr/local/gnu46 --enable-languages=c,c++,fortran,lto --no-create --no-recursion Thread model: posix gcc version 4.6.0 20100925 (experimental) (GCC) [sfilippo@localhost bug24]$ gfortran -c bug24.f03 bug24.f03:68.10: call b%cp_to_foo(tmp,info) 1 Error: Type mismatch in argument 'a' at (1); passed CLASS(base) to CLASS(s_base) bug24.f03:11:0: internal compiler error: in gfc_add_component_ref, at fortran/class.c:77 Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions.
Created attachment 21887 [details] test case
It is very likely a duplicate of pr45783.
(In reply to comment #2) > It is very likely a duplicate of pr45783. The code compiles at r164549
(In reply to comment #3) > (In reply to comment #2) > > It is very likely a duplicate of pr45783. > > The code compiles at r164549 and fails at r164550....
Confirmed. I do not yet see how this is related to my commit, but will look into it of course. Thanks for the report!
(In reply to comment #5) > Confirmed. I do not yet see how this is related to my commit, but will look > into it of course. Thanks for the report! Well, considering how many times I have been burned by things that "should not have anything to do with", it was relatively easy to home in onto the only change in recent days that had touched SELECT TYPE :-) As I read somewhere "Interesting problems prove their worth by biting back" Salvatore
Author: domob Date: Sun Sep 26 19:25:52 2010 New Revision: 164638 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=164638 Log: 2010-09-26 Daniel Kraft <d@domob.eu> PR fortran/45783 PR fortran/45795 * resolve.c (resolve_select_type): Clarify code. (resolve_assoc_var): Only set typespec if it is currently unknown. 2010-09-26 Daniel Kraft <d@domob.eu> PR fortran/45783 PR fortran/45795 * gfortran.dg/select_type_18.f03: New test. Added: trunk/gcc/testsuite/gfortran.dg/select_type_18.f03 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/resolve.c trunk/gcc/testsuite/ChangeLog
Fixed.