This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [pr 41246] Fix incorrect values of DECL_NO_STATIC_CHAIN
> "Incorrectly" meaning a static-chain value passed to a function with
> DECL_NO_STATIC_CHAIN set. "Incorrectly" meaning no static chain passed
> to a function when it ought to have gotten one.
Passing a static chain to a function that doesn't need one is conservatively
correct. Are you implicitly referring to i386 where regparm can be altered
depending on the value of DECL_NO_STATIC_CHAIN? If so, I guess the static
chain register is loaded before the other register parameters so passing a
static chain to a function with DECL_NO_STATIC_CHAIN works too.
> I don't see how you say the old algorithm produced a "conservatively
> correct" set of values at all, except that *somehow* the Ada compiler
> was functioning.
The old algorithm will never set DECL_NO_STATIC_CHAIN on a function that needs
a static chain if given a nest of functions that already has this property so
the second part of your definition of "incorrectly" is never met.
--
Eric Botcazou