RE: ARM compiler rewriting code to be longer and slower

2009-03-16 Thread Ramana Radhakrishnan
[Resent because of account funnies. Apologies to those who get this twice] Hi, This problem is reported every once in a while, all targets with small load-immediate instructions suffer from this, especially since GCC 4.0 (i.e. since tree-ssa). But it seems there is just not enough

RE: ARM compiler rewriting code to be longer and slower

2009-03-16 Thread Adam Nemet
Ramana Radhakrishnan writes: [Resent because of account funnies. Apologies to those who get this twice] Hi, This problem is reported every once in a while, all targets with small load-immediate instructions suffer from this, especially since GCC 4.0 (i.e. since tree-ssa). But

Re: ARM compiler rewriting code to be longer and slower

2009-03-16 Thread Steven Bosscher
On Mon, Mar 16, 2009 at 2:52 PM, Ramana Radhakrishnan ramana.radhakrish...@arm.com wrote: Wouldn't doing this in CSE only solve the problem within an extended basic block and not necessarily across the program ? Surely you'd want to do it globally or am I missing something very basic here ?

Re: ARM compiler rewriting code to be longer and slower

2009-03-16 Thread Daniel Berlin
On Mon, Mar 16, 2009 at 12:11 PM, Adam Nemet ane...@caviumnetworks.com wrote: Ramana Radhakrishnan writes: [Resent because of account funnies. Apologies to those who get this twice] Hi, This problem is reported every once in a while, all targets with small load-immediate instructions

Re: ARM compiler rewriting code to be longer and slower

2009-03-15 Thread Ramana Radhakrishnan
Hi Zoltan, some parts snipped On Fri, Mar 13, 2009 at 9:16 AM, zol...@bendor.com.au wrote: Note that it is sub-optimal on two counts. First, each loading of a constant takes 3 instructions and 3 clocks. Storing the constant and fetching it using an ldr also takes 3 clocks but only two

Re: ARM compiler rewriting code to be longer and slower

2009-03-15 Thread Steven Bosscher
On Sun, Mar 15, 2009 at 11:19 PM, Ramana Radhakrishnan raman...@gmail.com wrote: I'm not sure about the best way to fix this but I've filed this for the moment as http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39468 This problem is reported every once in a while, all targets with small

Re: ARM compiler rewriting code to be longer and slower

2009-03-15 Thread Adam Nemet
Steven Bosscher stevenb@gmail.com writes: On Sun, Mar 15, 2009 at 11:19 PM, Ramana Radhakrishnan raman...@gmail.com wrote: I'm not sure about the best way to fix this but I've filed this for the moment as http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39468 This problem is reported every

ARM compiler rewriting code to be longer and slower

2009-03-12 Thread zoltan
Using 4.4.0 gcc, I compiled a function and found it a tad long. The command line is: gcc -Os -mcpu=arm7tdmi-s -S func.c although the output is pretty much the same with -O2 or -O3 as well (only a few instructions longer). The function is basically an unrolled 32 bit unsigned division by 1E9:

Re: ARM compiler rewriting code to be longer and slower

2009-03-12 Thread Ian Lance Taylor
zol...@bendor.com.au writes: Is it a problem that is worth being put onto bugzilla or I just have to do some trickery to save the compiler from being smarter than it is? I think this is worth being put into bugzilla. Ian