This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: stick addressable constants into the constant pool
On Mon, 2 Aug 2004, Jason Merrill wrote:
> On Mon, 2 Aug 2004 11:26:26 -0700, Richard Henderson <rth@redhat.com> wrote:
>
> > On Mon, Aug 02, 2004 at 02:06:05PM -0400, Jason Merrill wrote:
> >> IIRC it uses fb_either because we can take the address of struct rvalues.
> >
> > How does that make sense? Perhaps the front end should be creating
> > a temporary, which then has its address taken?
>
> This happens in C++ with code like "f().g()", where f returns by value. I
> believe it also happens in C, but I don't remember how. I believe that
Functions returning a structure (or other non-lvalue structure
expressions: conditional expressions, comma expressions and assignments)
containing an array, which decays to a pointer in C99 which can be used
until the next sequence point. (In the case of flexible array members,
flexible array contents do not as I understand form part of the structure
rvalue: the code of bug 16566 should be accepted and not ICE but needn't
do anything useful.)
--
Joseph S. Myers http://www.srcf.ucam.org/~jsm28/gcc/
jsm@polyomino.org.uk (personal mail)
jsm28@gcc.gnu.org (Bugzilla assignments and CCs)