From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3066 invoked by alias); 1 Dec 2002 21:46:03 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 3052 invoked by uid 71); 1 Dec 2002 21:46:02 -0000 Date: Sun, 01 Dec 2002 13:46:00 -0000 Message-ID: <20021201214602.3051.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: "Christian Ehrhardt" Subject: Re: optimization/7507: [3.2/3.3 regression] ICE (segfault) with -O2 Reply-To: "Christian Ehrhardt" X-SW-Source: 2002-12/txt/msg00034.txt.bz2 List-Id: The following reply was made to PR optimization/7507; it has been noted by GNATS. From: "Christian Ehrhardt" To: gcc-gnats@gcc.gnu.org, gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org, nobody@gcc.gnu.org, hanwen@meddo.cs.uu.nl Cc: Subject: Re: optimization/7507: [3.2/3.3 regression] ICE (segfault) with -O2 Date: Sun, 1 Dec 2002 22:44:24 +0100 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7507 Hi, I tried to track this a bit more and came up with a slightly different example that still ices: ------------------- snip --------------------- extern int x (int); inline int bar (void) { return 1; } int foo (void) { x ((bar(), foo) ()); return 2; } ------------------- snip --------------------- Which results in the following insns in .c.01.sibling (analyzed below): ------------------- cut --------------------- ;; Function foo try_optimize_cfg iteration 1 Merged 0 and 1 without moving. try_optimize_cfg iteration 2 (note 2 0 3 NOTE_INSN_DELETED) (note 3 2 57 NOTE_INSN_FUNCTION_BEG) (note 57 3 27 [bb 0] NOTE_INSN_BASIC_BLOCK) (note 27 57 28 3a6fc0 NOTE_INSN_BLOCK_BEG) (note 28 27 29 NOTE_INSN_DELETED) (note 29 28 31 NOTE_INSN_DELETED) (insn 31 29 32 (set (reg/v:SI 108) (const_int 1 [0x1])) -1 (nil) (nil)) (jump_insn 32 31 33 (set (pc) (label_ref 19)) -1 (nil) (nil)) (barrier 33 32 34) (note 34 33 35 3a6fc0 NOTE_INSN_BLOCK_END) (call_insn 35 34 37 (parallel[ (set (reg:SI 8 %o0) (call (mem:SI (symbol_ref:SI ("foo")) [0 S4 A32]) (const_int 0 [0x0]))) (clobber (reg:SI 15 %o7)) ] ) -1 (nil) (nil) (nil)) (insn 37 35 39 (set (reg:SI 110) (reg:SI 8 %o0)) -1 (nil) (nil)) (insn 39 37 40 (set (reg:SI 8 %o0) (reg:SI 110)) -1 (nil) (nil)) (call_insn 40 39 46 (parallel[ (set (reg:SI 8 %o0) (call (mem:SI (symbol_ref:SI ("x")) [0 S4 A32]) (const_int 0 [0x0]))) (clobber (reg:SI 15 %o7)) ] ) -1 (nil) (nil) (expr_list (use (reg:SI 8 %o0)) (nil))) (insn 46 40 49 (set (reg:SI 107) (const_int 2 [0x2])) -1 (nil) (nil)) (note 49 46 53 NOTE_INSN_FUNCTION_END) (insn 53 49 56 (set (reg/i:SI 24 %i0) (reg:SI 107)) -1 (nil) (nil)) (insn 56 53 0 (use (reg/i:SI 24 %i0)) -1 (nil) (nil)) ------------------- cut --------------------- The jump insn should jump to a label after the inlined call to bar. The target label for this jump is never emitted. This is the reason for the segfault while finding basic blocks. The jump is added by replace_call_placeholder and it is only added if the sibcall_use_normal branch is taken. regards Christian -- THAT'S ALL FOLKS!