-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spirit Classic Codegen Bug with GCC in Release Builds #737
Comments
Thanks for a reproducer, but I don't think I can offer any help beyond telling that it seems to be fixed in GCC 12.2, what you most likely already know? I poked the reproducer in CE and affected GCC versions are 9.2-12.1, and it is also vanishes when sanitization is enabled. I can report to GCC on your behalf that they had and issue which might be fixed by accident. |
Is there a workaround possible on Boost.Spirit side? Or QuickBook? |
Massaging the parser helps avoid the bug for reproducer, so might be done something to Quickbook too https://godbolt.org/z/oGeqrP937 |
gcc 9.2 through 12.1 has a code generation bug that result in incorrect link ids for some sections in the generated XML. This commit applies a workaround as suggested by Nikita Kniazev in: boostorg/spirit#737 (comment) Fixes boostorg#11.
gcc 9.2 through 12.1 has a code generation bug that result in incorrect link ids for some sections in the generated XML. This commit applies a workaround as suggested by Nikita Kniazev in: boostorg/spirit#737 (comment) Fixes boostorg#11.
I've been working with @pdimov on some quickbook CI failures and I believe the cause of the issue is a codegen bug in gcc that seems to manifest in Spirit Classic. Namely, section IDs aren't being correctly produced when the qbk file contains:
More can be seen here: https://github.com/boostorg/quickbook/actions/runs/3046704503
This seems to be because of a codegen bug caused by certain versions of gcc (seemingly 9 through 12.1) with
-O2
and higher.I can replicate the issue here: https://godbolt.org/z/oa5b6j6Pd
Under
-O1
and lower, the output is:but with
-O2
and higher,This is incorrect and is what is causing quickbook to generate incorrect output, which causes the test to fail.
I know that Classic is likely not under maintenance anymore but because quickbook is such an integral part of Boost and its toolchain, this might be worth fixing.
Let me know if any more information is required! The code in the Compiler Explorer example is a close copy-paste of the code used by quickbook today but can probably be simplified.
The text was updated successfully, but these errors were encountered: