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

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-invalid-code
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2019-01-16
                 CC|                            |msebor at gcc dot gnu.org
            Version|8.0                         |9.0
            Summary|ice in get_constant, at     |[9 Regression] ice in
                   |c-family/c-format.c:292     |get_constant, at
                   |                            |c-family/c-format.c:292
     Ever confirmed|0                           |1

--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> ---
The ICE was introduced in r266195 (GCC 9):

r266195 | msebor | 2018-11-15 17:53:57 -0500 (Thu, 15 Nov 2018) | 50 lines

PR c++/87541 - ICE using a constant decl as an attribute alloc_size argument
PR c++/87542 - bogus error on attribute format with a named constant argument

gcc/ChangeLog:

        PR c++/87541
        PR c++/87542
        * tree.c (type_argument_type): New function.
        * tree.h (type_argument_type): Declare it.
        * gcc/doc/extend.texi (alloc_align): Update and clarify.
        (alloc_size, nonnull, sentinel): Same.

gcc/c-family/ChangeLog:

        PR c++/87541
        PR c++/87542
        * c-attribs.c (positional_argument): New function.
        (handle_alloc_size_attribute): Use it and simplify.
        (handle_alloc_align_attribute): Same.
        (handle_assume_aligned_attribute): Same.
        (handle_nonnull_attribute): Same.
        * c-common.c (check_function_arguments): Pass fntype to
        check_function_format.
        * c-common.h (check_function_format): Add an argument.
        (PosArgFlags, positional_argument): Declare new type and function.
        * c-format.c (decode_format_attr): Add arguments.
        (check_format_string, get_constant): Same.
        (convert_format_name_to_system_name): Adjust.

Reply via email to