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

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


------- Additional Comments From bruno at clisp dot org  2005-04-22 14:14 -------
I don't understand your resolution. 
 
How can I guarantee that gcc will not put 'ptr' and 'array' into registers where, on SPARC, 
longjmp() will clobber them? 
 
The semantics of 'volatile' are quite different than 'non register'. It has negative effect on 
performance. 
 
GCC should add a 'nonregister' qualifier or attribute that would allow to force variables into 
the stack without making their access slower than other stack allocated variables. 
 
The GCC 4.0 documentation says "These warnings occur only for variables that are 
candidates for register allocation.  Therefore, they do not occur for a variable that is 
declared `volatile', or whose address is taken, or whose size is other than 1, 2, 4 or 8 bytes." 
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. 
 

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


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21160


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