From patchwork Sun Jan 26 00:13:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Polacek X-Patchwork-Id: 1229312 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-518264-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha1 header.s=default header.b=URuc6qT+; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=cmjFeFJp; 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 484tdn0WNTz9sRY for ; Sun, 26 Jan 2020 11:13:46 +1100 (AEDT) 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:subject:date:message-id:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=uxoY8R2SuMTUGHKu +iBJH5oKpNtwlLi8f38/dZa9cCgqO2jaTpo8O5ZQJL+qt3RWsr2TH5veRKHBi1wJ 4PUcJOL1fW7Y6Xr8g3yfmBt2qHKt3w1ap8idrYRNSX4NPgX33i8zyJmboh6q53cM MGqXA6omSjGcxWtY3GRgqfF8h0w= 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:subject:date:message-id:mime-version:content-type :content-transfer-encoding; s=default; bh=ZoBQT9ogwaqPBY1xvgtjmL Dof+s=; b=URuc6qT+QFdCBRD4VjhgriCi3XZIF/LkpjCYlI3hXFigFfkzkR2ShM Hw1mdRvGu2IsSXn3aZFHJV7/6moG/7UM1kB93jeVP/NFMgdUBClsh9HSR1BYl3tR 4XBYYBzFz+uLwA4B8+kFMvCLV/IRg7lueXtUxHY2y0QVoASvIF7/U= Received: (qmail 110597 invoked by alias); 26 Jan 2020 00:13:39 -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 110589 invoked by uid 89); 26 Jan 2020 00:13:38 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-22.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=boston X-HELO: us-smtp-delivery-1.mimecast.com Received: from us-smtp-1.mimecast.com (HELO us-smtp-delivery-1.mimecast.com) (207.211.31.81) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 26 Jan 2020 00:13:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579997616; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=F/SlVETnpxPtl6dXgGIuN0Lj56o/rGWa5zuq83ahSeI=; b=cmjFeFJpaFtDIEGbqlQ700FCsdVT/mcPGLqeo5KLJ5Uf1z+ivaoJrVRztvfwUlbDA8entV weDaj8Ul4f4Dg1dr2U0AHhynndAN/tpdXlJxS9eg2GSBT1pEwVRF4pMlhYwmi9lcMeJFjn foLavIqUIq2GLTbptSMeP/fAXvYd7Jg= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-143-5oTVoxnTOeCAqLF-6411Yw-1; Sat, 25 Jan 2020 19:13:34 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3B84A800D41 for ; Sun, 26 Jan 2020 00:13:33 +0000 (UTC) Received: from pdp-11.redhat.com (ovpn-120-167.rdu2.redhat.com [10.10.120.167]) by smtp.corp.redhat.com (Postfix) with ESMTP id E3EBE28D15 for ; Sun, 26 Jan 2020 00:13:32 +0000 (UTC) From: Marek Polacek To: GCC Patches Subject: [PATCH] sanopt: Avoid crash on anonymous parameter [PR93436] Date: Sat, 25 Jan 2020 19:13:20 -0500 Message-Id: <20200126001320.1283996-1-polacek@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Here we crash when using -fsanitize=address -fdump-tree-sanopt because the dumping code uses IDENTIFIER_POINTER on a null DECL_NAME. Instead, we can print "" in such a case. Or we could avoid printing that diagnostic altogether. I don't think this warrants a testcase. Tested x86_64-linux, ok for trunk and 9? 2020-01-25 Marek Polacek PR tree-optimization/93436 * sanopt.c (sanitize_rewrite_addressable_params): Avoid crash on null DECL_NAME. --- gcc/sanopt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) base-commit: 05107d4e4ccd11ecc8712d6e271fcb4b5f17060f diff --git a/gcc/sanopt.c b/gcc/sanopt.c index 619aae45a15..63fd68d4ad1 100644 --- a/gcc/sanopt.c +++ b/gcc/sanopt.c @@ -1176,7 +1176,9 @@ sanitize_rewrite_addressable_params (function *fun) if (dump_file) fprintf (dump_file, "Rewriting parameter whose address is taken: %s\n", - IDENTIFIER_POINTER (DECL_NAME (arg))); + (DECL_NAME (arg) + ? IDENTIFIER_POINTER (DECL_NAME (arg)) + : "")); SET_DECL_PT_UID (var, DECL_PT_UID (arg));