From patchwork Wed Dec 14 17:03:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Vieira X-Patchwork-Id: 705730 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 3tf2x51L4Fz9t0v for ; Thu, 15 Dec 2016 04:04:21 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="NtwZNzEO"; 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:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=K7/nS4girI/1SmRdDJQqvNpZbrgqAB4Hj7tfE+CpsacSJN7RvO jCGwAzvblRvXoLAaSOrv1IPolJwT2a1YOZsEHvfbDAPygpkumrNOLfA/sJSat4jI EEriznuPxuC/9xK7m9qiS+OqN+ZHt4HkmIwJE8ViqxfZJ+AuGQ6HrYFgg= 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:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=ZYZCMUTzXKdHDd82wLHCGaiRu3U=; b=NtwZNzEOgNKibv3ek5Hc 8FNq6asTw3VhDE7WHSTQHwGyJD1mlmo7oQ7Jmgf790dTwvEgFSHtBx9RrWxe0f3Y 8wg0oLRABoe2SGxtUQMAftKIjOUE0G0lufdXYTgR7pUiZ0q9fE5QXZTTDHdtgQ10 GZ7PmzLHcvjnrLMamsJEglg= Received: (qmail 19851 invoked by alias); 14 Dec 2016 17:04:10 -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 19836 invoked by uid 89); 14 Dec 2016 17:04:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.8 required=5.0 tests=BAYES_00, KAM_LOTSOFHASH, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: foss.arm.com Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 14 Dec 2016 17:03:59 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8E99FF; Wed, 14 Dec 2016 09:03:57 -0800 (PST) Received: from [10.2.206.251] (e107157-lin.cambridge.arm.com [10.2.206.251]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3FCEF3F45C for ; Wed, 14 Dec 2016 09:03:57 -0800 (PST) To: GCC Patches From: "Andre Vieira (lists)" Subject: [arm-embedded][committed] Fix backport of PR71607: no longer use TARGET_USE_BLOCKS_FOR_CONSTANT_P Message-ID: <58517B7B.4060409@arm.com> Date: Wed, 14 Dec 2016 17:03:55 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 X-IsSubscribed: yes Hi, During embedded-6-branch testing we discovered that the patch for PR71607, that I backported to embedded-6-branch, broke cortex-m0 due to the new implementation of TARGET_USE_BLOCKS_FOR_CONSTANT_P. What changed is that TARGET_USE_BLOCKS_FOR_CONSTANT_P did not used to be defined by ARM and thus it used the default implementation which always returned false. I read over that detail last time... The current implementation on embedded-6 returns false if arm_disable_literal_pool is true and true otherwise. As I said I had not expected this function to already be returning false to begin with. This does however mean that we do not (correctly?) use this target hook to control what goes into literal pools in text and what not. It also means we don't need to for -mslow-flash-data as and since it breaks cortex-m0 I will be removing it, reverting back to the default implementation. I will be changing the patch for trunk to reflect these findings, even though this did not show up during trunk testing. Tested with various arm-none-eabi configurations: -mcpu=cortex-m0/m3/m7 and -march=armv8-m.baseline. Cheers, Andre gcc/ChangeLog.arm: 2016-12-14 Andre Vieira * config/arm/arm.c (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Remove. (arm_use_blocks_for_constant_p): Remove. gcc/testsuite/ChangeLog.arm: 2016-12-14 Andre Vieira * gcc.target/arm/thumb2-slow-flash-data-3.c: Add extra scan. * gcc.target/arm/thumb2-slow-flash-data-5.c: Likewise. diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 323019896ac430fde645bd7e198c0a903be98d7d..a76c950c53dba315ea051cd451a64173025b89d9 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -308,7 +308,6 @@ static section *arm_function_section (tree, enum node_frequency, bool, bool); static bool arm_asm_elf_flags_numeric (unsigned int flags, unsigned int *num); static unsigned int arm_elf_section_type_flags (tree decl, const char *name, int reloc); -static bool arm_use_blocks_for_constant_p (machine_mode var, const_rtx x); /* Table of machine attributes. */ @@ -759,9 +758,6 @@ static const struct attribute_spec arm_attribute_table[] = #undef TARGET_SECTION_TYPE_FLAGS #define TARGET_SECTION_TYPE_FLAGS arm_elf_section_type_flags -#undef TARGET_USE_BLOCKS_FOR_CONSTANT_P -#define TARGET_USE_BLOCKS_FOR_CONSTANT_P arm_use_blocks_for_constant_p - struct gcc_target targetm = TARGET_INITIALIZER; /* Obstack for minipool constant handling. */ @@ -31605,15 +31601,4 @@ bool arm_coproc_ldc_stc_legitimate_address (rtx op) } return false; } - -/* Implements the TARGET_USE_BLOCKS_FOR_CONSTANT_P hook. - - If we have disabled the generation of constants inside a literal pool, then - this function returns false. Otherwise, return true. */ - -static bool -arm_use_blocks_for_constant_p (machine_mode /* var */, const_rtx /* x */) -{ - return !arm_disable_literal_pool; -} #include "gt-arm.h" diff --git a/gcc/testsuite/gcc.target/arm/thumb2-slow-flash-data-3.c b/gcc/testsuite/gcc.target/arm/thumb2-slow-flash-data-3.c index d25ba87413cb949e5e2162dbf4e695e205b01a34..f4c17c9fa855301d9d0290ca8ca4697fb416e3f7 100644 --- a/gcc/testsuite/gcc.target/arm/thumb2-slow-flash-data-3.c +++ b/gcc/testsuite/gcc.target/arm/thumb2-slow-flash-data-3.c @@ -22,3 +22,5 @@ fn3 () a[1] = b; fn1 (a); } + +/* { dg-final { scan-assembler-not "\\.(float|l\\?double|\d?byte|short|int|long|quad|word)\\s+\[^.\]" } } */ diff --git a/gcc/testsuite/gcc.target/arm/thumb2-slow-flash-data-5.c b/gcc/testsuite/gcc.target/arm/thumb2-slow-flash-data-5.c index 7d1b2384738c7f495be257a46e6587bf43b6534a..9cc2539b31d3c01516e2b3c102b58e111627d254 100644 --- a/gcc/testsuite/gcc.target/arm/thumb2-slow-flash-data-5.c +++ b/gcc/testsuite/gcc.target/arm/thumb2-slow-flash-data-5.c @@ -12,3 +12,4 @@ foo (void) } /* { dg-final { scan-assembler-not "#1\\.0e\\+0" } } */ +/* { dg-final { scan-assembler-not "\\.(float|l\\?double|\d?byte|short|int|long|quad|word)\\s+\[^.\]" } } */