From patchwork Thu Jun 8 15:50:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jozef Lawrynowicz X-Patchwork-Id: 773352 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 3wk8zF3Tm7z9s7p for ; Fri, 9 Jun 2017 01:51:05 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="d79xyl/N"; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :subject:to:cc:references:message-id:date:mime-version :in-reply-to:content-type; q=dns; s=default; b=H8VEWrkGpaBhxWgl4 8HMR95veTaDNatQuxXIdB4+kkxJwgG7kNFuT0zeRyFHt3gdM/zw90ziPi4py9MDP RYbwsJxBHnJWIH7hZ04T0nfL0E4/gas6GGV8WYGydxocxEmIilCAqdPiCuxDJgCB 8DD3rbXuvgrLHVam1o8uJYQ/fk= 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 :subject:to:cc:references:message-id:date:mime-version :in-reply-to:content-type; s=default; bh=ofOWzshNVZjn9M3R80cXu4w DtsY=; b=d79xyl/NFI1kFsVyFZmwBxWS9ww4NmunLXawnjCcaaekRpU6sA7ULMV 1YA9J7KEqBoE9JXvg96m6LTpisyw2xT3WUuCA73mpiz+/5NQdOb5eD4PvcR5cltI ofMP6PlWNxvnSkPkGUcBoNqPhGOIg94xwLTL0ryABcTnqikLQo14= Received: (qmail 73796 invoked by alias); 8 Jun 2017 15:50:48 -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 72857 invoked by uid 89); 8 Jun 2017 15:50:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.3 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.2 spammy=1998, ccs, H*M:78a0 X-HELO: mail-wr0-f176.google.com Received: from mail-wr0-f176.google.com (HELO mail-wr0-f176.google.com) (209.85.128.176) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 08 Jun 2017 15:50:36 +0000 Received: by mail-wr0-f176.google.com with SMTP id v111so20326253wrc.3 for ; Thu, 08 Jun 2017 08:50:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=R0TYHWhHVmHauGR2jhkiTkW4ibkpF/W6Zoac3MYxtlw=; b=A/U/OiX7v9nOG1Sf4NsfKDp/oNyFpjah7BwgrLF7i9DmuK0x91KoRxvL0THeSFx26N AwR4Aboh66+FFafrL5kZ4Yy7rVH0rk9n8T07L7y0EXriJSU77PGriYAncKVOXnfjiC6V FFFeCdKsPDTss5soHemkIzzH2B1SNf5ZkInsCQWvJyLHeMEnLCw1QvQHFdZEPBw5atpa fyxvZJE6/AsFij+kLUu/uAu4mmGbYvhzv8lweHhHE0VKLAwlS/12j31efhNMfTijmWDX 4DgeoaPIYpfx4ne5YJxRGcxXASaVILc90leDfoBMguEOnR0IYaM8fekqvnp6EsHpWTlN qYSQ== X-Gm-Message-State: AODbwcBaps53eIqeopTfNHfP6Q+bJPtF+oZjnJpW5eYoMpz/wVRgwpb8 aP4rwZLKXdPCFil5z/bSLw== X-Received: by 10.223.160.1 with SMTP id k1mr30033858wrk.102.1496937038180; Thu, 08 Jun 2017 08:50:38 -0700 (PDT) Received: from [10.0.39.126] ([31.24.222.134]) by smtp.gmail.com with ESMTPSA id f199sm6413289wmd.33.2017.06.08.08.50.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Jun 2017 08:50:37 -0700 (PDT) From: Jozef Lawrynowicz Subject: Re: [PATCH 2/2] [MSP430] Fix issues handling .persistent attribute (PR 78818) To: Nick Clifton Cc: gcc-patches References: <1239adcb-fdce-264b-a85e-a352e73e2b56@redhat.com> Message-ID: <6d51c0e4-3c0c-6d9b-78a0-241078c19a87@somniumtech.com> Date: Thu, 8 Jun 2017 16:50:45 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <1239adcb-fdce-264b-a85e-a352e73e2b56@redhat.com> On 30/05/2017 12:50, Nick Clifton wrote: > When I applied this patch to the sources and ran the new test, I encountered > an internal compiler error: > > msp430-elf/gcc/xgcc [...] pr78818-auto-warn.c [...] > [...] > gcc/testsuite/gcc.target/msp430/pr78818-auto-warn.c: In function 'main': > > gcc/testsuite/gcc.target/msp430/pr78818-auto-warn.c:10:3: internal compiler error: in get, at cgraph.h:403 > > 0xd30d3b symtab_node::get(tree_node const*) > gcc/current/gcc/cgraph.h:400 > > 0xd30d3b decl_section_name(tree_node const*) > gcc/current/gcc/tree.c:700 > > 0xd9ff22 msp430_data_attr > gcc/current/gcc/config/msp430/msp430.c:1998 > > > It seems that there is a problem with calling the DECL_SECTION_NAME macro on the > line just before your new code. Are you able to reproduce this problem ? > Hi Nick, Apologies for the delay in replying. I have reproduced this issue with current trunk and on the gcc-7-branch, but it does not reproduce on the gcc-6-branch. The ICE isn't caused by my patch but the pr78818-auto-warn.c test does expose it. I've attached an additional patch to fix the ICE (0001*). The ICE was caused by a new gcc_checking_assert added in GCC7 that checks that "symtab_node" has been called on a sane object. Added some additional check in msp430.c:data_attr that prevent section names being looked up on variables that can't have a section. The 0002* patch has been updated as this also caused an ICE when running the test case for the same reason as above, which was exposed when the first ICE was fixed. I have tested these patches on trunk this time (previous testing was done on performed on gcc-6-branch only) and can confirm there are no regressions and the new tests build successfully. Ok for trunk and gcc-7-branch? Thanks, Jozef From 8a41a45f2f771ae540b16ec007ded499a9ed5244 Mon Sep 17 00:00:00 2001 From: Jozef Lawrynowicz Date: Mon, 5 Jun 2017 18:07:22 +0000 Subject: [PATCH 1/3] MSP430: Check if a variable can have a section before checking for a section name 2017-06-XX Jozef Lawrynowicz gcc/ * config/msp430/msp430.c (msp430_data_attr): Check that it's possible for a variable to have a section before checking if the section has a name. --- gcc/config/msp430/msp430.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gcc/config/msp430/msp430.c b/gcc/config/msp430/msp430.c index dd53dea..cdd765b 100644 --- a/gcc/config/msp430/msp430.c +++ b/gcc/config/msp430/msp430.c @@ -1995,8 +1995,10 @@ msp430_data_attr (tree * node, if (TREE_CODE (* node) != VAR_DECL) message = "%qE attribute only applies to variables"; - if (DECL_SECTION_NAME (* node)) - message = "%qE attribute cannot be applied to variables with specific sections"; + /* Check that it's possible for the variable to have a section. */ + if ((TREE_STATIC (* node) || DECL_EXTERNAL (* node) || in_lto_p) + && DECL_SECTION_NAME (* node)) + message = "%qE attribute cannot be applied to variables with specific sections"; /* If this var is thought to be common, then change this. Common variables are assigned to sections before the backend has a chance to process them. */