public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: David Edelsohn <dje.gcc@gmail.com>
To: GCC Patches <gcc-patches@gcc.gnu.org>, Alan Modra <amodra@gmail.com>
Subject: Re: [RS6000] pr65810, powerpc64 alignment of r2
Date: Mon, 27 Apr 2015 21:11:00 -0000	[thread overview]
Message-ID: <CAGWvnymQP2-xnNsVgY3xB1Fyj86ARpQ8CZqT3xQez9wfPdH9+w@mail.gmail.com> (raw)
In-Reply-To: <20150423112443.GP12627@bubble.grove.modra.org>

On Thu, Apr 23, 2015 at 7:24 AM, Alan Modra <amodra@gmail.com> 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

      reply	other threads:[~2015-04-27 21:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-20 13:53 Alan Modra
2015-04-20 14:27 ` Jakub Jelinek
2015-04-20 17:11 ` David Edelsohn
2015-04-20 22:32   ` Alan Modra
2015-04-23 11:24     ` Alan Modra
2015-04-27 21:11       ` David Edelsohn [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAGWvnymQP2-xnNsVgY3xB1Fyj86ARpQ8CZqT3xQez9wfPdH9+w@mail.gmail.com \
    --to=dje.gcc@gmail.com \
    --cc=amodra@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).