public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: hjl@lucon.org (H.J. Lu)
To: rth@cygnus.com
Cc: egcs@cygnus.com
Subject: glibc 2.0.5 is miscompiled by egcs 970904
Date: Sun, 07 Sep 1997 10:54:00 -0000	[thread overview]
Message-ID: <m0x7lXq-0004ecC@ocean.lucon.org> (raw)

Hi,

There is the preprocessed sysdeps/alpha/__longjmp.c in glibc 2.0.5.
egcs 970904 for linux/alpha miscompiled it with -O2. -O is fine.
gcc 2.7.2.1 has no problems with -O2. I know nothing about the alpha
asm. With the incorrect __longjmp.o, setjmp/tst-setjmp gave:

Saved environment.
Shouldn't have Jumped to 19.
Test FAILED!

I think the wrong information is saved.

Thanks.


-- 
H.J. Lu (hjl@gnu.ai.mit.edu)
---
register long int
  r9 asm ("$9"), r10 asm ("$10"), r11 asm ("$11"), r12 asm ("$12"),
  r13 asm ("$13"), r14 asm ("$14");
register long int *fp asm ("$15"), *sp asm ("$30"), *retpc asm ("$26");
register double
  f2 asm ("$f2"), f3 asm ("$f3"), f4 asm ("$f4"), f5 asm ("$f5"),
  f6 asm ("$f6"), f7 asm ("$f7"), f8 asm ("$f8"), f9 asm ("$f9");
typedef struct
  {
    long int __9, __10, __11, __12, __13, __14;
    long int *__pc, *__fp, *__sp;
    double __f2, __f3, __f4, __f5, __f6, __f7, __f8, __f9;
  } __jmp_buf[1];
typedef int __sig_atomic_t;
typedef struct
  {
    unsigned long int __val[(1024 / (8 * sizeof (unsigned long int))) ];
  } __sigset_t;
typedef struct __jmp_buf_tag	 
  {
    __jmp_buf __jmpbuf;		 
    int __mask_was_saved;	 
    __sigset_t __saved_mask;	 
  } jmp_buf[1];
extern int __sigsetjmp  (jmp_buf __env, int __savemask)  ;
extern void longjmp  (jmp_buf __env, int __val)  
     __attribute__ ((__noreturn__));
extern void _longjmp  (jmp_buf __env, int __val)  
     __attribute__ ((__noreturn__));
extern void __longjmp  (__jmp_buf __env, int __val)  
     __attribute__ ((__noreturn__));
extern int __sigjmp_save  (jmp_buf __env, int __savemask)  ;
typedef jmp_buf sigjmp_buf;
extern void siglongjmp  (sigjmp_buf __env, int __val)  
     __attribute__ ((__noreturn__));
void
__longjmp (__jmp_buf env, int val)
{
  register long int retval asm ("$0");
  r9 = env[0].__9;
  r10 = env[0].__10;
  r11 = env[0].__11;
  r12 = env[0].__12;
  r13 = env[0].__13;
  r14 = env[0].__14;
  f2 = env[0].__f2;
  f3 = env[0].__f3;
  f4 = env[0].__f4;
  f5 = env[0].__f5;
  f6 = env[0].__f6;
  f7 = env[0].__f7;
  f8 = env[0].__f8;
  f9 = env[0].__f9;
  retpc = env[0].__pc;
  fp = env[0].__fp;
  sp = env[0].__sp;
  asm volatile
    ("cmoveq %1, 1, %0\n\t"	 
     "ret $31, (%2), 1"	 
     : "=r" (retval)
     : "0" (val), "r" (retpc));
  while (1)
    {
      asm volatile ("");
    }
}

             reply	other threads:[~1997-09-07 10:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-09-07 10:54 H.J. Lu [this message]
1997-09-07 15:43 ` Richard Henderson
1997-09-07 17:36   ` Jim Wilson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m0x7lXq-0004ecC@ocean.lucon.org \
    --to=hjl@lucon.org \
    --cc=egcs@cygnus.com \
    --cc=rth@cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).