This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: gcc 2.95.2 PPC code generation bug(New version!)
- To: Geoff Keating <geoffk at cygnus dot com>
- Subject: Re: gcc 2.95.2 PPC code generation bug(New version!)
- From: Franz Sirl <Franz dot Sirl-kernel at lauterbach dot com>
- Date: Tue, 02 May 2000 10:48:11 +0200
- Cc: Ralph Schmidt <laire at basis dot owl dot de>,gcc-bugs at gcc dot gnu dot org
- References: <root's message of "Mon, 1 May 2000 21:12:59 +0200"><200004281636.AA00728@basis.owl.de><00050121125900.22077@enzo.bigblue.local>
At 00:02 02.05.00, Geoff Keating wrote:
>root <root@enzo.bigblue.local> writes:
>
> > int result = ({
> > struct test mytest;
> > ({
> > int testi;
> > testi = func (&mytest);
> > testi;
> > })
> > });
>
> > You expect TESTI to be assigned to RESULT, but I think this is not
> > covered by the definition of statement expressions in the GCC manual
> > (at least not to my understanding). I believe you have to rewrite
> > your macros to produce code like that:
>
>I believe this should work. The manual says
>
> The last thing in the compound statement should be an expression
> followed by a semicolon; the value of this subexpression serves as the
> value of the entire construct.
>
>Of course, there is a missing semicolon in the above; it should read
>
>int result = ({
> struct test mytest;
> ({
> int testi;
> testi = func (&mytest);
> testi;
> });
>});
>
>but that should work. In fact, it does for me.
Yes, that looks OK, but in fact I did quote Ralph incorrectly, he wrote:
int result = ({
struct test mytest;
{
int testi;
testi = func (&mytest);
testi;
}
});
which compiles, but is no valid statement expression...
Franz.