[Bug c/104427] ICE with __builtin_assoc_barrier and float types which introduce excess precision

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Feb 9 19:46:20 GMT 2022


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

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

https://gcc.gnu.org/g:499f8d4c2bc585b985882b4716f35b4c1553ce32

commit r12-7148-g499f8d4c2bc585b985882b4716f35b4c1553ce32
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Wed Feb 9 20:45:31 2022 +0100

    c: Fix up __builtin_assoc_barrier handling in the C FE [PR104427]

    The following testcase ICEs, because when creating PAREN_EXPR for
    __builtin_assoc_barrier the FE doesn't do the usual tweaks for
    EXCESS_PRECISION_EXPR or C_MAYBE_CONST_EXPR.  I believe that the
    declared effect of the builtin is just association barrier, so
    e.g. excess precision should be still handled like if it wasn't
    there.

    The following patch uses build_unary_op to handle those.

    2022-02-09  Jakub Jelinek  <jakub@redhat.com>

            PR c/104427
            * c-parser.cc (c_parser_postfix_expression)
            <case RID_BUILTIN_ASSOC_BARRIER>: Use parser_build_unary_op
            instead of build1_loc to build PAREN_EXPR.
            * c-typeck.cc (build_unary_op): Handle PAREN_EXPR.
            * c-fold.cc (c_fully_fold_internal): Likewise.

            * gcc.dg/pr104427.c: New test.


More information about the Gcc-bugs mailing list