This is the mail archive of the gcc@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: Expr Constructor Question Part 2


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


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