From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2618 invoked by alias); 6 Jul 2015 06:30:10 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 2598 invoked by uid 89); 6 Jul 2015 06:30:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-oi0-f43.google.com Received: from mail-oi0-f43.google.com (HELO mail-oi0-f43.google.com) (209.85.218.43) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 06 Jul 2015 06:30:08 +0000 Received: by oiaf66 with SMTP id f66so79372974oia.3 for ; Sun, 05 Jul 2015 23:30:06 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.60.92.131 with SMTP id cm3mr19087686oeb.23.1436164206096; Sun, 05 Jul 2015 23:30:06 -0700 (PDT) Received: by 10.76.115.167 with HTTP; Sun, 5 Jul 2015 23:30:06 -0700 (PDT) In-Reply-To: References: Date: Mon, 06 Jul 2015 06:30:00 -0000 Message-ID: Subject: Re: fix segfault in verify_flow_info() with -dx option From: Richard Biener To: Prathamesh Kulkarni Cc: gcc Patches , Richard Biener Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-07/txt/msg00296.txt.bz2 On Sun, Jul 5, 2015 at 2:07 PM, Prathamesh Kulkarni wrote: > Hi, > Passing -dx causes segmentation fault: > Test case: void f(void) {} > > ./test.c: In function 'f': > ../test.c:3:1: internal compiler error: Segmentation fault > } > ^ > 0xab6baf crash_signal > /home/prathamesh.kulkarni/gnu-toolchain/src/gcc.git/gcc/toplev.c:366 > 0x694b14 verify_flow_info() > /home/prathamesh.kulkarni/gnu-toolchain/src/gcc.git/gcc/cfghooks.c:109 > 0x9f7e64 execute_function_todo > /home/prathamesh.kulkarni/gnu-toolchain/src/gcc.git/gcc/passes.c:1997 > 0x9f86eb execute_todo > /home/prathamesh.kulkarni/gnu-toolchain/src/gcc.git/gcc/passes.c:2042 > > Started with r210068. > It looks like -dx causes cfun->cfg to be NULL, and hence the segfault > in verify_flow_info(). > The attached patch tries to fix it by adding a check to cfun->cfg before calling > verify_flow_info() from execute_function_todo(). > Bootstrapped and tested on x86_64-unknown-linux-gnu. > OK for trunk ? No. We've checked cfun->curr_properties & PROP_cfg already. So whatever is keeping that set but frees the CFG is the offender (and should clear the flag). Richard. > Thank you, > Prathamesh