From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,2ed1109624fc8c90 X-Google-Attributes: gidfee84,public From: Joerg Czeranski Subject: Re: 4.0D/4.0E DEC C optimization bug Date: 1999/04/15 Message-ID: <5u8Rt1uwx$76R$1@joerch.org>#1/1 X-Deja-AN: 466832336 References: <5tXNlnALx$2QR$1@joerch.org> <3713880D.ECF3B246@zk3.dec.com> Organization: Joerch Software Newsgroups: comp.unix.osf.osf1 Jeff Sullivan wrote in <3713880D.ECF3B246@zk3.dec.com>: > The following answer comes from one of our ANSI experts. [detailed analysis snipped...] > Workarounds would be to use setjmp instead of sigsetjmp, make the > variables volatile, or compile -O0 (split lifetime analysis is > documented as coming on at -O1). [what the compiler would have to do to prevent the problem...] > We will look into resolving the above mentioned problem with > sigsetjmp in future versions of Compaq C. > > Let us know if this helps. > > Thanks, > -Jeff I noticed that I couldn't reproduce the problem with setjmp, and that making it volatile makes it go away, too. In this case volatile doesn't hurt at all, because the variable is almost never used. I sent such a patch to the authors, and I think it's a good idea to keep it, other compilers might suffer from the same problem. Actually some version of gcc is said to have a similar symptom, SEGV in the same program, but I don't know if that relates to sigsetjmp, because I couldn't reproduce it.) I'm very pleased by your fast and competent answer. joerch