From patchwork Tue Jul 10 22:20:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Wielaard X-Patchwork-Id: 942268 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-481324-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="LhkgBgjo"; 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 41QGqM04jzz9s00 for ; Wed, 11 Jul 2018 08:20:29 +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:from :to:cc:subject:date:message-id; q=dns; s=default; b=ReejoQHlCTF1 D+xk42UJCra4Pi9fFSeHypYo6bmk3PCIZzYrWGUQ/iM7ZlIqXpUDqVZDK1Od39Lt ZaLRGhXhP9Ev2eW10kqI+kuNERIEolQa0p5m7YZKJdb3dvfm6ZDY9KbGih+4ji08 0q7sEo5lpTIbi75zev7mfIMOJFQlsBg= 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:from :to:cc:subject:date:message-id; s=default; bh=7lHx0+WdY3iUW4g/Yj tJHYJ1BIk=; b=LhkgBgjoKYFt55AWRCiPKbxWOLF2naZi7Vjdd4KyLxH0oRp1X8 ZvigwAwxyYiK5zB9z/CrumyZ72lHWmOpmYPurCREwd8c5ayGdHag+MFEhZCv4//9 nRo9TEMoPmLwVqWraF5ejSohAKR3jUUCmXknchOpotlxo1nDM5+walufY= Received: (qmail 101649 invoked by alias); 10 Jul 2018 22:20:22 -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 101632 invoked by uid 89); 10 Jul 2018 22:20:21 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1428, H*Ad:U*mark X-HELO: gnu.wildebeest.org Received: from wildebeest.demon.nl (HELO gnu.wildebeest.org) (212.238.236.112) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 10 Jul 2018 22:20:20 +0000 Received: from tarox.wildebeest.org (tarox.wildebeest.org [172.31.17.39]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id EEE1A300040F; Wed, 11 Jul 2018 00:20:17 +0200 (CEST) Received: by tarox.wildebeest.org (Postfix, from userid 1000) id 9B1BB413CABF; Wed, 11 Jul 2018 00:20:17 +0200 (CEST) From: Mark Wielaard To: gcc-patches@gcc.gnu.org Cc: marxin@gcc.gnu.org, Mark Wielaard Subject: [PATCH] PR debug/86459 - Fix -gsplit-dwarf -g3 gcc_assert Date: Wed, 11 Jul 2018 00:20:08 +0200 Message-Id: <1531261208-32133-1-git-send-email-mark@klomp.org> There was a typo in the output_macinfo_op gcc_assert. The function is called dwarf_FORM, not dwarf_form. Add the provided testcase from the bug to test -gsplit-dwarf -g3. gcc/ChangeLog: PR debug/86459 * dwarf2out.c (output_macinfo_op): Fix dwarf_FORM typo in gcc_assert. gcc/testsuite/ChangeLog: PR debug/86459 * gcc.dg/pr86459.c: New test. diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 9523217..4640a22 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -28066,7 +28066,7 @@ output_macinfo_op (macinfo_entry *ref) node = find_AT_string (ref->info); gcc_assert (node && (node->form == DW_FORM_strp - || node->form == dwarf_form (DW_FORM_strx))); + || node->form == dwarf_FORM (DW_FORM_strx))); dw2_asm_output_data (1, ref->code, ref->code == DW_MACRO_define_strp ? "Define macro strp" diff --git a/gcc/testsuite/gcc.dg/pr86459.c b/gcc/testsuite/gcc.dg/pr86459.c new file mode 100644 index 0000000..7856a37 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr86459.c @@ -0,0 +1,19 @@ +/* { dg-do compile } */ +/* { dg-options "-g -O2 -fno-var-tracking-assignments -gsplit-dwarf -g3" } */ + +/* Same as pr86064.c but compiled with -g3 it showed an issue in + output_macinfo_op because of a typo in an assert. */ + +int a; +__attribute__((__cold__)) void b(); + +void e(int *); +int f(); + +void c() { + int d; + e(&d); + a = d; + if (f()) + b(); +}