m32r-elf, optimization problem

tanaka tanaka@personal-media.co.jp
Fri Feb 21 09:44:00 GMT 2003

Hello all,

I use gcc which was configured for Mitsubishi m32r.
I found that gcc generate wrong code, which compiled with -O2.
Without Optimization, gcc generates code, correctly.

------ system ------
- gcc configuration -
Configured with: ../gcc-3.2.2/configure --target=m32r-unknown-elf
    --with-gnu-as --with-gnu-ld --enable-languages=c
Thread model: single
gcc version 3.2.2
Sample source code.
---- m32r_bug.c ----
static int f( int a )
        int b;
        b = 0;
        if (a != 0) b = 1;
        return b;
./xgcc -B./ -O2 -S m32r_bug.c -o m32r_bug.s
Output code.
---- m32r_bug.s ----
    .section .text
    .balign 4
    .type   f,@function
    ; PROLOGUE, vars= 0, regs= 0, args= 0, extra= 0
    addi r0,#0
    jmp lr
    .size   f,.Lfe1-f
    .ident  "GCC: (GNU) 3.2.2"
Is there a patch for this problem?
There is Another problem.
When gcc compiles a large size c source code,
gcc acts something wrong.
But, I have not sample now.

thanks for any help

Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com

More information about the crossgcc mailing list