From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30349 invoked by alias); 15 Jan 2014 18:46:12 -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 30339 invoked by uid 89); 15 Jan 2014 18:46:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 15 Jan 2014 18:46:09 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s0FIk7pl032430 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 15 Jan 2014 13:46:08 -0500 Received: from stumpy.slc.redhat.com (ovpn-113-36.phx2.redhat.com [10.3.113.36]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s0FIk6Im004334; Wed, 15 Jan 2014 13:46:07 -0500 Message-ID: <52D6D76E.5050009@redhat.com> Date: Wed, 15 Jan 2014 18:46:00 -0000 From: Jeff Law User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Teresa Johnson , "gcc-patches@gcc.gnu.org" CC: David Li Subject: Re: [PATCH] Fix segfault in FRE during SCC value numbering References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2014-01/txt/msg00911.txt.bz2 On 01/15/14 10:07, Teresa Johnson wrote: > Handle NULL vdef for call in the case where we have a matching vnresult > that has a vdef (it already handles the NULL vdef case when !vnresult). This > can happen for promoted indirect calls if the fallback indirect call > (which has a vdef) can be proven equivalent to the promoted direct call > (which might not have a vdef). > > This occurred for a case where we had a promoted indirect call, > where FRE determined that the promoted direct call and the fall-back indirect > call were equivalent (since earlier it determined that the function pointer > was always set to that target). The indirect call had been analyzed by > visit_reference_op_call first, and had a VDEF. The direct call did not have a > VDEF, presumably because it was a leaf function in the same module without any > stores. But visit_reference_op_call unconditionally calls set_ssa_val_to when > the previous vnresult had a vdef, leading to a seg fault in this case. > If we had analyzed the direct call first the failure wouldn't have occurred > since the !vnresult case guards the call to set_ssa_val_to with a check > for a NULL vdef, and the subsequent handling of the indirect call would > also not call set_ssa_val_to since vnresult would have had a null result_vdef. > > Bootstrapped and tested on x86_64-unknown-linux-gnu. Ok for trunk? > > 2014-01-15 Teresa Johnson > > * tree-ssa-sccvn.c (visit_reference_op_call): Handle NULL vdef. The patch is OK. Given this was an ICE, do you have a reduced test we can add to the regression suite? I realize that order of visiting in the SCC is important to trigger, but a regression test would still be useful. Thanks, Jeff