gcc 2.95.2 PPC code generation bug(New version!)

Geoff Keating geoffk@cygnus.com
Mon May 1 14:56:00 GMT 2000


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.

-- 
- Geoffrey Keating <geoffk@cygnus.com>


More information about the Gcc-bugs mailing list