public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/110320] New: ELFv2 pc-rel ABI extension allows using r2 as a volatile register
@ 2023-06-20 13:40 bergner at gcc dot gnu.org
  2023-06-20 13:42 ` [Bug target/110320] " bergner at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: bergner at gcc dot gnu.org @ 2023-06-20 13:40 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 110320
           Summary: ELFv2 pc-rel ABI extension allows using r2 as a
                    volatile register
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bergner at gcc dot gnu.org
  Target Milestone: ---

The PC-Relative ABI extension to the ELFv2 ABI defines register r2 (normally
the TOC register in ELFv1 & ELFv2) as a volatile register available for use in
the register allocator.  Currently GCC doesn't make use of that fact, so this
is a missed-optimization opportunity.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug target/110320] ELFv2 pc-rel ABI extension allows using r2 as a volatile register
  2023-06-20 13:40 [Bug target/110320] New: ELFv2 pc-rel ABI extension allows using r2 as a volatile register bergner at gcc dot gnu.org
@ 2023-06-20 13:42 ` bergner at gcc dot gnu.org
  2023-12-25 10:13 ` cvs-commit at gcc dot gnu.org
  2024-02-27 15:28 ` jeevitha at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: bergner at gcc dot gnu.org @ 2023-06-20 13:42 UTC (permalink / raw)
  To: gcc-bugs

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

Peter Bergner <bergner at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |jeevitha at gcc dot gnu.org
           Keywords|                            |missed-optimization
   Last reconfirmed|                            |2023-06-20
             Target|                            |powerpc64le-linux
                 CC|                            |dje at gcc dot gnu.org,
                   |                            |meissner at gcc dot gnu.org,
                   |                            |segher at gcc dot gnu.org
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |ASSIGNED

--- Comment #1 from Peter Bergner <bergner at gcc dot gnu.org> ---
Jeevitha is working on a patch to support this.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug target/110320] ELFv2 pc-rel ABI extension allows using r2 as a volatile register
  2023-06-20 13:40 [Bug target/110320] New: ELFv2 pc-rel ABI extension allows using r2 as a volatile register bergner at gcc dot gnu.org
  2023-06-20 13:42 ` [Bug target/110320] " bergner at gcc dot gnu.org
@ 2023-12-25 10:13 ` cvs-commit at gcc dot gnu.org
  2024-02-27 15:28 ` jeevitha at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-12-25 10:13 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by jeevitha <jeevitha@gcc.gnu.org>:

https://gcc.gnu.org/g:1bbb169fe6f91451a2754f0b86301551db76ceba

commit r14-6829-g1bbb169fe6f91451a2754f0b86301551db76ceba
Author: Jeevitha <jeevitha@linux.ibm.com>
Date:   Mon Dec 25 04:06:54 2023 -0600

    rs6000: Change GPR2 to volatile & non-fixed register for function that does
not use TOC [PR110320]

    Normally, GPR2 is the TOC pointer and is defined as a fixed and
non-volatile
    register. However, it can be used as volatile for PCREL addressing.
Therefore,
    modified r2 to be non-fixed in FIXED_REGISTERS and set it to fixed if it is
not
    PCREL and also when the user explicitly requests TOC or fixed. If the
register
    r2 is fixed, it is made as non-volatile. Changes in register preservation
roles
    can be accomplished with the help of available target hooks
    (TARGET_CONDITIONAL_REGISTER_USAGE).

    2023-12-24  Jeevitha Palanisamy  <jeevitha@linux.ibm.com>

    gcc/
            PR target/110320
            * config/rs6000/rs6000.cc (rs6000_conditional_register_usage):
Change
            GPR2 to volatile and non-fixed register for PCREL.
            * config/rs6000/rs6000.h (FIXED_REGISTERS): Modify GPR2 to not
fixed.

    gcc/testsuite/
            PR target/110320
            * gcc.target/powerpc/pr110320-1.c: New testcase.
            * gcc.target/powerpc/pr110320-2.c: New testcase.
            * gcc.target/powerpc/pr110320-3.c: New testcase.

    Co-authored-by: Peter Bergner <bergner@linux.ibm.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug target/110320] ELFv2 pc-rel ABI extension allows using r2 as a volatile register
  2023-06-20 13:40 [Bug target/110320] New: ELFv2 pc-rel ABI extension allows using r2 as a volatile register bergner at gcc dot gnu.org
  2023-06-20 13:42 ` [Bug target/110320] " bergner at gcc dot gnu.org
  2023-12-25 10:13 ` cvs-commit at gcc dot gnu.org
@ 2024-02-27 15:28 ` jeevitha at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: jeevitha at gcc dot gnu.org @ 2024-02-27 15:28 UTC (permalink / raw)
  To: gcc-bugs

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

Jeevitha <jeevitha at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #3 from Jeevitha <jeevitha at gcc dot gnu.org> ---
Fixed

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-02-27 15:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-20 13:40 [Bug target/110320] New: ELFv2 pc-rel ABI extension allows using r2 as a volatile register bergner at gcc dot gnu.org
2023-06-20 13:42 ` [Bug target/110320] " bergner at gcc dot gnu.org
2023-12-25 10:13 ` cvs-commit at gcc dot gnu.org
2024-02-27 15:28 ` jeevitha at gcc dot gnu.org

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).