From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 65968 invoked by alias); 2 Oct 2015 01:30:07 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 65697 invoked by uid 55); 2 Oct 2015 01:29:59 -0000 From: "segher at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/67788] [6 Regression] bootstrap failure in libgfortran on powerpc-linux-gnu Date: Fri, 02 Oct 2015 01:30:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 6.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: segher at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: segher at gcc dot gnu.org X-Bugzilla-Target-Milestone: 6.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-10/txt/msg00129.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67788 --- Comment #6 from Segher Boessenkool --- Author: segher Date: Fri Oct 2 01:29:26 2015 New Revision: 228366 URL: https://gcc.gnu.org/viewcvs?rev=228366&root=gcc&view=rev Log: rs6000: Add "cannot_copy" attribute, use it (PR67788, PR67789) 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. 2015-10-01 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. Added: trunk/gcc/testsuite/gcc.target/powerpc/pr67789.c Modified: trunk/gcc/ChangeLog trunk/gcc/config/rs6000/rs6000.c trunk/gcc/config/rs6000/rs6000.md trunk/gcc/testsuite/ChangeLog