public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/104117] [9,10  Regression] Darwin ppc64 uses invalid non-PIC address to access constants (in PIC code).
Date: Sun, 29 May 2022 19:12:56 +0000	[thread overview]
Message-ID: <bug-104117-4-sg8J2CAUpw@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-104117-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104117

--- Comment #27 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Iain D Sandoe
<iains@gcc.gnu.org>:

https://gcc.gnu.org/g:cfad91385ae0f92eedda1fff5f6f4b23da9f1f1b

commit r10-10796-gcfad91385ae0f92eedda1fff5f6f4b23da9f1f1b
Author: Iain Sandoe <iain@sandoe.co.uk>
Date:   Mon Feb 7 15:36:35 2022 +0000

    Darwin, rs6000: Amend lo_sum use for forced constants [PR104117].

    Two issues resulted in this PR, which manifests when we force a constant
into
    memory in LRA (in PIC code on Darwin).  The presence of such forced
constants
    is quite dependent on other RTL optimisations, and it is easy for the issue
to
    become latent for a specific case.

    First, in the Darwin-specific rs6000 backend code, we were not being
careful
    enough in rejecting invalid symbolic addresses.  Specifically, when
generating
    PIC code, we require a SYMBOL_REF to be wrapped in an
UNSPEC_MACHOPIC_OFFSET.

    We now split the Darwin high/low selectors into two:
     1. One that handles non-PIC addresses (kernel mode, mdynamic-no-pic).
     2. One that handles PIC addresses and rejects SYMBOL_REFs unless they are
        suitably wrapped in the MACHOPIC_OFFSET unspec.

    The second case is handled by providing a new predicate (macho_pic_address)
    that checks the requirements.

    Backported from 4c3792d448964f7bd99e7eac2c29c9eb7c2bfb84 and
    f1b3e3853329b58fb2e50c17487df2ecbc4a5608

    Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
    Co-authored-by: Vladimir Makarov <vmakarov@redhat.com>

            PR target/104117

    gcc/ChangeLog:

            * config/rs6000/rs6000.c (darwin_rs6000_legitimate_lo_sum_const_p):
            Check for UNSPEC_MACHOPIC_OFFSET wrappers on symbolic addresses
when
            emitting PIC code.
            (legitimate_lo_sum_address_p): Likewise.
            (rs6000_legitimize_address): Do not apply the TLS processing to
            Darwin.
            * config/rs6000/darwin.md (@machopic_high_<mode>): New.
            (@machopic_low_<mode>): New.
            * config/rs6000/predicates.md (macho_pic_address): New.

  parent reply	other threads:[~2022-05-29 19:12 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-19 14:35 [Bug target/104117] New: gcc10 fails to build icu for ppc64 on 10.5.8 (direct access to a floating-point constant) vital.had at gmail dot com
2022-01-19 14:58 ` [Bug target/104117] " iains at gcc dot gnu.org
2022-01-19 15:01 ` iains at gcc dot gnu.org
2022-01-19 15:54 ` vital.had at gmail dot com
2022-01-20  7:36 ` rguenth at gcc dot gnu.org
2022-01-20  7:45 ` iains at gcc dot gnu.org
2022-01-20  8:38 ` iains at gcc dot gnu.org
2022-01-20 14:29 ` [Bug target/104117] [9,10,11,12 Regression] Darwin ppc64 uses invalid non-PIC address to access constants (in PIC code) iains at gcc dot gnu.org
2022-01-20 14:31 ` iains at gcc dot gnu.org
2022-01-20 14:33 ` iains at gcc dot gnu.org
2022-01-20 14:37 ` iains at gcc dot gnu.org
2022-01-20 15:23 ` iains at gcc dot gnu.org
2022-01-22  9:34 ` vital.had at gmail dot com
2022-02-04 22:05 ` vmakarov at gcc dot gnu.org
2022-02-05  8:06 ` vital.had at gmail dot com
2022-02-06 10:34 ` iains at gcc dot gnu.org
2022-02-06 10:36 ` iains at gcc dot gnu.org
2022-02-06 11:54 ` iains at gcc dot gnu.org
2022-02-06 12:22 ` vital.had at gmail dot com
2022-02-06 13:23 ` iains at gcc dot gnu.org
2022-02-06 15:46 ` iains at gcc dot gnu.org
2022-02-09 15:56 ` vmakarov at gcc dot gnu.org
2022-02-11  2:21 ` vital.had at gmail dot com
2022-02-11 23:52 ` cvs-commit at gcc dot gnu.org
2022-02-13 19:37 ` iains at gcc dot gnu.org
2022-03-04 15:07 ` cvs-commit at gcc dot gnu.org
2022-04-14  5:28 ` cvs-commit at gcc dot gnu.org
2022-05-29 19:12 ` cvs-commit at gcc dot gnu.org [this message]
2022-05-29 19:24 ` [Bug target/104117] [9,10 " iains at gcc dot gnu.org

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=bug-104117-4-sg8J2CAUpw@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).