From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 46518 invoked by alias); 27 Apr 2015 21:11:40 -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 46488 invoked by uid 89); 27 Apr 2015 21:11:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 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-f175.google.com Received: from mail-ig0-f175.google.com (HELO mail-ig0-f175.google.com) (209.85.213.175) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 27 Apr 2015 21:11:38 +0000 Received: by igbhj9 with SMTP id hj9so4907800igb.1 for ; Mon, 27 Apr 2015 14:11:36 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.43.97.130 with SMTP id ck2mr14448944icc.91.1430169096320; Mon, 27 Apr 2015 14:11:36 -0700 (PDT) Received: by 10.36.108.21 with HTTP; Mon, 27 Apr 2015 14:11:36 -0700 (PDT) In-Reply-To: <20150423112443.GP12627@bubble.grove.modra.org> References: <20150420135317.GE12627@bubble.grove.modra.org> <20150420223232.GF12627@bubble.grove.modra.org> <20150423112443.GP12627@bubble.grove.modra.org> Date: Mon, 27 Apr 2015 21:11:00 -0000 Message-ID: Subject: Re: [RS6000] pr65810, powerpc64 alignment of r2 From: David Edelsohn To: GCC Patches , Alan Modra Content-Type: text/plain; charset=ISO-8859-1 X-SW-Source: 2015-04/txt/msg01684.txt.bz2 On Thu, Apr 23, 2015 at 7:24 AM, Alan Modra wrote: > Revised patch, supporting linker that aligns the toc base. > > This fixes a thinko in offsettable_ok_by_alignment. It's not the > absolute placement that matters, but the toc-pointer relative offset. > So alignment of r2 also needs to be taken into account. > > Changing offsettable_ok_by_alignment has a ripple effect into the 'm' > constraint so we also need to ensure rs6000_legitimize_reload_address > does not create invalid toc-relative addresses. As found by > gcc.dg/torture/builtin-math-2.c -Os. That's the reason for the > use_toc_relative_ref change. I hope the size check along with > reg_offset_p is sufficient here. It seems so, but it's difficult to > be certain due to how hard it is to get just the right combination of > reload conditions to trigger. > > Bootstrapped and regression tested powerpc64-linux and > powerpc64le-linux, both with a new and old linker. OK for mainline? > > PR target/65810 > * config/rs6000/rs6000.c (POWERPC64_TOC_POINTER_ALIGNMENT): Define. > (offsettable_ok_by_alignment): Use minimum of decl and toc > pointer alignment. Replace dead code with assertion. > (use_toc_relative_ref): Add mode arg. Return false in -mcmodel=medium > case if size exceeds toc pointer alignment. > (rs6000_legitimize_reload_address): Update use_toc_relative_ref call. > (rs6000_emit_move): Likewise. > * configure.ac: Add linker toc pointer alignment check. > * configure: Regenerate. > * config.in: Regenerate. Okay. Thanks, David