public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* optimization/4382: __builtin_{set,long}jmp with -O3 can crash the compiler
@ 2001-09-24  4:56 malekith
  0 siblings, 0 replies; only message in thread
From: malekith @ 2001-09-24  4:56 UTC (permalink / raw)
  To: gcc-gnats; +Cc: malekith

>Number:         4382
>Category:       optimization
>Synopsis:       __builtin_{set,long}jmp with -O3 can crash the compiler
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          ice-on-legal-code
>Submitter-Id:   net
>Arrival-Date:   Mon Sep 24 04:56:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Michal Moskal <malekith@pld.org.pl>
>Release:        20010917 snapshot, gcc 3.0.1
>Organization:
>Environment:
PLD Linux/GNU on ia32, possibly other ia32, don't crash
axp-pld-linux
>Description:
I guess there are some problems with inlaingin function and
non-local gotos. I found it during Ksi developments, but
it also crashes C compiler. However as 
__bultin_{set,long}jmp are not documented, and in sources
there are comments, not to use them other way then
Ada and sjlj exception, so I'm not sure if code below
is legal. However, this seems to be a problem.
>How-To-Repeat:
compile following with -O3 (-fno-inline removes problem):

#v+
struct jmp_buf {
        void *p[5];
};

static void jumpaway(struct jmp_buf *ptr)
{
        __builtin_longjmp(ptr ,1);
        abort();
}

int main(void)
{
        struct jmp_buf buf;

        if (__builtin_setjmp(&buf) == 0) {
        } else
                return 0;
        jumpaway(&buf);
        abort();
        return 0;
}
#v-
>Fix:
none know, beside -fno-inline...
>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-09-24  4:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-24  4:56 optimization/4382: __builtin_{set,long}jmp with -O3 can crash the compiler malekith

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