public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* optimization/6161: cc1 segfault in make_reorder_chain_1
@ 2002-04-03 15:36 sstone
  0 siblings, 0 replies; 2+ messages in thread
From: sstone @ 2002-04-03 15:36 UTC (permalink / raw)
  To: gcc-gnats


>Number:         6161
>Category:       optimization
>Synopsis:       cc1 segfault in make_reorder_chain_1
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Apr 03 15:36:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     sstone@tivo.com
>Release:        gcc-3.0 and gcc-3.0.4
>Organization:
>Environment:
Redhat Linux 7.2
>Description:
The following small program when run with gcc segfaults when using -O2.  -O1 or less doesn't fail. 

Program t.c:
-----------
struct UI_Event {
        int device;
        char id;
        unsigned long scan_code;
	unsigned long duration;
};


unsigned char map[256];

int x(struct UI_Event* e)
{
        unsigned long fcode = 0;

	if (e->scan_code == 1) {
                switch (e->device) {
                        case 1:
                                fcode = 0;
                                goto done;
                        case 2:
                                fcode = 1;
                                goto done;
                        case 3:
                                fcode = 2;
                                goto done;
                        case 4:
                                fcode = 3;
                                goto done;
                        case 5:
                                fcode = 4;
                                goto done;
                        case 6:
                                fcode = 5;
                                goto done;
                        case 7:
                                fcode = 6;
                                goto done;
                        default:
                                return 0;
                }
	}

        for (fcode = 0; fcode < 256; fcode++) {
                if (e->scan_code == map[fcode]) goto done;
        }
        return 0;

done:
        return 1;
}
-----------
Here is the cc1 backtrace:
Program received signal SIGSEGV, Segmentation fault.
0x081efcc6 in make_reorder_chain_1 (bb=0x82fd198, prev=0x0)
    at ../../gcc-3.0.4/gcc/bb-reorder.c:416
416           next = (taken ? e_taken : e_fall)->dest;
(gdb) bt
#0  0x081efcc6 in make_reorder_chain_1 (bb=0x82fd198, prev=0x0)
    at ../../gcc-3.0.4/gcc/bb-reorder.c:416
#1  0x081efbb8 in make_reorder_chain () at ../../gcc-3.0.4/gcc/bb-reorder.c:328
#2  0x081f0f9e in reorder_basic_blocks ()
    at ../../gcc-3.0.4/gcc/bb-reorder.c:1365
#3  0x0807a560 in rest_of_compilation (decl=0x401c49c0)
    at ../../gcc-3.0.4/gcc/toplev.c:3631
#4  0x0805754e in c_expand_body (fndecl=0x401c49c0, nested_p=0)
    at ../../gcc-3.0.4/gcc/c-decl.c:6782
#5  0x0805742c in finish_function (nested=0)
    at ../../gcc-3.0.4/gcc/c-decl.c:6697
#6  0x08049dfc in yyparse_1 () at c-parse.y:324
#7  0x08078d1a in compile_file (name=0x82f7e92 "t.c")
    at ../../gcc-3.0.4/gcc/toplev.c:2369
#8  0x0807c436 in main (argc=50, argv=0xbffff584)
    at ../../gcc-3.0.4/gcc/toplev.c:4990
#9  0x40048507 in __libc_start_main (main=0x807bd20 <main>, argc=50,
    ubp_av=0xbffff584, init=0x80490b0 <_init>, fini=0x81ff930 <_fini>,
    rtld_fini=0x4000dc14 <_dl_fini>, stack_end=0xbffff57c)
    at ../sysdeps/generic/libc-start.c:129
-----------------------
Run gcc-3-0-4 with the following command line:
gcc -O2 -c t.c
to reproduce.  gcc-3-0 has the same problem.
>How-To-Repeat:
Run gcc-3-0-4 with the following command line:
gcc -O2 -c t.c
to reproduce.  gcc-3-0 has the same problem.
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


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

* Re: optimization/6161: cc1 segfault in make_reorder_chain_1
@ 2002-04-04  2:50 rth
  0 siblings, 0 replies; 2+ messages in thread
From: rth @ 2002-04-04  2:50 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, nobody, sstone

Synopsis: cc1 segfault in make_reorder_chain_1

State-Changed-From-To: open->closed
State-Changed-By: rth
State-Changed-When: Thu Apr  4 02:50:29 2002
State-Changed-Why:
    2002-03-21  DJ Delorie  <dj@redhat.com>
    
            * bb-reorder.c (make_reorder_chain_1): Protect against
            when redundant edges are omitted.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6161


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

end of thread, other threads:[~2002-04-04 10:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-03 15:36 optimization/6161: cc1 segfault in make_reorder_chain_1 sstone
2002-04-04  2:50 rth

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