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

            Bug ID: 119842
           Summary: ICE: in c_type_tag, at c/c-typeck.cc:606
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---
            Target: x86_64

*******************************************************************************
The compiler produces an internal error during comptypes when compiling the
provided code with the specified options. 
The issue can also be reproduced on Compiler Explorer.

*******************************************************************************
OS and Platform:
# uname -a
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
*******************************************************************************
# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/root/gdbtest/gcc/gcc-250416/libexec/gcc/x86_64-pc-linux-gnu/15.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/root/gdbtest/gcc/gcc-250416
--enable-languages=c,c++ --disable-multilib --disable-bootstrap
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.1 20250416 (experimental) (GCC)
*******************************************************************************
Program:
#cat bug.c

typedef struct __va_list_tag {           
} __va_list[1], __gnuc_va_list[1];


typedef struct _IO_FILE FILE;


struct _IO_FILE {
  int _flags;            
};


extern int vfprintf  (FILE *__restrict __s,
                          __const char *__restrict __format,
                          __gnuc_va_list  __arg)    ;

*******************************************************************************
Command Lines:
gcc bug.c  -flto -Ofast -Wall -Wextra -fno-strict-aliasing -fwrapv -g
-fsanitize=address  -c -o bug.o



<source>:15:27: internal compiler error: in c_type_tag, at c/c-typeck.cc:606
   15 |                           __gnuc_va_list  __arg)    ;
      |                           ^~~~~~~~~~~~~~
0x26099a5 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag
(*) [1], diagnostic_t)
        ???:0
0x2620976 internal_error(char const*, ...)
        ???:0
0x9eab30 fancy_abort(char const*, int, char const*)
        ???:0
0xa3a0c0 comptypes(tree_node*, tree_node*)
        ???:0
0xa11d84 pushdecl(tree_node*)
        ???:0
0xa277e1 start_decl(c_declarator*, c_declspecs*, bool, tree_node*, bool,
unsigned long*)
        ???:0
0xab309e c_parse_file()
        ???:0
0xb31f59 c_common_parse_file()
        ???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
Compiler returned: 1

*******************************************************************************

Also ICE on trunk, compiler explorer:https://godbolt.org/z/sv1vahcW1

*******************************************************************************

Reply via email to