Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 916455 - app-text/lcdf-typetools-2.108-r1: ICE on static-var pass with LTO and -fdevirtualize-at-ltrans at -O3
Summary: app-text/lcdf-typetools-2.108-r1: ICE on static-var pass with LTO and -fdevir...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Alexis Ballier
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: lto
  Show dependency tree
 
Reported: 2023-10-28 21:22 UTC by neeshy
Modified: 2024-03-12 01:55 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
lcdf-typetools-2.108-r1-build.log (build.log,20.98 KB, text/x-log)
2023-10-28 21:23 UTC, neeshy
Details

Note You need to log in before you can comment on or make changes to this bug.
Description neeshy 2023-10-28 21:22:25 UTC
ICE is observed when CFLAGS and CXXFLAGS are set to: -O3 -pipe -flto=auto -fdevirtualize-at-ltrans

Reproducible: Always

Steps to Reproduce:
Run:

CFLAGS="-O3 -pipe -flto=auto -fdevirtualize-at-ltrans" CXXFLAGS="-O3 -pipe -flto=auto -fdevirtualize-at-ltrans" emerge -1 app-text/lcdf-typetools
Actual Results:  
Here's the relevant output from the build log:

during IPA pass: static-var
lto1: internal compiler error: Segmentation fault
during IPA pass: static-var
lto1: internal compiler error: Segmentation fault
0x120f469 internal_error(char const*, ...)
        ???:0
0x1364950 lto_output()
        ???:0
0x1a63942 ipa_write_optimization_summaries(lto_symtab_encoder_d*)
        ???:0
0x1a3ac26 lto_main()
        ???:0
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: g++ returned 1 exit status
compilation terminated.
0x120f469 internal_error(char const*, ...)
        ???:0
0x136a5fc output_symtab()
        ???:0
0x1364495 lto_output()
        ???:0
0x1a63942 ipa_write_optimization_summaries(lto_symtab_encoder_d*)
        ???:0
0x1a3ac74 lto_main()
        ???:0
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.
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status


The ICE seems to be dependent on the optimization level. -O2 compiles fine.

I would submit this bug to GCC's bugtracker, but they've restricted account creation. Maybe someone who already has an account could submit the bug for me.
Comment 1 neeshy 2023-10-28 21:23:14 UTC
Created attachment 873623 [details]
lcdf-typetools-2.108-r1-build.log
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-10-28 21:47:08 UTC
Thanks.

I added this filter earlier today;

commit b465fdbfa7432627d207a6305b63cac882120c86
Author: Sam James <sam@gentoo.org>
Date:   Sat Oct 28 08:07:38 2023 +0100

    app-text/lcdf-typetools: avoid known GCC ICE with -fdevirtualize-at-ltrans

    Bug: https://gcc.gnu.org/PR100010
    Signed-off-by: Sam James <sam@gentoo.org>
Comment 3 Alfred Wingate 2023-10-28 21:51:43 UTC
To reproduce you also need to have the flags in LDFLAGS, otherwise I cannot reproduce.

CFLAGS="-O3 -pipe -flto=auto -fdevirtualize-at-ltrans"
CXXFLAGS="-O3 -pipe -flto=auto -fdevirtualize-at-ltrans"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -O3 -pipe -flto=auto -fdevirtualize-at-ltrans"