This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR c/7622
- From: Eric Botcazou <ebotcazou at libertysurf dot fr>
- To: Philippe Trebuchet <Philippe dot Trebuchet at sophia dot inria dot fr>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 4 Dec 2002 15:34:57 +0100
- Subject: Re: [PATCH] Fix PR c/7622
- References: <md5:08339ACA394ECEF8E03F09664946F2A7> <3DED509F.E2774FD5@sophia.inria.fr>
> I think there might be a problem with your patch, I mean the following
> code should issue an error
>
> void foo()
> {
> auto void bar();
> bar();
> }
>
> while it does not with this patch, am I wrong?
It certainly should issue an error, but not segfault as it currently does:
test.c: In function `bar':
test.c:25: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
The faulty definition of the nested bar() should be flagged earlier during
parsing I think (see c-decl.c:finish_decl).
In any cases, output_inline_function requires DECL_SAVED_INSNS (fn) to be non
zero, so it makes sense to check that before calling it.
> (my proposed patch for alias PR c/7490 was dealing with this issue also)
I've now read it. It seems that we agree that output_inline_function must be
guarded by the check on DECL_SAVED_INSNS (fn).
However I'm not convinced that PR c/7490 has something to do with nested
functions: it seems that the submitter wanted to call a function with another
name than the original one, by using the "alias" attribute. But, as Richard
pointed out, the "alias" attribute is a definition, not a declaration. So we
should again flag the error earlier.
--
Eric Botcazou