From patchwork Tue Jun 18 08:15:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 1117716 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-503138-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="TKHYfHug"; dkim-atps=neutral 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 45Sgs90zt8z9s00 for ; Tue, 18 Jun 2019 18:16:26 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=eDv7HISFxreeluymFE17/hoqvxEghbKAKRjNhr9xjH0sF1jrD6pr+ Vj782QbPOxaqYxznm5V0Fhy0eLfxSKLgAKEl0dnU16MHk5ZN0XkqkEQvdWljqSPB h5jH7upS7vaTh0IKZxe0QNUVPv9Vgmd0Qe/iIqUP7f0w36yYwJYptE= 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:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=qVfZOwDm9lGiWwgubaG6U3nQ4y4=; b=TKHYfHug/0EE3BEKIp+5 TaiYaZ6kbexoJwih4zRWLeC/9eK5cuLHRFv0VSsGOFG3EyWC9pVmnx7BQJMhVJqr oZzF5NjRCq6dpq6ST7cii3C2r1OS/CMb169PxHJUnH+CV6tC7h+G8tKoUkViRL/g pv1yzjdbY46oFDH5xhp/STA= Received: (qmail 99202 invoked by alias); 18 Jun 2019 08:16:08 -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 99000 invoked by uid 89); 18 Jun 2019 08:15:49 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-10.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, SPF_PASS autolearn=ham version=3.3.1 spammy=Treat X-HELO: mx1.suse.de Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 18 Jun 2019 08:15:48 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id B2DBBAE78 for ; Tue, 18 Jun 2019 08:15:45 +0000 (UTC) Date: Tue, 18 Jun 2019 10:15:45 +0200 (CEST) From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix PR90901, debug-expr expansion of deleted labels Message-ID: User-Agent: Alpine 2.20 (LSU 67 2015-01-07) MIME-Version: 1.0 The following deals with (note/s 5 0 0 ("lab") NOTE_INSN_DELETED_LABEL 2) appearing in DECL_RTL of LABEL_DECLs which expand_debug_expr doesn't expect. copy_rtx cannot deal with any notes so the following simply treats NOTE_P DECL_RTL as if it was optimized away. Bootstrap / regtest running on x86_64-unknown-linux-gnu. Richard. 2019-06-18 Richard Biener PR debug/90900 * cfgexpand.c (expand_debug_expr): Treat NOTE_P DECL_RTL as if optimized away. * gcc.dg/gomp/pr90900.c: New testcase. Index: gcc/cfgexpand.c =================================================================== --- gcc/cfgexpand.c (revision 272405) +++ gcc/cfgexpand.c (working copy) @@ -4387,7 +4387,11 @@ expand_debug_expr (tree exp) op0 = DECL_RTL_IF_SET (exp); /* This decl was probably optimized away. */ - if (!op0) + if (!op0 + /* At least label RTXen are sometimes replaced by + NOTE_INSN_DELETED_LABEL. Any notes here are not + handled by copy_rtx. */ + || NOTE_P (op0)) { if (!VAR_P (exp) || DECL_EXTERNAL (exp) Index: gcc/testsuite/gcc.dg/gomp/pr90900.c =================================================================== --- gcc/testsuite/gcc.dg/gomp/pr90900.c (nonexistent) +++ gcc/testsuite/gcc.dg/gomp/pr90900.c (working copy) @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fopenmp -g" } */ + +void f (int a) +{ + void *x = &&lab; +#pragma omp parallel + if (a) + { lab: __builtin_unreachable(); } + x; +}