public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c/3875: gcc 3.0 breaks Mercury
@ 2001-07-30  5:16 Fergus Henderson
  0 siblings, 0 replies; 3+ messages in thread
From: Fergus Henderson @ 2001-07-30  5:16 UTC (permalink / raw)
  To: gcc-gnats

>Number:         3875
>Category:       c
>Synopsis:       gcc 3.0 breaks Mercury
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          ice-on-legal-code
>Submitter-Id:   net
>Arrival-Date:   Mon Jul 30 05:16:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Fergus Henderson
>Release:        3.0
>Organization:
Comp Sci, University of Melbourne
>Environment:
System: Linux mars 2.2.18pre21-ide #1 Sat Nov 18 19:41:46 EST 2000 i686 unknown
Architecture: i686

	
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ./configure --prefix=/usr/local/gcc-3.0
>Description:

gcc 3.0 gets a segmentation fault when compiling C files generated by
the Mercury compiler.

The problem seems to be related to taking the address of an unreachable label.

>How-To-Repeat:

Compile the following file with `gcc -O'.

	extern void *dummy;
	void foo (void) {
	  goto *&&label1;
	label1:
	  dummy = &&label2;
	  return;
	label2:
	  goto label2;
	}

The result is a crash in cc1

	bash$ gcc -O bug.c
	bug.c: In function `foo':
	bug.c:9: Internal error: Segmentation fault
	Please submit a full bug report,
	with preprocessed source if appropriate.
	See <URL: http://www.gnu.org/software/gcc/bugs.html > for instructions.

The crash occurs in find_basic_blocks_1().

(gdb) list *$pc
0x8149da4 is in find_basic_blocks_1 (flow.c:873).
868                                  || GET_CODE (PATTERN (next)) ==
ADDR_DIFF_VEC))
869                       ;
870                     else if (GET_CODE (lab) == NOTE)
871                       ;
872                     else if (GET_CODE (NEXT_INSN (insn)) == JUMP_INSN
873                              && find_reg_note (NEXT_INSN (insn), REG_LABEL,
lab))
874                       ;
875                     else
876                       lvl = alloc_EXPR_LIST (0, XEXP (note, 0), lvl);
877                   }

(gdb) p insn
$5 = 0x401675c0
(gdb) pr

(insn 15 27 0 (set (mem/f:SI (symbol_ref:SI ("dummy")) 0)
        (label_ref:SI 19)) 35 {*movsi_1} (nil)
    (insn_list:REG_LABEL 19 (nil)))

>Fix:

A work-around is to compile without optimization.
>Release-Note:
>Audit-Trail:
>Unformatted:


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

* Re: c/3875: gcc 3.0 breaks Mercury
@ 2002-03-08  8:53 neil
  0 siblings, 0 replies; 3+ messages in thread
From: neil @ 2002-03-08  8:53 UTC (permalink / raw)
  To: fjh, gcc-bugs, gcc-prs, nobody

Synopsis: gcc 3.0 breaks Mercury

State-Changed-From-To: open->closed
State-Changed-By: neil
State-Changed-When: Fri Mar  8 08:53:37 2002
State-Changed-Why:
    You reported it fixed, thanks!

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


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

* Re: c/3875: gcc 3.0 breaks Mercury
@ 2002-03-07 12:16 Fergus Henderson
  0 siblings, 0 replies; 3+ messages in thread
From: Fergus Henderson @ 2002-03-07 12:16 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c/3875; it has been noted by GNATS.

From: Fergus Henderson <fjh@cs.mu.OZ.AU>
To: gcc-gnats@gcc.gnu.org, gcc-prs@gcc.gnu.org, fjh@cs.mu.OZ.AU,
        gcc-bugs@gcc.gnu.org, nobody@gcc.gnu.org
Cc:  
Subject: Re: c/3875: gcc 3.0 breaks Mercury
Date: Fri, 08 Mar 2002 07:11:22 +1100

 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=3875
 This bug seems to be fixed in the latest snapshot.


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

end of thread, other threads:[~2002-03-08 16:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-30  5:16 c/3875: gcc 3.0 breaks Mercury Fergus Henderson
2002-03-07 12:16 Fergus Henderson
2002-03-08  8:53 neil

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