https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71602
Bug ID: 71602 Summary: ICE on valid code on x86_64-linux-gnu (in build_va_arg, at c-family/c-common.c:5810) Product: gcc Version: 7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: chengniansun at gmail dot com Target Milestone: --- This is a regression. gcc-5.3 and older versions are okay with the following test program. $: gcc-trunk -v Using built-in specs. COLLECT_GCC=gcc-trunk COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../gcc-source-trunk/configure --enable-languages=c,c++,lto --prefix=/usr/local/gcc-trunk --disable-bootstrap Thread model: posix gcc version 7.0.0 20160620 (experimental) [trunk revision 237605] (GCC) $: $: gcc-trunk -c small.c small.c: In function ‘fn1’: small.c:3:3: internal compiler error: in build_va_arg, at c-family/c-common.c:5810 __builtin_va_arg(pap, double); ^~~~~~~~~~~~~~~~ 0x7067a2 build_va_arg(unsigned int, tree_node*, tree_node*) ../../gcc-source-trunk/gcc/c-family/c-common.c:5810 0x6a0d23 c_parser_postfix_expression ../../gcc-source-trunk/gcc/c/c-parser.c:7668 0x6a335a c_parser_unary_expression ../../gcc-source-trunk/gcc/c/c-parser.c:6942 0x6a418a c_parser_cast_expression ../../gcc-source-trunk/gcc/c/c-parser.c:6771 0x6a4394 c_parser_binary_expression ../../gcc-source-trunk/gcc/c/c-parser.c:6580 0x6a5045 c_parser_conditional_expression ../../gcc-source-trunk/gcc/c/c-parser.c:6351 0x6a56c0 c_parser_expr_no_commas ../../gcc-source-trunk/gcc/c/c-parser.c:6268 0x6a5dc2 c_parser_expression ../../gcc-source-trunk/gcc/c/c-parser.c:8464 0x6a6829 c_parser_expression_conv ../../gcc-source-trunk/gcc/c/c-parser.c:8497 0x6bcb28 c_parser_statement_after_labels ../../gcc-source-trunk/gcc/c/c-parser.c:5287 0x6be9cb c_parser_compound_statement_nostart ../../gcc-source-trunk/gcc/c/c-parser.c:4861 0x6bf25e c_parser_compound_statement ../../gcc-source-trunk/gcc/c/c-parser.c:4696 0x6c0487 c_parser_declaration_or_fndef ../../gcc-source-trunk/gcc/c/c-parser.c:2105 0x6c9625 c_parser_external_declaration ../../gcc-source-trunk/gcc/c/c-parser.c:1549 0x6c9eb9 c_parser_translation_unit ../../gcc-source-trunk/gcc/c/c-parser.c:1430 0x6c9eb9 c_parse_file() ../../gcc-source-trunk/gcc/c/c-parser.c:17931 0x72c2b2 c_common_parse_file() ../../gcc-source-trunk/gcc/c-family/c-opts.c:1070 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <http://gcc.gnu.org/bugs.html> for instructions. $: $: gcc-5.3 -c small.c $: $: cat small.c __builtin_va_list *pap; void fn1() { __builtin_va_arg(pap, double); } $: