[Bug target/120681] PowerPC GCC turns off pc-relative addressing on power10 when -mcmodel=large is used

"cvs-commit at gcc dot gnu.org via Gcc-bugs" <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120681

--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Michael Meissner <[email protected]>:

https://gcc.gnu.org/g:40691e7dd66bcf01fe476e6fd946225fd6f97540

commit r17-3141-g40691e7dd66bcf01fe476e6fd946225fd6f97540
Author: Michael Meissner <[email protected]>
Date:   Fri Aug 7 15:17:03 2026 -0400

    PR target/120681 - allow -mcmodel=large with PC relative addressing

    When I implemented the pc-relative support for power10 in GCC, I
    disabled using pc-relative support for -mcmodel=large.  At the time, I
    didn't want to dig into the issues.  It is now time to allow
    -mcmodel=large to generate pc-relative code.

    This patch allows -mcmodel=large to use prefixed addressing on power10,
    power11, and possibly other future PowerPC processors in addition to
    the current -mcmodel=medium support.

    2026-08-07  Michael Meissner  <[email protected]>

    gcc/

            PR target/120681
            * config/rs6000/linux64.h (PCREL_SUPPORTED_BY_OS): Allow large
            code model as well as medium code model.
            * config/rs6000/rs6000.cc (rs6000_option_override_internal):
            Likewise.
            (rs6000_elf_declare_function_name): Don't create the
            local/non-local labels for large code model if we are using
            PC-relative addressing.

    gcc/testsuite/

            PR target/120681
            * gcc.target/powerpc/pr120681.c: New test.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.