This is the mail archive of the 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]

[Bug c/21160] how to force a variable into the stack?

------- Additional Comments From pinskia at gcc dot gnu dot org  2005-04-22 14:24 -------
(In reply to comment #3)
> I have taken the address of 'ptr' and despite that, it was not excluded from the candidates 
> for register allocation - or the warning occurred despite of the variable being stack allocated. 
> In either case, it's a GCC bug. 

No you have not taken the address, as it will not escape or otherwise.  volatile in a local function is the 
same as almost as a non register. 
Another way to "fix" this would be do the following:
and mark escape_function as no inline, but this might not work in the furture as we might know that 
escape_function does not escape that address, the way to work around that would be make a static file 
scope variable which gets assigned that pointer but even that might cause the escapeness in the future 
so the only correct way is mark the variable as volatile.

           What    |Removed                     |Added
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID

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