Menu

#14 bad linline optimize

open
nobody
None
5
2003-08-26
2003-08-26
Anonymous
No

C:\work\lib\_bugs>h8300-hms-gcc.exe -v
Using built-in specs.
Configured with: ../gcc-3.3.1/configure --target=h8300-hms --host=i586-mingw32 --build=i686-pc-linux-gnu --enable-languages=c,c++ --with-newlib
Thread model: single
gcc version 3.3.1

source inline_bug.c:
extern __inline__ void DoDelay(long cnt)
{
do {
__asm__ (";":"=g"(cnt));
}while (--cnt);
};
int main()
{
DoDelay(1000);
return(0);
}

h8300-hms-gcc.exe -O1 -ms -Wall -S inline_bug.c

result inline_bug.s :
; GCC For the Hitachi H8/300
; By Hitachi America Ltd and Cygnus Support
; -O1

.h8300s
.file   "inline\_bug.c"
.section .text
.align 1
.global \_main

_main:
mov.l er6,@-er7
mov.l er7,er6
; #APP
;
; #NO_APP
subs #1,er2
.L2:;<<<<<<<<<<<<<<<<-------- eternal loop
mov.l er2,er2
bne .L2
sub.w r0,r0
mov.l @er7+,er6
rts
.end
.ident "GCC: (GNU) 3.3.1"

Discussion


Log in to post a comment.