From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,2ed1109624fc8c90,start X-Google-Attributes: gidfee84,public From: Joerg Czeranski Subject: 4.0D/4.0E DEC C optimization bug Date: 1999/04/10 Message-ID: <5tXNlnALx$2QR$1@joerch.org>#1/1 X-Deja-AN: 464912483 Organization: Joerch Software Newsgroups: comp.unix.osf.osf1 Hi, DEC C V5.6-071 on Digital UNIX V4.0 (Rev. 878), DEC C V5.7-566 (cc.alt) on Digital UNIX V4.0 (Rev. 878), and DEC C V5.8-009 on Digital UNIX V4.0 (Rev. 1091) (I didn't check any others, but AFAIR the same source worked with the Dec Unix 4.0A compiler) exhibit a problem compiling sigsetjmp with optimization: If a local non-volatile automatic variable is written before the sigsetjmp and read in the "true" branch of "if (sigsetjmp(...))" but not used elsewhere, the compiler might decide sharing its location with a different local variable between sigsetjmp and siglongjmp. The documentation, the C9X draft, and the Single Unix Spec. say that such a variable may only have an indeterminant value if it's written after a setjmp - referring to setjmp/longjmp. Am I mistaken in assuming the same should apply to sigsetjmp/siglongjmp or is this a bug? I found this problem when I compiled the Objective Caml compiler, and isolated it. I'll post a source listing that demonstrates it. joerch