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]
Other format: [Raw text]

[Bug target/26219] longjmp dosn't work



------- Comment #2 from mugita at jsdkk dot com  2006-02-14 03:37 -------
h8300-elf-gcc(3.4.3) makes this object.
        0x1a0   <main>:         6d f6             mov.w r6,@-e7
-       0x1a2   <main+2>:               0d 76             mov.w r7,r6
        0x1a4   <main+4>:               79 00 1d 4a       mov.w #0x1d4a,r0
-       0x1a8   <main+8>:               5e 00 01 f0       jsr   @0x1f0:0 ;
setjmp(jb_error)
-       0x1ac   <main+12>:              5e 00 01 98       jsr   @0x198:0 ;
func1()
-       0x1b0   <main+16>:              5e 00 01 88       jsr   @0x188:0 ;
jump()
-       0x1b4   <main+20>:              0d 20             mov.w r2,r0
-       0x1b6   <main+22>:              6d 76             mov.w @r7+,r6
-       0x1b8   <main+24>:              54 70             rts   

It works fine.  run-> setjmp()->func1()->jump()->setjmp() ..

h8300-elf-gcc(4.1.0) makes this object
        0x1a8   <main>:         6d f6             mov.w r6,@-e7
-       0x1aa   <main+2>:               0d 76             mov.w r7,r6
-       0x1ac   <main+4>:               79 02 1d 1a       mov.w #0x1d1a,r2
-       0x1b0   <main+8>:               6d f2             mov.w r2,@-e7
-       0x1b2   <main+10>:              5e 00 01 f8       jsr   @0x1f8:0
-       0x1b6   <main+14>:              0b 87             adds  #0x2,er7
-       0x1b8   <main+16>:              5e 00 01 a0       jsr   @0x1a0:0
-       0x1bc   <main+20>:              5e 00 01 8c       jsr   @0x18c:0
-       0x1c0   <main+24>:              6d 76             mov.w @r7+,r6
-       0x1c2   <main+26>:              54 70             rts   

It doesn't run correctly. run-> setjmp()->func1()->jump()-> freeze(Infinite
loop in jump())

In more complex program, freeze when run into longjmp().


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26219


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