From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CB24D3857C44; Mon, 10 Jul 2023 08:24:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CB24D3857C44 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1688977444; bh=+GBN5vOjleyecuD85b8Ctu5cqfc0qdqocxcgtspgfC4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=lgsJ5NF5EMJjY+h6xuYYFBhSQvfDCpWx/3Qzmd2vl8o2FcM56VTRzWnSC+2q92Psx jznQ3Lwj8NADnF9zLH7rgCHwqp6kdf8PUWQD9O50lo8uWdaReQ7yjudfZMEAVpontn 0O0IP/77uWw9UQm+VUY/Dmy1hDNErgd/ru27dcFU= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/110334] [13/14 Regresssion] unused functions not eliminated before LTO streaming Date: Mon, 10 Jul 2023 08:24:00 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ipa X-Bugzilla-Version: 13.1.1 X-Bugzilla-Keywords: lto, missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.2 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D110334 --- Comment #20 from Richard Biener --- (In reply to Richard Biener from comment #19) > It seems that the C++ FE change in comment#13 causes libreoffice to fail = to > build with >=20 > [ 553s] > /home/abuild/rpmbuild/BUILD/libreoffice-7.5.4.2/workdir/UnpackedTarball/s= kia/ > include/private/SkVx.h: In function 'interpret_skvm': > [ 553s] > /home/abuild/rpmbuild/BUILD/libreoffice-7.5.4.2/workdir/UnpackedTarball/s= kia/ > include/private/SkVx.h:150: error: inlining failed in call to > 'always_inline' '__ct_comp ': target specific option mismatch > [ 553s] 150 | using VecStorage::VecStorage; > [ 553s] |=20 >=20 > I have yet to reproduce and extract a testcase though. libreoffice has a skia import and links its Library/libskialo.so library with LTO, combining the AVX, HSW, SSE41, SSE42, SSSE3, CRC32, SKX, ... SkOpts_*.o objects which likely follow a very similar scheme as the firefox copy. SkOpts_hsw.cpp looks like #include "src/core/SkOpts.h" #define SK_OPTS_NS hsw #include "src/core/SkCubicSolver.h" #include "src/opts/SkBitmapProcState_opts.h" #include "src/opts/SkBlitRow_opts.h" #include "src/opts/SkRasterPipeline_opts.h" #include "src/opts/SkSwizzler_opts.h" #include "src/opts/SkUtils_opts.h" #include "src/opts/SkVM_opts.h" namespace SkOpts { void Init_hsw() { blit_row_color32 =3D hsw::blit_row_color32; blit_row_s32a_opaque =3D hsw::blit_row_s32a_opaque; S32_alpha_D32_filter_DX =3D hsw::S32_alpha_D32_filter_DX; cubic_solver =3D SK_OPTS_NS::cubic_solver; RGBA_to_BGRA =3D SK_OPTS_NS::RGBA_to_BGRA; RGBA_to_rgbA =3D SK_OPTS_NS::RGBA_to_rgbA; RGBA_to_bgrA =3D SK_OPTS_NS::RGBA_to_bgrA; gray_to_RGB1 =3D SK_OPTS_NS::gray_to_RGB1; grayA_to_RGBA =3D SK_OPTS_NS::grayA_to_RGBA; grayA_to_rgbA =3D SK_OPTS_NS::grayA_to_rgbA; inverted_CMYK_to_RGB1 =3D SK_OPTS_NS::inverted_CMYK_to_RGB1; inverted_CMYK_to_BGR1 =3D SK_OPTS_NS::inverted_CMYK_to_BGR1; #define M(st) stages_highp[SkRasterPipeline::st] =3D (StageFn)SK_OPTS_N= S::st; SK_RASTER_PIPELINE_STAGES(M) just_return_highp =3D (StageFn)SK_OPTS_NS::just_return; start_pipeline_highp =3D SK_OPTS_NS::start_pipeline; #undef M #define M(st) stages_lowp[SkRasterPipeline::st] =3D (StageFn)SK_OPTS_NS::lowp::st; SK_RASTER_PIPELINE_STAGES(M) just_return_lowp =3D (StageFn)SK_OPTS_NS::lowp::just_return; start_pipeline_lowp =3D SK_OPTS_NS::lowp::start_pipeline; #undef M interpret_skvm =3D SK_OPTS_NS::interpret_skvm; } } // namespace SkOpts the question in the end is why we fail to process the always_inlines early here and only discover them late. Unfortunately the inline diagnostic doesn't print the original TU name (that would be useful for all late LTO diagnostics). I'm not sure whether this is an issue with the C++ frontend change or with the ODR issues present in Skia. Eventually since we're dealing with aliases(?), always_inline isn't appropriately detected or still missing on some callees. Unfortunately there isn't a knob to diagnose late inlined always-inline functions.=