This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: ICE in change_address at emit_rtl.c
- From: Neil Booth <neil at daikokuya dot demon dot co dot uk>
- To: mike stump <mrs at windriver dot com>
- Cc: gcc at gcc dot gnu dot org, gdr at codesourcery dot com, pfeifer at dbai dot tuwien dot ac dot at,rodrigc at mediaone dot net, zack at codesourcery dot com
- Date: Sun, 25 Nov 2001 12:02:48 +0000
- Subject: Re: ICE in change_address at emit_rtl.c
- References: <200111250416.UAA01336@kankakee.wrs.com>
mike stump wrote:-
> You can tell if they do, even if you don't have source code, by
> compiling something like:
>
> struct A {
> char int j;
> } a;
>
> const int * ip;
>
> main() {
> *ip = 1;
> a = a;
> a.i = 1;
> a.j = a.j;
> }
>
> and get messages like:
>
> terr.c:2: two or more data types in declaration of `j'
> terr.c: In function `main':
> terr.c:8: warning: assignment of read-only location
> terr.c:10: structure has no member named `i'
>
> If you fail to get at least all of these, or if you get extra ones,
> then the compiler is inferior and doesn't have anything like
> error_mark_node (in this context). If you get roughly exactly these
> messages, then the compiler must.
Why? How do you know that the compiler doesn't just have (in
pseudo-code)
void grokdeclarator (decl)
{
[...]
if (multiple_type_declspecs_given)
{
output_error_msg;
assume_the_latter_type;
}
[...]
}
and so enters it in its symbol table as if it saw
struct A {
int j;
} a;
I think this would produce the same error messages you describe, and I
see no need for an error_mark thingy. This is just what I'm saying we
should do - have some kind of intelligent recovery to something sane
that fits what the user might have wanted as closely as we can guess,
and proceed as normal.
Neil.