This is the mail archive of the gcc-help@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]
Other format: [Raw text]

Re: optimization, powerpc style


Hi,

Please ignore the first half of the original post. I used the size
command to make a snap judgment on the code without looking very hard
at the assembly I posted. After actually looking at the code I
realized that I created the .o files from the wrong .s files. In this
case the 4.3.5 compiler DOES do a better job.

I still think the questions about the mesh compiles are valid if
anyone has any thoughts.

Thanks (and sorry)!

kevin

On Fri, Feb 11, 2011 at 11:15 AM, kevin diggs <diggskevin38@gmail.com> wrote:
> Hi,
>
> While trying to figure out why the PowerMac mesh scsi driver will work
> when compiled with 4.1.2 but not with 4.3.5 I noticed some strange
> behavior with literal strings.
>
> #include <stdio.h>
>
> const char *getMsg(unsigned int u)
> {
>        const char *p;
>
>        switch(u)
>        {
>                case 0:
>                        p="This is message 0"; break;
>                case 1:
>                        p="This is message 1"; break;
>                case 2:
>                        p="This is message 2"; break;
>                case 3:
>                        p="This is message 3"; break;
>                case 4:
>                        p="This is message 4"; break;
>                case 5:
>                        p="This is message 5"; break;
>                default:
>                        p=NULL;
>        }
>
>        return p;
> }
>
> This function when compiled with 3.4.6 produces pretty good code.
> 4.3.5 produces lesser good code. Can someone suggest what I search the
> bug database for to see if this has been reported and what the status
> is? Is it PowerPC specific?
>


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