PR40011 -fwhole-file problems

Richard Guenther richard.guenther@gmail.com
Thu Jun 4 10:56:00 GMT 2009


On Thu, Jun 4, 2009 at 11:50 AM, Richard Guenther
<richard.guenther@gmail.com> wrote:
> On Thu, Jun 4, 2009 at 11:03 AM, Paul Richard Thomas
> <paul.richard.thomas@gmail.com> wrote:
>> Dear Richard,
>>
>> Thank you for your response to this - I am very pleased that you
>> continue to take an interest in gfortran.
>>
>>> The inliner is perfectly capable of inlining functions with static
>>> variables.  Likely GFortran messes up the flags for the static
>>> vars so they get copied during inlining (which is what you see above,
>>> use -uid on the dump flag to see the DECL uids).
>>
>> How does one deal with this?  By putting TREE_STATIC variables in
>> global scope?  I could not immediately discern from tree.def or tree.h
>> the sense in which gfortran messes up the flags.
>
> I don't know.  Can you point me to a testcase where I can reproduce
> the issue?  Basically the middle-end calls auto_var_in_fn_p to
> see if a declaration is "auto" or "static".  Are your specific cases
> maybe CONST_DECLs?

I have reproduced it and it is PR38913.  The frontend fails to
unify struct myint properly so alias information is hosed - it has
nothing to do with statics.

Richard.



More information about the Fortran mailing list