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: Ralph Schmidt <laire at basis dot owl dot de>, gcc-bugs at gcc dot gnu dot org
- Subject: Re: gcc 2.95.2 PPC code generation bug(New version!)
- From: Geoff Keating <geoffk at cygnus dot com>
- Date: 01 May 2000 15:02:20 -0700
- References: <200004281636.AA00728@basis.owl.de> <00050121125900.22077@enzo.bigblue.local>
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>