From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 95124 invoked by alias); 20 Jun 2019 19:12:12 -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 95114 invoked by uid 89); 20 Jun 2019 19:12:12 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-23.0 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS autolearn=ham version=3.3.1 spammy= 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; Thu, 20 Jun 2019 19:12:10 +0000 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 98B793087959; Thu, 20 Jun 2019 19:12:01 +0000 (UTC) Received: from redhat.com (ovpn-122-34.rdu2.redhat.com [10.10.122.34]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A04381001DD2; Thu, 20 Jun 2019 19:11:59 +0000 (UTC) Date: Thu, 20 Jun 2019 19:12:00 -0000 From: Marek Polacek To: Jakub Jelinek Cc: Joseph Myers , Martin Sebor , GCC Patches , Jason Merrill Subject: Re: C++ PATCH for c++/60364 - noreturn after first decl not diagnosed (v2) Message-ID: <20190620191156.GK5989@redhat.com> References: <20190615142917.GI5989@redhat.com> <20190615143326.GK19695@tucnak> <20190615143913.GJ5989@redhat.com> <20190616161037.GK5989@redhat.com> <20190617181053.GR5989@redhat.com> <20190620164913.GH5989@redhat.com> <20190620175708.GT815@tucnak> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190620175708.GT815@tucnak> User-Agent: Mutt/1.11.4 (2019-03-13) X-SW-Source: 2019-06/txt/msg01262.txt.bz2 On Thu, Jun 20, 2019 at 07:57:08PM +0200, Jakub Jelinek wrote: > On Thu, Jun 20, 2019 at 12:49:13PM -0400, Marek Polacek wrote: > > Sorry about that. Does this patch work? > > > > 2019-06-20 Marek Polacek > > > > * config/sh/sh.c (sh2a_function_vector_p): Use get_attribute_name. > > Just that? > grep is_attribute_p.*TREE_PURPOSE config/*/* > config/m32c/m32c.c: if (is_attribute_p ("interrupt", TREE_PURPOSE (list))) > config/m32c/m32c.c: if (is_attribute_p ("bank_switch", TREE_PURPOSE (list))) > config/m32c/m32c.c: if (is_attribute_p ("fast_interrupt", TREE_PURPOSE (list))) > config/m32c/m32c.c: if (is_attribute_p ("function_vector", TREE_PURPOSE (list))) > config/m32c/m32c.c: if (is_attribute_p ("function_vector", TREE_PURPOSE (list))) > config/rl78/rl78.c: if (is_attribute_p ("saddr", TREE_PURPOSE (list))) > config/sh/sh.c: if (is_attribute_p ("sp_switch", TREE_PURPOSE (attrs)) > config/sh/sh.c: || is_attribute_p ("trap_exit", TREE_PURPOSE (attrs)) > config/sh/sh.c: || is_attribute_p ("nosave_low_regs", TREE_PURPOSE (attrs)) > config/sh/sh.c: || is_attribute_p ("resbank", TREE_PURPOSE (attrs))) > config/sh/sh.c: if (is_attribute_p ("function_vector", TREE_PURPOSE (list))) > config/sh/sh.c: if (is_attribute_p ("function_vector", TREE_PURPOSE (list))) Here's a bunch of more; I've audited the uses of TREE_PURPOSE in config/*/*. I haven't tested it or anything, but... ok for trunk? 2019-06-20 Marek Polacek * config/epiphany/epiphany.c (epiphany_compute_function_type): Use get_attribute_name. * config/m32c/m32c.c (interrupt_p): Likewise. (bank_switch_p): Likewise. (fast_interrupt_p): Likewise. (m32c_special_page_vector_p): Likewise. (current_function_special_page_vector): Likewise. * config/nds32/nds32.c (nds32_asm_function_prologue): Likewise. * config/rl78/rl78.c (rl78_attrlist_to_encoding): Likewise. * config/sh/sh.c (sh_insert_attributes): Likewise. (sh2a_get_function_vector_number): Likewise. diff --git gcc/config/epiphany/epiphany.c gcc/config/epiphany/epiphany.c index 657a8886ac7..2cc6c59eae3 100644 --- gcc/config/epiphany/epiphany.c +++ gcc/config/epiphany/epiphany.c @@ -1044,7 +1044,7 @@ epiphany_compute_function_type (tree decl) a; a = TREE_CHAIN (a)) { - tree name = TREE_PURPOSE (a); + tree name = get_attribute_name (a); if (name == get_identifier ("interrupt")) fn_type = EPIPHANY_FUNCTION_INTERRUPT; diff --git gcc/config/m32c/m32c.c gcc/config/m32c/m32c.c index 1a0d0c681b4..bda56e3beee 100644 --- gcc/config/m32c/m32c.c +++ gcc/config/m32c/m32c.c @@ -2858,7 +2858,7 @@ interrupt_p (tree node ATTRIBUTE_UNUSED) tree list = M32C_ATTRIBUTES (node); while (list) { - if (is_attribute_p ("interrupt", TREE_PURPOSE (list))) + if (is_attribute_p ("interrupt", get_attribute_name (list))) return 1; list = TREE_CHAIN (list); } @@ -2872,7 +2872,7 @@ bank_switch_p (tree node ATTRIBUTE_UNUSED) tree list = M32C_ATTRIBUTES (node); while (list) { - if (is_attribute_p ("bank_switch", TREE_PURPOSE (list))) + if (is_attribute_p ("bank_switch", get_attribute_name (list))) return 1; list = TREE_CHAIN (list); } @@ -2886,7 +2886,7 @@ fast_interrupt_p (tree node ATTRIBUTE_UNUSED) tree list = M32C_ATTRIBUTES (node); while (list) { - if (is_attribute_p ("fast_interrupt", TREE_PURPOSE (list))) + if (is_attribute_p ("fast_interrupt", get_attribute_name (list))) return 1; list = TREE_CHAIN (list); } @@ -2915,7 +2915,7 @@ m32c_special_page_vector_p (tree func) list = M32C_ATTRIBUTES (func); while (list) { - if (is_attribute_p ("function_vector", TREE_PURPOSE (list))) + if (is_attribute_p ("function_vector", get_attribute_name (list))) return 1; list = TREE_CHAIN (list); } @@ -2984,7 +2984,7 @@ current_function_special_page_vector (rtx x) list = M32C_ATTRIBUTES (t); while (list) { - if (is_attribute_p ("function_vector", TREE_PURPOSE (list))) + if (is_attribute_p ("function_vector", get_attribute_name (list))) { num = TREE_INT_CST_LOW (TREE_VALUE (TREE_VALUE (list))); return num; diff --git gcc/config/nds32/nds32.c gcc/config/nds32/nds32.c index eba98126705..ea532ce1eb3 100644 --- gcc/config/nds32/nds32.c +++ gcc/config/nds32/nds32.c @@ -2190,7 +2190,7 @@ nds32_asm_function_prologue (FILE *file) /* Display all attributes of this function. */ while (attrs) { - name = TREE_PURPOSE (attrs); + name = get_attribute_name (attrs); fprintf (file, "%s ", IDENTIFIER_POINTER (name)); /* Pick up the next attribute. */ diff --git gcc/config/rl78/rl78.c gcc/config/rl78/rl78.c index d2caa118281..067b966b48d 100644 --- gcc/config/rl78/rl78.c +++ gcc/config/rl78/rl78.c @@ -4532,7 +4532,7 @@ rl78_attrlist_to_encoding (tree list, tree decl ATTRIBUTE_UNUSED) { while (list) { - if (is_attribute_p ("saddr", TREE_PURPOSE (list))) + if (is_attribute_p ("saddr", get_attribute_name (list))) return 's'; list = TREE_CHAIN (list); } diff --git gcc/config/sh/sh.c gcc/config/sh/sh.c index dfaeab55142..5354d7960b0 100644 --- gcc/config/sh/sh.c +++ gcc/config/sh/sh.c @@ -8360,16 +8360,17 @@ sh_insert_attributes (tree node, tree *attributes) for (tail = attributes; attrs; attrs = TREE_CHAIN (attrs)) { - if (is_attribute_p ("sp_switch", TREE_PURPOSE (attrs)) - || is_attribute_p ("trap_exit", TREE_PURPOSE (attrs)) - || is_attribute_p ("nosave_low_regs", TREE_PURPOSE (attrs)) - || is_attribute_p ("resbank", TREE_PURPOSE (attrs))) + if (is_attribute_p ("sp_switch", get_attribute_name (attrs)) + || is_attribute_p ("trap_exit", get_attribute_name (attrs)) + || is_attribute_p ("nosave_low_regs", + get_attribute_name (attrs)) + || is_attribute_p ("resbank", get_attribute_name (attrs))) warning (OPT_Wattributes, "%qE attribute only applies to interrupt functions", - TREE_PURPOSE (attrs)); + get_attribute_name (attrs)); else { - *tail = tree_cons (TREE_PURPOSE (attrs), NULL_TREE, + *tail = tree_cons (get_attribute_name (attrs), NULL_TREE, NULL_TREE); tail = &TREE_CHAIN (*tail); } @@ -8537,7 +8538,7 @@ sh2a_get_function_vector_number (rtx x) return 0; for (tree list = SH_ATTRIBUTES (t); list; list = TREE_CHAIN (list)) - if (is_attribute_p ("function_vector", TREE_PURPOSE (list))) + if (is_attribute_p ("function_vector", get_attribute_name (list))) return TREE_INT_CST_LOW (TREE_VALUE (TREE_VALUE (list))); return 0;