From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 68129 invoked by alias); 18 Nov 2017 02:50:48 -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 67999 invoked by uid 89); 18 Nov 2017 02:50:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.7 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KB_WAM_FROM_NAME_SINGLEWORD,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:913 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; Sat, 18 Nov 2017 02:50:46 +0000 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 11BF3C0587CD; Sat, 18 Nov 2017 02:50:45 +0000 (UTC) Received: from c64.redhat.com (ovpn-112-13.phx2.redhat.com [10.3.112.13]) by smtp.corp.redhat.com (Postfix) with ESMTP id 84B5460BF3; Sat, 18 Nov 2017 02:50:40 +0000 (UTC) From: David Malcolm To: Jason Merrill Cc: Nathan Sidwell , Jakub Jelinek , Richard Biener , gcc-patches List , David Malcolm Subject: [PATCH 03/11] Implement STRIP_ANY_LOCATION_WRAPPER_SAFE Date: Sat, 18 Nov 2017 02:50:00 -0000 Message-Id: <1510973563-10046-4-git-send-email-dmalcolm@redhat.com> In-Reply-To: <1510973563-10046-1-git-send-email-dmalcolm@redhat.com> References: <1510350329-48956-1-git-send-email-dmalcolm@redhat.com> <1510973563-10046-1-git-send-email-dmalcolm@redhat.com> X-IsSubscribed: yes X-SW-Source: 2017-11/txt/msg01592.txt.bz2 We occasionally need to handle the NULL case when stripping trees, so this patch introduces a variant of STRIP_ANY_LOCATION_WRAPPER to do so. gcc/ChangeLog: * tree.h (STRIP_ANY_LOCATION_WRAPPER_SAFE): New macro. --- gcc/tree.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gcc/tree.h b/gcc/tree.h index 9a0bd60..98acc8b 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -492,6 +492,14 @@ extern void omp_clause_range_check_failed (const_tree, const char *, int, (EXP) = TREE_OPERAND ((EXP), 0); \ } while (0) +/* As STRIP_ANY_LOCATION_WRAPPER, but handle NULL_TREE. */ + +#define STRIP_ANY_LOCATION_WRAPPER_SAFE(EXP) \ + do { \ + if ((EXP) && location_wrapper_p (EXP)) \ + (EXP) = TREE_OPERAND ((EXP), 0); \ + } while (0) + /* Nonzero if TYPE represents a vector type. */ #define VECTOR_TYPE_P(TYPE) (TREE_CODE (TYPE) == VECTOR_TYPE) -- 1.8.5.3