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

            Bug ID: 119649
           Summary: internal compiler error: tree check: expected class
                    'type', have 'exceptional' (error_mark) in
                    create_tmp_from_val, at gimplify.cc:621
           Product: gcc
           Version: 14.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: xieym3 at zohomail dot com
  Target Milestone: ---

$ gcc -v
Using built-in specs.
COLLECT_GCC=/data/xieym/work-f4/install/gcc-14.2.0/bin/gcc
COLLECT_LTO_WRAPPER=/data/xieym/work-f4/install/gcc-14.2.0/libexec/gcc/x86_64-pc-linux-gnu/14.2.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /data/xieym/work-f4/src/gcc-14.2.0/configure --enable-coverage
--enable-checking --disable-multilib --disable-shared --disable-bootstrap
--enable-languages=c,c++ --prefix=/data/xieym/work-f4/install/gcc-14.2.0
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.2.0 (GCC)
$ cat file.c
#include <stdlib.h>
/
#include <stdarg.h>
int main(int argc, char const *argv[])
{
        int sum, i;
        va_list args;
        va_start(args, argc);
        for (i = 0, sum = 0; i < argc; ++i) {
                sum += atoi(va_arg(args, char const *));
        }
        return 0;
}
$ gcc file.c -o /dev/null
<source>:2:1: error: expected identifier or '(' before '/' token
    2 | /
      | ^
In file included from <source>:3:
/opt/compiler-explorer/gcc-trunk-20250406/lib/gcc/x86_64-linux-gnu/15.0.1/include/stdarg.h:103:9:
error: unknown type name '__gnuc_va_list'
  103 | typedef __gnuc_va_list va_list;
      |         ^~~~~~~~~~~~~~
<source>: In function 'main':
<source>:8:24: warning: optional second parameter of 'va_start' not last named
argument [-Wvarargs]
    8 |         va_start(args, argc);
      |                        ^~~~
<source>:8:18: error: passing argument 1 of '__builtin_va_start' makes pointer
from integer without a cast [-Wint-conversion]
    8 |         va_start(args, argc);
      |                  ^~~~
      |                  |
      |                  va_list {aka int}
<source>:8:18: note: expected '__va_list_tag *' but argument is of type
'va_list' {aka 'int'}
<source>:10:42: error: first argument to 'va_arg' not of type 'va_list'
   10 |                 sum += atoi(va_arg(args, char const *));
      |                                          ^~~~
<source>:8:9: error: 'va_start' used in function with fixed arguments
    8 |         va_start(args, argc);
      |         ^~~~~~~~
<source>:10:24: internal compiler error: tree check: expected class 'type',
have 'exceptional' (error_mark) in create_tmp_from_val, at gimplify.cc:621
   10 |                 sum += atoi(va_arg(args, char const *));
      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0x2600f05 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag
(*) [1], diagnostic_t)
        ???:0
0x2617ed6 internal_error(char const*, ...)
        ???:0
0x8f3c89 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
        ???:0
0xdec770 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0xdec176 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0xdee8ba gimplify_stmt(tree_node**, gimple**)
        ???:0
0xdebc13 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0xdee8ba gimplify_stmt(tree_node**, gimple**)
        ???:0
0xdebc13 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0xdee8ba gimplify_stmt(tree_node**, gimple**)
        ???:0
0xdec3ba gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0xdee8ba gimplify_stmt(tree_node**, gimple**)
        ???:0
0xdebc13 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0xdf4c06 gimplify_body(tree_node*, bool)
        ???:0
0xdf50cc gimplify_function_tree(tree_node*)
        ???:0
0xc07bf7 cgraph_node::analyze()
        ???:0
0xc0af71 symbol_table::finalize_compilation_unit()
        ???: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

Godbolt Url: https://godbolt.org/z/s948EMjvs

Reply via email to