This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [pr 41246] Fix incorrect values of DECL_NO_STATIC_CHAIN


On 09/16/2009 03:52 PM, Eric Botcazou wrote:
"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.

That must be what happened.


In the code that I hope to be posting later today, there's a target hook that gets called to determine the location of the static chain for a given function target. That hook returns NULL if DECL_NO_STATIC_CHAIN is set, which is how I stumbled onto the problem.


r~



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]