PowerPC : GCC2 optimises better than GCC4???

2010-01-04 Thread Mark Colby
This sounds like a dumb question I know. However the following code snippet results in many more machine instructions under 4.4.2 than under 2.9.5 (I am running a cygwin->PowerPC cross): typedef unsigned int U32; typedef union { U32 R; struct { U32 BF1:2; U32 :8;

RE: PowerPC : GCC2 optimises better than GCC4???

2010-01-04 Thread Mark Colby
> >> Is there any way to improve this behaviour? I have been using 2.9.5 > very > >> successfully for years and am now looking at 4.4.2, but have many > such > >> examples in my code (for clarity of commenting and maintainability). > > > > This is very strange.  On x86_64, gcc 4.4.1 generates > > >

RE: PowerPC : GCC2 optimises better than GCC4???

2010-01-04 Thread Mark Colby
> On Mon, Jan 04, 2010 at 12:18:50PM +0100, Steven Bosscher wrote: > > > This optimization is done by the first RTL cse pass.  I can't > understand > > > why it's not being done for your target.  I guess this will need a > > > powerpc expert. > > > > Known bug, see http://gcc.gnu.org/PR22141 > > T

RE: PowerPC : GCC2 optimises better than GCC4???

2010-01-06 Thread Mark Colby
>>> Yabbut, how come RTL cse can handle it in x86_64, but PPC not? >> >> Probably because the RTL on x86_64 uses and's and ior's, but PPC uses >> set's of zero_extract's (insvsi). > > Aha! Yes, that'll probably be it. It should be easy to fix cse to > recognize those too. > > Andrew I'm not fam

RE: PowerPC : GCC2 optimises better than GCC4???

2010-01-06 Thread Mark Colby
>>> Aha! Yes, that'll probably be it. It should be easy to fix cse to >>> recognize those too. >> I'm not familiar with the gcc source yet, but just in case I get the >> time to look at this, could anyone give me a file/line ref to dive >> into and examine? > Would you believe cse.c? :-) Ha!