Bug 45795 - [OOP] ICE in in gfc_add_component_ref plus bogus error message
Summary: [OOP] ICE in in gfc_add_component_ref plus bogus error message
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.6.0
: P3 normal
Target Milestone: 4.6.0
Assignee: Daniel Kraft
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-25 20:14 UTC by Salvatore Filippone
Modified: 2016-11-16 17:44 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2010-09-26 08:04:08


Attachments
test case (487 bytes, application/octet-stream)
2010-09-25 20:14 UTC, Salvatore Filippone
Details
test case (487 bytes, text/plain)
2010-09-25 20:45 UTC, Salvatore Filippone
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Salvatore Filippone 2010-09-25 20:14:58 UTC
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.
Comment 1 Salvatore Filippone 2010-09-25 20:45:31 UTC
Created attachment 21887 [details]
test case
Comment 2 Dominique d'Humieres 2010-09-25 21:21:19 UTC
It is very likely a duplicate of pr45783.
Comment 3 Salvatore Filippone 2010-09-26 07:33:13 UTC
(In reply to comment #2)
> It is very likely a duplicate of pr45783.

The code compiles at r164549
Comment 4 Salvatore Filippone 2010-09-26 07:43:51 UTC
(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....
Comment 5 Daniel Kraft 2010-09-26 08:04:08 UTC
Confirmed.  I do not yet see how this is related to my commit, but will look into it of course.  Thanks for the report!
Comment 6 Salvatore Filippone 2010-09-26 10:27:41 UTC
(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
Comment 7 Daniel Kraft 2010-09-26 19:25:55 UTC
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
Comment 8 Daniel Kraft 2010-09-26 19:32:37 UTC
Fixed.