Bug 115633 - [15 Regression] powerpc64le: "relocation truncated to fit: R_PPC64_TOC16 against `.rodata.cst4'" with (default) '-flate-combine-instructions' since r15-1579-g792f97b44ffc5e6a967292b3747fd835e99396e7
Summary: [15 Regression] powerpc64le: "relocation truncated to fit: R_PPC64_TOC16 agai...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 15.0
: P3 normal
Target Milestone: 15.0
Assignee: Thomas Schwinge
URL:
Keywords: testsuite-fail
Depends on:
Blocks:
 
Reported: 2024-06-25 08:27 UTC by Thomas Schwinge
Modified: 2024-06-25 10:12 UTC (History)
3 users (show)

See Also:
Host:
Target: powerpc64le-unknown-linux-gnu
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Schwinge 2024-06-25 08:27:14 UTC
With commit r15-1579-g792f97b44ffc5e6a967292b3747fd835e99396e7 "Add a late-combine pass [PR106594]", I see on powerpc64le-unknown-linux-gnu a number of "relocation truncated to fit: R_PPC64_TOC16 against `.rodata.cst4'" etc. with (default) '-flate-combine-instructions':

    [-PASS:-]{+FAIL:+} gcc.dg/pr91734.c (test for excess errors)
    [-PASS:-]{+UNRESOLVED:+} gcc.dg/pr91734.c [-execution test-]{+compilation failed to produce executable+}

    /tmp/ccOWP7Yx.o: in function `f2':
    pr91734.c:(.text+0x38): relocation truncated to fit: R_PPC64_TOC16 against `.rodata.cst4'
    /tmp/ccOWP7Yx.o: in function `f3':
    pr91734.c:(.text+0x68): relocation truncated to fit: R_PPC64_TOC16 against `.rodata.cst4'
    /tmp/ccOWP7Yx.o: in function `f4':
    pr91734.c:(.text+0x98): relocation truncated to fit: R_PPC64_TOC16 against `.rodata.cst4'+4
    /tmp/ccOWP7Yx.o: in function `f5':
    pr91734.c:(.text+0xc8): relocation truncated to fit: R_PPC64_TOC16 against `.rodata.cst4'+8
    /tmp/ccOWP7Yx.o: in function `f6':
    pr91734.c:(.text+0xf8): relocation truncated to fit: R_PPC64_TOC16 against `.rodata.cst4'+c
    /tmp/ccOWP7Yx.o: in function `f7':
    pr91734.c:(.text+0x128): relocation truncated to fit: R_PPC64_TOC16 against `.rodata.cst4'+10
    /tmp/ccOWP7Yx.o: in function `f8':
    pr91734.c:(.text+0x158): relocation truncated to fit: R_PPC64_TOC16 against `.rodata.cst4'+14
    /tmp/ccOWP7Yx.o: in function `f9':
    pr91734.c:(.text+0x188): relocation truncated to fit: R_PPC64_TOC16 against `.rodata.cst4'+18
    /tmp/ccOWP7Yx.o: in function `f10':
    pr91734.c:(.text+0x1b8): relocation truncated to fit: R_PPC64_TOC16 against `.rodata.cst4'+1c
    collect2: error: ld returned 1 exit status

This is with the Debian GNU/Linux 12 (bookworm) binutils 2.40-2 package.  (..., in case that's where the problem is...)

Similarly:

    [-PASS:-]{+FAIL:+} gcc.dg/sinatan-1.c (test for excess errors)
    [-PASS:-]{+UNRESOLVED:+} gcc.dg/sinatan-1.c [-execution test-]{+compilation failed to produce executable+}

    [-PASS:-]{+FAIL:+} gcc.dg/ipa/inline-8.c (test for excess errors)
    [-PASS:-]{+UNRESOLVED:+} gcc.dg/ipa/inline-8.c [-execution test-]{+compilation failed to produce executable+}

..., and (roughly) all 'gcc.dg/vect/tsvc/[...]' test cases that don't use '-flto'.

                    === gcc Summary ===
    
    # of expected passes            [-179982-]{+179673+}
    # of unexpected failures        [-127-]{+282+}
    # of unexpected successes       20
    # of expected failures          1612
    {+# of unresolved testcases     154+}
    # of unsupported tests          4394

Additionally:

    [-PASS:-]{+FAIL:+} libgomp.c/simd-math-1.c (test for excess errors)
    [-PASS:-]{+UNRESOLVED:+} libgomp.c/simd-math-1.c [-execution test-]{+compilation failed to produce executable+}


I see a number of recent <gcc-testresults@gcc.gnu.org> emails by Bill Seurer that contain a similar set of new FAILs, so putting you in CC here.
Comment 1 Sam James 2024-06-25 08:28:42 UTC
I thought it wasn't supposed to be default on powerpc? (PR115612)
Comment 2 Richard Sandiford 2024-06-25 08:29:15 UTC
-flate-combine-instructions is supposed to be disabled by default for all powerpc targets.  Could you look at why that isn't the case for you?
Comment 3 GCC Commits 2024-06-25 09:49:17 UTC
The trunk branch has been updated by Thomas Schwinge <tschwinge@gcc.gnu.org>:

https://gcc.gnu.org/g:70480055636c2ca79761cb4440e930daa16bb7aa

commit r15-1607-g70480055636c2ca79761cb4440e930daa16bb7aa
Author: Thomas Schwinge <tschwinge@baylibre.com>
Date:   Tue Jun 25 10:55:41 2024 +0200

    rs6000: Properly default-disable late-combine passes [PR106594, PR115622, PR115633]
    
    ..., so that it also works for '__attribute__ ((optimize("[...]")))' etc.
    
            PR target/106594
            PR target/115622
            PR target/115633
            gcc/
            * config/rs6000/rs6000.cc (rs6000_option_override_internal): Move
            default-disable of late-combine passes from here...
            (rs6000_override_options_after_change): ... to here.
Comment 4 Thomas Schwinge 2024-06-25 10:12:43 UTC
Fixed.