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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <ja...@gcc.gnu.org>:

https://gcc.gnu.org/g:b1ed0c9671b99c6b06cbb8c61be14cdec0998de8

commit r13-5751-gb1ed0c9671b99c6b06cbb8c61be14cdec0998de8
Author: Jakub Jelinek <ja...@redhat.com>
Date:   Thu Feb 9 09:31:55 2023 +0100

    c++: Mangle EXCESS_PRECISION_EXPR <REAL_CST> as fold_convert REAL_CST
[PR108698]

    For standard excess precision, like the C FE we parse floating
    point constants as EXCESS_PRECISION_EXPR of promoted REAL_CST
    rather than the nominal REAL_CST, and as the following testcase
    shows the constants might need mangling.

    The following patch mangles those as fold_convert of the REAL_CST
    to EXCESS_PRECISION_EXPR type, i.e. how they were mangled before.

    I'm not really sure EXCESS_PRECISION_EXPR can appear elsewhere
    in expressions that would need mangling, tried various testcases
    but haven't managed to come up with one.  If that is possible,
    we'd keep ICEing on it without/with this patch, and the big question
    is how to mangle those; they could be mangled as casts from the
    promoted type back to nominal, but then in the mangled expressions
    one could see the effects of excess precision.  Until we have
    a reproducer, that is just theoretical though.

    2023-02-09  Jakub Jelinek  <ja...@redhat.com>

            PR c++/108698
            * mangle.cc (write_expression, write_template_arg): Handle
            EXCESS_PRECISION_EXPR with REAL_CST operand as
            write_template_arg_literal on fold_convert of the REAL_CST
            to EXCESS_PRECISION_EXPR type.

            * g++.dg/cpp0x/pr108698.C: New test.

Reply via email to