public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/26219] longjmp dosn't work
       [not found] <bug-26219-4@http.gcc.gnu.org/bugzilla/>
@ 2012-01-13 22:22 ` pinskia at gcc dot gnu.org
  0 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-01-13 22:22 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-01-13 22:18:53 UTC ---
No feedback in almost 5 years so closing.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug target/26219] longjmp dosn't work
  2006-02-11  9:52 [Bug c/26219] New: " mugita at jsdkk dot com
  2006-02-11 13:33 ` [Bug target/26219] " rguenth at gcc dot gnu dot org
  2006-02-14  3:37 ` mugita at jsdkk dot com
@ 2006-02-14  3:51 ` pinskia at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-02-14  3:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pinskia at gcc dot gnu dot org  2006-02-14 03:51 -------
Can you try:
#include <setjmp.h>
jmp_buf jb_error;  
void jump(void){
        longjmp(jb_error,1);
}
void func1(void){
    return;
}
int main(void){
    if(setjmp(jb_error))
       return 0;
    func1();
    jump();
}

I am wondering if you are invoking undefined behavior in calling longjmp twice
on the same setjmp.


-- 


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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug target/26219] longjmp dosn't work
  2006-02-11  9:52 [Bug c/26219] New: " mugita at jsdkk dot com
  2006-02-11 13:33 ` [Bug target/26219] " rguenth at gcc dot gnu dot org
@ 2006-02-14  3:37 ` mugita at jsdkk dot com
  2006-02-14  3:51 ` pinskia at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: mugita at jsdkk dot com @ 2006-02-14  3:37 UTC (permalink / raw)
  To: gcc-bugs



------- 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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug target/26219] longjmp dosn't work
  2006-02-11  9:52 [Bug c/26219] New: " mugita at jsdkk dot com
@ 2006-02-11 13:33 ` rguenth at gcc dot gnu dot org
  2006-02-14  3:37 ` mugita at jsdkk dot com
  2006-02-14  3:51 ` pinskia at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2006-02-11 13:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from rguenth at gcc dot gnu dot org  2006-02-11 13:33 -------
You need to provide a more sensible test or a description of what "works" and
"does not work" for this testcase is supposed to be.


-- 


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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-01-13 22:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-26219-4@http.gcc.gnu.org/bugzilla/>
2012-01-13 22:22 ` [Bug target/26219] longjmp dosn't work pinskia at gcc dot gnu.org
2006-02-11  9:52 [Bug c/26219] New: " mugita at jsdkk dot com
2006-02-11 13:33 ` [Bug target/26219] " rguenth at gcc dot gnu dot org
2006-02-14  3:37 ` mugita at jsdkk dot com
2006-02-14  3:51 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).