AnsweredAssumed Answered

-O2 issue on powerpc-eabivle-gcc : Assembler : Illegal immediate value

Question asked by wan35fr on Aug 9, 2016
Latest reply on Aug 10, 2016 by stanish

Dear all ,

 

There is an issue if we use -O2 issue

 

uint8_t illegal_value_test(uint16_t arg0) {

    if (arg0 <= 0x7FF)

        return 1;

    else

        return 0;

}

 

The assembler generated is not correct (main.s)

illegal_value_test:

.LFB0:

  .file 1 "../src/main.c"

  .loc 1 10 0

  .cfi_startproc

.LVL0:

  .loc 1 16 0

  e_subfic %r3,%r3,2047

  e_li %r3,0

  adde %r3,%r3,%r3

 

src/main.s: Assembler messages:

src/main.s:16: Error: illegal immediate value

make: *** [src/main.o] Error 1

 

   Best Regards

 

                      Erwan

Outcomes