This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/14411] New: Request for setjmp/longjmp attributes
- From: "avn at any dot ru" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 Mar 2004 17:22:16 -0000
- Subject: [Bug c/14411] New: Request for setjmp/longjmp attributes
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
While working on a project that uses a function with setjmp-like semantics, it
became necessary to supply the optimizer with such information. Otherwise, the
following code:
void *ptr = NULL;
if (mysetjmp()) {
if (ptr) free(ptr);
}
else {
/* ... */
ptr = malloc(...);
/* ... */
}
does not do the call to free() when compiled with -O2 (the optimizer believes
the ptr still is NULL and eliminates the call to free() completely).
--
Summary: Request for setjmp/longjmp attributes
Product: gcc
Version: 3.3.3
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: avn at any dot ru
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14411