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: Zack Weinberg <zack at codesourcery dot com>
- To: mike stump <mrs at windriver dot com>
- Cc: gdr at codesourcery dot com, gcc at gcc dot gnu dot org, mark at codesourcery dot com,neil at daikokuya dot demon dot co dot uk
- Date: Sat, 24 Nov 2001 23:05:30 -0800
- Subject: Re: ICE in change_address at emit_rtl.c
- References: <200111250513.VAA01411@kankakee.wrs.com>
On Sat, Nov 24, 2001 at 09:13:11PM -0800, mike stump wrote:
> > Date: Sat, 24 Nov 2001 16:41:55 -0800
> > From: Zack Weinberg <zack@codesourcery.com>
> > To: Gabriel Dos Reis <gdr@codesourcery.com>
>
> > 2. As few spurious errors reported to the user as possible. This is
> > one place where ERROR_MARK_NODE really falls down. Consider these
> > ill-formed declarations:
>
> > double int number;
> > typedef struct foo foo_t[;
>
> > These will both provoke error cascades in the current compiler,
>
> ?
>
> double int number;
>
> int maif() {
> number = 1;
> number1 = 1;
> }
>
> seems to do the right thing?
Blah, my examples are too simple.
extern void fprint(int, const char *);
void print(str)
string str;
{
fprint(1, str);
}
$ gcc -Wall test.c
test.c:5: parse error before `string'
test.c:5: warning: type defaults to `int' in declaration of `str'
test.c:5: warning: data definition has no type or storage class
We should be able to figure out that "string" is expected to be a type
name, and that if it _were_ then there would be no problem with the
parameter declaration, and issue only an error such as
test.c:5: "string" is not a type name
I'm surprised to see it not complain about the fprint() line; I was
expecting a warning about an invalid conversion to pointer type.
It certainly should _not_ give that warning, since it does not know
whether "string" is a pointer type.
Or,
int main(argc, argv)
int argc;
string argv[];
{
int i;
for(i=1; i<argc; i++)
puts(argv[i]);
return 0;
}
$ gcc -S test.c
test.c: In function `main':
test.c:3: parse error before `string'
test.c:7: subscripted value is neither array nor pointer
Here, we have no clue what the type of an element of argv is, but we
ought to be able to call it "array of <unknown type>" instead of just
"<unknown type>".
zw