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 12:50 PM, Eric Botcazou wrote:
While looking into fixing the PR, I discovered that we can set
DECL_NO_STATIC_CHAIN incorrectly.  When nested functions call other
nested functions, they may need to pass along the original static chain.
   This discovery is by nature iterative; we had been performing a single
pass over the nested function tree and setting DECL_NO_STATIC_CHAIN
based on that.

I think it boils down to what "incorrectly" means here. Starting with a conservatively correct set of DECL_NO_STATIC_CHAIN flags, the old algorithm will generate another conservatively correct set, not maximal of course.

"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.


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.

Write a testcase in GNU C if you don't like Ada. :-)

It's not that I don't like Ada, it's just that it seemed like we ought to have been generating incorrect code. So I don't know how the compiler was working.


Thanks, you presumably fixed PR tree-opt/30927.

So I did.



r~



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