From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 119194 invoked by alias); 1 Oct 2015 14:05:15 -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 119173 invoked by uid 89); 1 Oct 2015 14:05:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ig0-f178.google.com Received: from mail-ig0-f178.google.com (HELO mail-ig0-f178.google.com) (209.85.213.178) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 01 Oct 2015 14:05:13 +0000 Received: by igbkq10 with SMTP id kq10so18934883igb.0 for ; Thu, 01 Oct 2015 07:05:11 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.50.136.129 with SMTP id qa1mr3735926igb.91.1443708310826; Thu, 01 Oct 2015 07:05:10 -0700 (PDT) Received: by 10.36.133.5 with HTTP; Thu, 1 Oct 2015 07:05:10 -0700 (PDT) In-Reply-To: References: Date: Thu, 01 Oct 2015 14:05:00 -0000 Message-ID: Subject: Re: [PATCH] rs6000: Add "cannot_copy" attribute, use it (PR67788, PR67789) From: David Edelsohn To: Segher Boessenkool Cc: GCC Patches Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2015-10/txt/msg00071.txt.bz2 On Thu, Oct 1, 2015 at 2:08 AM, Segher Boessenkool wrote: > After the shrink-wrapping patches the prologue will often be pushed > "deeper" into the function, which in turn means the software trace cache > pass will more often want to duplicate the basic block containing the > prologue. This caused failures for 32-bit SVR4 with -msecure-plt PIC. > > This configuration uses the load_toc_v4_PIC_1 instruction, which creates > assembler labels without using the normal machinery for that. If now > the compiler decides to duplicate the insn, it will emit the same label > twice. Boom. > > It isn't so easy to fix this to use labels the compiler knows about (let > alone test that properly). Instead, this patch wires up a "cannot_copy" > attribute to be used by TARGET_CANNOT_COPY_P, and sets that attribute on > these insns we do not want copied. > > Bootstrapped and tested on powerpc64-linux, with the usual configurations > (-m32,-m32/-mpowerpc64,-m64,-m64/-mlra); new testcase fails before, works > after (on 32-bit). > > Is this okay for mainline? > > > Segher > > > 2015-09-30 Segher Boessenkool > > PR target/67788 > PR target/67789 > * config/rs6000/rs6000.c (TARGET_CANNOT_COPY_INSN_P): New. > (rs6000_cannot_copy_insn_p): New function. > * config/rs6000/rs6000.md (cannot_copy): New attribute. > (load_toc_v4_PIC_1_normal): Set cannot_copy. > (load_toc_v4_PIC_1_476): Ditto. > > gcc/testsuite/ > PR target/67788 > PR target/67789 > * gcc.target/powerpc/pr67789.c: New testcase. Bernd mentions that this is the normal way of handling this problem, so okay. Thanks, David