From patchwork Fri Mar 31 18:10:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Pop X-Patchwork-Id: 745768 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vvqMT52X3z9s0m for ; Sat, 1 Apr 2017 05:11:47 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="cZXmoS0Q"; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; q=dns; s=default; b=CrWuPll1UHjq8iR wQYEZRGpDGGdnbsq9UPD9qdRaDTlmhBppAcyik0IkprDrh4cVHUJ32cM56vLYtTN fs4qUBg3KCVC58M4a8HkjQwRY1MwY/aEVMNqO1AAoHhBouupyaeY3ioq2e/2GEOZ sJsDYjN6nDv9c4q5/8zHh4pzo1sc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; s=default; bh=xdZjDBP+22VJ3YXSQLEC+ b2HBS4=; b=cZXmoS0QVYgucxyUY8GRbTgOJfJqWIibYHsPkrGlGYS42Wf8wocpC S4Rt79zpynZDKaqy8FpHnWaZ4FBrgmC2vv3nSmb0Vz+pghz7rH5OeAjj2YGOohdh giOLAhiAD+qaKKYrYWy3DOr2fSXmx4mBLK7LYErkPS3YIgdNt9KtE4= Received: (qmail 80647 invoked by alias); 31 Mar 2017 18:11:34 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 80630 invoked by uid 89); 31 Mar 2017 18:11:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-23.4 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-it0-f46.google.com Received: from mail-it0-f46.google.com (HELO mail-it0-f46.google.com) (209.85.214.46) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 31 Mar 2017 18:11:32 +0000 Received: by mail-it0-f46.google.com with SMTP id e75so17604898itd.1 for ; Fri, 31 Mar 2017 11:11:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=lGHqVwVB+bK4E4pPbCBUCBIbENCjDXC3jUcNvbgB11Y=; b=NRdTnL0LOwIhZ2Oglo+i+OpOsAaZ1FWehxheGnyOPpGAC9tjo5by6DkJdQnSshZ2/4 9JymfvqW1c538jTSBN5DnZV1py7fq4x8afCr19sHsRc8NaWvzq16rK5lfjJpaKlOyBvi zd+mBys/LQxugkVhgFtLy2NlTe6VR0dXj9r7D87S+t52dVo+JlxrRZC6PFc3Qo2zWXzt AWDSxO/7D3ftXlMF/F/9uR0q9qO4gRGh6/ESH9xk/rSMGPKMv+KyNGgR05L/mRBq3rTL Ok6KZAtMr925InaKWyHMoha8GjrnL4ORqlLOJ5Cu5XRmLcXokrbjHNs/HSHUWc/iSLpg JdIw== X-Gm-Message-State: AFeK/H3J93Njn+jch+1LVVk2zvP5ZeV2R2mzj1vbX+AkFSU/vkQQ1o3W6UtwhPFs4Lk0nuYYswMM86RFZR2Hxw== X-Received: by 10.36.16.202 with SMTP id 193mr4964856ity.52.1490983892237; Fri, 31 Mar 2017 11:11:32 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.31.76 with HTTP; Fri, 31 Mar 2017 11:10:51 -0700 (PDT) In-Reply-To: References: From: Sebastian Pop Date: Fri, 31 Mar 2017 13:10:51 -0500 Message-ID: Subject: Re: Fix ICE with -fauto-profile when walking vdefs To: Richard Biener Cc: GCC Patches X-IsSubscribed: yes On Fri, Mar 31, 2017 at 12:06 PM, Richard Biener wrote: > That's not a default definition but bogus SSA form. You have to fix that, not this symptom. > Ok. It also crashes when adding a call to verifty_ssa diff --git a/gcc/auto-profile.c b/gcc/auto-profile.c index 4b21340c6f0..b834a40af4d 100644 --- a/gcc/auto-profile.c +++ b/gcc/auto-profile.c @@ -1589,6 +1590,7 @@ afdo_annotate_cfg (const stmt_set &promoted_stmts) static void early_inline () { + verify_ssa (true, true); compute_inline_parameters (cgraph_node::get (current_function_decl), true); unsigned todo = early_inliner (cfun); if (todo & TODO_update_ssa_any) The crash is on: gcc_assert (!need_ssa_update_p (cfun)); and after adding a call to update the SSA, it finishes compilation without errors. I am testing the following patch: * auto-profile.c (early_inline): Call update_ssa. --- a/gcc/auto-profile.c +++ b/gcc/auto-profile.c @@ -1589,6 +1589,8 @@ afdo_annotate_cfg (const stmt_set &promoted_stmts) static void early_inline () { + if (need_ssa_update_p (current_function_decl)) + update_ssa (TODO_update_ssa); compute_inline_parameters (cgraph_node::get (current_function_decl), true); unsigned todo = early_inliner (cfun); if (todo & TODO_update_ssa_any)