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

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

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

1,292件の閲覧回数
wan35fr
Contributor III

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

ラベル(2)
タグ(3)
0 件の賞賛
返信
1 返信

947件の閲覧回数
stanish
NXP Employee
NXP Employee

Hello Erwan,

Thanks for this report. This is a known issue:

[ENGR00379772] Compiler may generate the instruction e subfic with invalid immediate value when an optimization is enabled.

The only workaround is to disable optimizations.

Anyway, the fix will be released in the next coming build tools update.

I'll check with the product team the exact update release date.

Regards,

Stan

0 件の賞賛
返信