public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/14411] New: Request for setjmp/longjmp attributes
@ 2004-03-03 17:22 avn at any dot ru
  2004-03-03 17:24 ` [Bug c/14411] " avn at any dot ru
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: avn at any dot ru @ 2004-03-03 17:22 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2005-03-08 19:02 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-03 17:22 [Bug c/14411] New: Request for setjmp/longjmp attributes avn at any dot ru
2004-03-03 17:24 ` [Bug c/14411] " avn at any dot ru
2004-03-03 17:25 ` avn at any dot ru
2004-03-03 17:32 ` pinskia at gcc dot gnu dot org
2004-03-03 17:46 ` jsm at polyomino dot org dot uk
2004-03-03 20:13 ` schwab at suse dot de
2004-06-02  3:49 ` pinskia at gcc dot gnu dot org
2004-06-02  6:41 ` avn at any dot ru
2004-11-30  7:47 ` zack at gcc dot gnu dot org
2005-03-08 13:20 ` cvs-commit at gcc dot gnu dot org
2005-03-08 14:37 ` pinskia at gcc dot gnu dot org
2005-03-08 14:38 ` pinskia at gcc dot gnu dot org
2005-03-08 19:02 ` avn at any dot ru

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).