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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

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

1,328 次查看
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 回复

983 次查看
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 项奖励
回复