This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/21160] how to force a variable into the stack?
- From: "bruno at clisp dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Apr 2005 14:14:54 -0000
- Subject: [Bug c/21160] how to force a variable into the stack?
- References: <20050422110331.21160.bruno@clisp.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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