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

--- Comment #21 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Nathaniel Shead <nsh...@gcc.gnu.org>:

https://gcc.gnu.org/g:643c5b42e21dbc02e9bde01865c880b26aa5f938

commit r16-2699-g643c5b42e21dbc02e9bde01865c880b26aa5f938
Author: Nathaniel Shead <nathanielosh...@gmail.com>
Date:   Tue Jul 29 21:46:59 2025 +1000

    c++/modules: Warn for optimize attributes instead of ICEing [PR108080]

    This PR is the most frequently reported modules bug for 15, as the ICE
    message does not indicate the issue at all and reducing to find the
    underlying cause can be tricky.

    I have a WIP patch to fix this issue by just reconstructing these nodes
    on stream-in from any attributes applied to the functions, but since at
    this stage it may still take a while to be ready, it seems useful to me
    to at least make the error here more friendly and guide users to what
    they could do to work around this issue.

    In fact, as noted on the PR, a lot of the time it should be harmless to
    just ignore the optimize etc. attribute and continue translation, at the
    user's own risk; this patch as such turns the ICE into a warning with no
    option to silence.

            PR c++/108080

    gcc/cp/ChangeLog:

            * module.cc (trees_out::core_vals): Warn when streaming
            target/optimize node; adjust comments.
            (trees_in::core_vals): Don't stream a target/optimize node.

    gcc/testsuite/ChangeLog:

            * g++.dg/modules/pr108080.H: New test.

    Signed-off-by: Nathaniel Shead <nathanielosh...@gmail.com>
    Reviewed-by: Jason Merrill <ja...@redhat.com>
    Reviewed-by: Patrick Palka <ppa...@redhat.com>

Reply via email to