public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "sjames at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug lto/113204] lto1: error: qsort comparator non-negative on sorted output: 64
Date: Sat, 16 Mar 2024 04:37:43 +0000	[thread overview]
Message-ID: <bug-113204-4-EP4AvAEm8Y@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-113204-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #7 from Sam James <sjames at gcc dot gnu.org> ---
With some finagling:

```
/tmp/go-PR113204 $ ./run.sh
+ gcc -o test -Wl,--export-dynamic-symbol=_cgo_panic
-Wl,--export-dynamic-symbol=_cgo_topofstack
-Wl,--export-dynamic-symbol=crosscall2 -Wl,--export-dynamic-symbol=myadd
-Wl,--compress-debug-sections=zlib go.o 000000.o 000001.o 000002.o 000003.o
000004.o 000005.o 000006.o 000007.o 000008.o 000009.o 000010.o 000011.o
000012.o 000013.o 000014.o 000015.o 000016.o -O2 -g -O2 -g -lpthread
lto1: error: qsort comparator non-negative on sorted output: 64
during IPA pass: static-var
lto1: internal compiler error: qsort checking failed
0x56bcc8c9bcd6 qsort_chk_error
        /usr/src/debug/sys-devel/gcc-14.0.9999/gcc-14.0.9999/gcc/vec.cc:204
0x56bcc771fd4d qsort_chk(void*, unsigned long, unsigned long, int (*)(void
const*, void const*, void*), void*)
        /usr/src/debug/sys-devel/gcc-14.0.9999/gcc-14.0.9999/gcc/vec.cc:246
0x56bcc90bc457 gcc_sort_r(void*, unsigned long, unsigned long, int (*)(void
const*, void const*, void*), void*)
        /usr/src/debug/sys-devel/gcc-14.0.9999/gcc-14.0.9999/gcc/sort.cc:296
0x56bcc8eb09f4 vec<symtab_node*, va_heap, vl_embed>::sort(int (*)(void const*,
void const*, void*), void*)
        /usr/src/debug/sys-devel/gcc-14.0.9999/gcc-14.0.9999/gcc/vec.h:1232
0x56bcc8eb09f4 vec<symtab_node*, va_heap, vl_ptr>::sort(int (*)(void const*,
void const*, void*), void*)
        /usr/src/debug/sys-devel/gcc-14.0.9999/gcc-14.0.9999/gcc/vec.h:2252
0x56bcc8eb09f4 lto_output()
       
/usr/src/debug/sys-devel/gcc-14.0.9999/gcc-14.0.9999/gcc/lto-streamer-out.cc:2799
0x56bcc956e365 write_lto
        /usr/src/debug/sys-devel/gcc-14.0.9999/gcc-14.0.9999/gcc/passes.cc:2779
0x56bcc956ac9e ipa_write_optimization_summaries(lto_symtab_encoder_d*)
        /usr/src/debug/sys-devel/gcc-14.0.9999/gcc-14.0.9999/gcc/passes.cc:2969
0x56bcc9569f94 stream_out
        /usr/src/debug/sys-devel/gcc-14.0.9999/gcc-14.0.9999/gcc/lto/lto.cc:179
0x56bcc9569f94 stream_out_partitions_1
        /usr/src/debug/sys-devel/gcc-14.0.9999/gcc-14.0.9999/gcc/lto/lto.cc:231
0x56bcc9533d7a stream_out_partitions
        /usr/src/debug/sys-devel/gcc-14.0.9999/gcc-14.0.9999/gcc/lto/lto.cc:246
0x56bcc9533d7a lto_wpa_write_files
        /usr/src/debug/sys-devel/gcc-14.0.9999/gcc-14.0.9999/gcc/lto/lto.cc:419
0x56bcc9533d7a do_whole_program_analysis
        /usr/src/debug/sys-devel/gcc-14.0.9999/gcc-14.0.9999/gcc/lto/lto.cc:594
0x56bcc9533d7a lto_main()
        /usr/src/debug/sys-devel/gcc-14.0.9999/gcc-14.0.9999/gcc/lto/lto.cc:668
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://bugs.gentoo.org/> for instructions.
lto-wrapper: fatal error: gcc returned 1 exit status
compilation terminated.
/usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld:
error: lto-wrapper failed
collect2: error: ld returned 1 exit status
```

Tarball with just object files which reproduces it for me:
https://dev.gentoo.org/~sam/bugs/gcc/gcc-go-qsort/go-PR113204.tar.xz

  parent reply	other threads:[~2024-03-16  4:37 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-02 18:44 [Bug lto/113204] New: [14 Regression] " doko at gcc dot gnu.org
2024-01-02 18:51 ` [Bug lto/113204] " pinskia at gcc dot gnu.org
2024-01-06  6:15 ` pinskia at gcc dot gnu.org
2024-01-06  9:35 ` sjames at gcc dot gnu.org
2024-01-06  9:35 ` sjames at gcc dot gnu.org
2024-01-06  9:47 ` [Bug lto/113204] " pinskia at gcc dot gnu.org
2024-01-08 14:40 ` rguenth at gcc dot gnu.org
2024-02-02  7:27 ` xry111 at gcc dot gnu.org
2024-03-16  4:34 ` sjames at gcc dot gnu.org
2024-03-16  4:37 ` sjames at gcc dot gnu.org [this message]
2024-03-16  4:39 ` sjames 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-113204-4-EP4AvAEm8Y@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).