This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Symtab cleanup 10/17 remove unnecesary DECL_ARGUMENTS and DECL_RESULT
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: Jan Hubicka <hubicka at ucw dot cz>
- Cc: Richard Biener <richard dot guenther at gmail dot com>, Mike Stump <mikestump at comcast dot net>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 2 Sep 2013 15:02:20 +0200
- Subject: Re: Symtab cleanup 10/17 remove unnecesary DECL_ARGUMENTS and DECL_RESULT
- Authentication-results: sourceware.org; auth=none
- References: <20130801150906 dot GB2236 at kam dot mff dot cuni dot cz> <441E5C9A-174E-4810-9F9C-F264E56170DF at comcast dot net> <20130822064756 dot GE16124 at kam dot mff dot cuni dot cz> <075DA2A7-0BFC-4455-B2DB-A50414DD95BD at comcast dot net> <20130902105208 dot GB5201 at kam dot mff dot cuni dot cz> <CAFiYyc2o+jca4zhWY+kfRr2w9kuoh_9ZJ2Jh17xJwCMiGt14cA at mail dot gmail dot com> <20130902114301 dot GA21016 at kam dot mff dot cuni dot cz> <CAFiYyc0GYMei0ibfaF+T8vAiK2t4VjCLwbMaAy7_HScAmMJ3ew at mail dot gmail dot com> <20130902125851 dot GC5201 at kam dot mff dot cuni dot cz>
> >
> > Well, there is still fallout from this change so I'm not convinced
> > this will stay
> > this way. Also we stream the function-decl that refers to these fields in
>
> As far as I know there are two problems
> 1) problem with the thunk expansion not getting DECL_ARGUMENTS/DECL_RESULT
> addressed by this patch
> 2) ICE in gcc.dg/torture/pr8081.c
> Here the problem is in variable type of return value that gets streamed
> twice and we end up with duplicate.
>
> As mentioned earlier, I want to handle this by introducing
> variable_sized_function_type_p that will make those go specially the
> old way (with DECL_ARGUMENTS/DECL_RESULT in the global stream).
>
> I did not send the patch, because I think the variable sized parameters
> were handled incorrectly before my changes, too, and the fix is not
> so trivial. It just makes us
> not ICE the same way as before. The testcase is:
> /* { dg-do run } */
>
> extern void abort (void);
> int
> main (int argc, char **argv)
> {
> int size = 10;
> typedef struct
> {
> char val[size];
> }
> block;
> block a, b;
> block __attribute__((noinline))
> retframe_block ()
> {
> return *(block *) &b;
> }
> b.val[0] = 1;
> b.val[9] = 2;
> a=retframe_block ();
> if (a.val[0] != 1
> || a.val[9] != 2)
> abort ();
> return 0;
> }
> So here the size is not parameter of the function, it is a local vairable
> (later turned into structure) that gets into local function stream.
^^^ reading my email, perhaps in this case the correct fix is to make
tree-nested to fix-up the TYPE_SIZE? It knows how to access the
frame variables from outer function via the invisible link pointer
passed and it knows how to update gimple. That may also fix the issue
with debug info.