https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117066
Bug ID: 117066
Summary: ICE: in gimplify_expr, at gimplify.cc:18969
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: ---
*******************************************************************************
The compiler produces an internal error during gimplify_expr 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-241009/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/root/gdbtest/gcc/gcc-241009
--enable-languages=c,c++ --disable-multilib --disable-bootstrap
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20241009 (experimental) (GCC)
*******************************************************************************
Program:
# cat bugreport_0_1.c
int foo();
int demo();
int x;
int demo()
{
if (__transaction_atomic(x == -1))
{
foo();
}
return 1;
}
*******************************************************************************
Command Lines:
# gcc bugreport_0_1.c -O2 -funroll-loops -fno-strict-aliasing -fipa-pta -fwrapv
bugreport_0_1.c: In function ‘demo’:
bugreport_0_1.c:7:9: error: ‘__transaction_atomic’ without transactional memory
support enabled
7 | if (__transaction_atomic(x == -1))
| ^~~~~~~~~~~~~~~~~~~~
bugreport_0_1.c:7:32: internal compiler error: in gimplify_expr, at
gimplify.cc:18969
7 | if (__transaction_atomic(x == -1))
| ~~^~~~~
0x260066e internal_error(char const*, ...)
../../gcc/gcc/diagnostic-global-context.cc:517
0x9dc7a1 fancy_abort(char const*, int, char const*)
../../gcc/gcc/diagnostic.cc:1617
0x821039 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gcc/gimplify.cc:18969
0xdbee09 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gcc/gimplify.cc:18939
0xdbf20b gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gcc/gimplify.cc:18446
0xdd4618 gimplify_modify_expr
../../gcc/gcc/gimplify.cc:6540
0xdbef43 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gcc/gimplify.cc:18141
0xdc16e4 gimplify_stmt(tree_node**, gimple**)
../../gcc/gcc/gimplify.cc:7662
0xdc2917 gimplify_bind_expr
../../gcc/gcc/gimplify.cc:1649
0xdbf6d3 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gcc/gimplify.cc:18342
0xdc16e4 gimplify_stmt(tree_node**, gimple**)
../../gcc/gcc/gimplify.cc:7662
0xdc3f4b gimplify_and_add(tree_node*, gimple**)
../../gcc/gcc/gimplify.cc:516
0xdc3f4b gimplify_and_return_first
../../gcc/gcc/gimplify.cc:528
0xdc3f4b gimplify_transaction
../../gcc/gcc/gimplify.cc:17753
0xdc02b5 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gcc/gimplify.cc:18810
0xdbee09 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gcc/gimplify.cc:18939
0xdc7fec gimplify_cond_expr
../../gcc/gcc/gimplify.cc:4829
0xdbf753 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gcc/gimplify.cc:18095
0xdc16e4 gimplify_stmt(tree_node**, gimple**)
../../gcc/gcc/gimplify.cc:7662
0xdc011b gimplify_statement_list
../../gcc/gcc/gimplify.cc:2254
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.
*******************************************************************************
Also ICE on trunk, compiler explorer:https://godbolt.org/z/hP4s7WdPd
*******************************************************************************