This is the mail archive of the gcc-bugs@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]

GCC-ARM optimization BUG report


Hello..

I'm developing In-House RTOS using GCC-ARM.
gcc_arm generates illegal conditional code sequence with -O option.
original C-code and it's assembly output are followed.

/* C-code */
if(stat_func_tcp)
	ptr += stat_func_tcp(ptr);

/* assembly output */
1 : ldrne r3, [r2, #0] /* take function address */
2 : movne r0, r4       /* r0 is a register arguement for pointer 'ptr' */
3 : movne lr, pc
4 : movne pc, r3       /* call stat_func_tcp() */
5 : addne r4, r4, r0

see line 5.
If CPSR is modified in function stat_func_tcp(),
'addne' refers to dirty CPSR, result in skipping add operation.

No problem without optimize option.

Is this a BUG?

HAPPY DAY!

WMWMWMWMW MWMWMWMWM WMWMWMWMW MWMWMWMWM WMWMWMWMW MWMWMWMWM
M  YoungChan Yoon                 Sollae Systems Co.,Ltd. W
W  email) treeman@eztcp.com               Inchon, Korea   M
M  U R L) http://www.eztcp.com/                           W
W  TEL.032-437-2346  FAX.032-437-2347  H.P.011-9045-8451  M
MWMWMWMWM WMWMWMWMW MWMWMWMWM WMWMWMWMW MWMWMWMWM WMWMWMWMW


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