Open Bug 1817565 Opened 2 years ago Updated 2 years ago

gcc-12 fails to inline a couple of always_inline functions in mozilla/mfbt/lz4/xxhash.h when -Og is specified

Categories

(Core :: MFBT, enhancement)

x86_64
Linux
enhancement

Tracking

()

Tracking Status
firefox112 --- affected

People

(Reporter: ishikawa, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

I compile C-C Thunderbird under Debian GNU/Linux locally.

$ gcc-12 --version
gcc-12 (Debian 12.2.0-14) 12.2.0
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

With the option "-Og", gcc-12 fails to inline two functions that are declared with
XXX_FORCED_INLINE:
XXH3_accumulate_512_sse2(), and
XXH3_scrambleAcc_sse2()

I am attaching the error log.

Without "-Og", compilation succeeds.
gcc-10 and gcc-11 did not have the problem.

If I comment out XXX_FORCE_INLINE for these two functions, gcc-12 compilation succeeds with -Og.

Blocks: build-gcc-12

Looking at https://github.com/Perl/perl5/issues/19776,
I thought the issue may be triggered due to "-Og" AND "-g" on the same command line.
But no, even if I remove all "-g" options from the command line, gcc-12 still fails to inline the two always_inline functions when -Og is specified.

I think this problem is related to the issue discussed in the following GCC bugzilla.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107931

So I reported my problem there.
It sound as if there is no remedy.
We may have to disable |always_inline| when the compiler is GCC 12 and -Og is specified on the command line.

(In reply to Robert Longson [:longsonr] from comment #3)

maybe report it to https://github.com/Cyan4973/xxHash

Thank you. Will do.

(In reply to ISHIKAWA, Chiaki from comment #4)

(In reply to Robert Longson [:longsonr] from comment #3)

maybe report it to https://github.com/Cyan4973/xxHash

Thank you. Will do.

Reported to the github.
https://github.com/Cyan4973/xxHash/issues/800

I am now sure now if GCC-10 and GCC-11 really inlined the functions because the gcc bugzilla mentions that sometimes errors were/are not reported in GCC. Oh well.

But for my local debugging purpose, getting TB compiled with -Og is more important than inlining these functions.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: