This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Expr Constructor Question Part 2
- From: Jim Wilson <wilson at specifixinc dot com>
- To: Weihaw Chuang <weihawchuang at hotmail dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 16 Mar 2004 01:01:30 -0800
- Subject: Re: Expr Constructor Question Part 2
- References: <BAY2-F81T6Ssuot0OUI0001f17e@hotmail.com>
Weihaw Chuang wrote:
I would like to force a struct to a temporary on stack.
In a user program, or internally to gcc? You weren't clear about this.
Internally to gcc, you probably want to call
lang_hooks.mark_addressable, which sets TREE_ADDRESSABLE, which should
force it to the stack.
In a user program, taking the address of a variable used to force it to
the stack, but the optimizers have gotten smarter, so this might not be
safe anymore. You might have to declare it volatile, and take its address.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com