First Last Prev Next    No search results available
Details
: Variables in scope of output setjmp calls should be volatile
Bug#: 77
: libraries
: Backend: C
Status: RESOLVED
Resolution: FIXED
: All
: All
: 1.0
: P2
: minor
: 1.1

:
: missing-feature
:
:
  Show dependency tree - Show dependency graph
People
Reporter: Brian R. Gaeke <gaeke+bugs@uiuc.edu>
Assigned To: Chris Lattner <sabre@nondot.org>

Attachments


Note

You need to log in before you can comment on or make changes to this bug.

Related actions


Description:   Opened: 2003-10-31 10:24
ISO 9899 7.13.2.1 (3) says that "[...] the values of objects of automatic
storage duration that are local to the function containing the invocation of the
[...] setjmp macro that do not have volatile-qualified type and have been
changed between the setjmp invocation and longjmp call are indeterminate."

We should probably be marking all auto variables in the scope of a setjmp
volatile, to be safe. So far, this has not bitten us, but this seems to prove
only that we have been lucky.
------- Comment #1 From Chris Lattner 2003-10-31 10:27:19 -------
This should definately be fixed, but we probably want to make it conditional
somehow.  If we don't, every variable in a function which uses 'invoke' will
have to be marked volatile.  That's not cool.

Also, note that this only effects platforms which do not use the "snapshot of
register state" way of implementing setjmp/longjmp.  I do not believe this
effects sparc or X86.
------- Comment #2 From Chris Lattner 2003-11-16 16:09:21 -------
Fixed like so:
http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20031110/009568.html

Any targets which do not require volatile markers on variables which setjmp
should extend this patch to avoid slowing down code that uses exception
handling.  I don't know whether the Sparc fits in this class or not, so I
conservatively didn't include it.

-Chris

First Last Prev Next    No search results available