This is the mail archive of the gcc-bugs@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]

Re: gcc 2.95.2 PPC code generation bug(New version!)


At 15:35 02.05.00, Ralph Schmidt wrote:

>You wrote: > At 12:11 02.05.00, Ralph Schmidt wrote: >  > >You wrote: >  > 
>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...if it's no valid 
>statement expression explain me why it works  > >99.999% of the time for 
>ppc and 100% for 68k. > > >  > Optimization? Stack layout? Luck? There are 
>a number of reasons this could  > happen if you are relying on undefined 
>behaviour. >
>
>I tested it right now on the small test case and on x mui classes and you 
>were right.......not that i really understand the effect though. If the 
>result of this inline would be undefined it wouldn't only fail with this 
>special case, so i think it's better to understand the cause exactly 
>instead of skipping it because a workaround is found.
>

Well, read the GCC documentation on statement expressions and you'll see 
that the previous macro did not fulfill the rules. Your macros heavily use 
statement expressions, so I think it's a good idea that you understand the 
rules of this GCC extension to C.

Franz.


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