https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122834
Bug ID: 122834
Summary: ICE: in cp_compare_floating_point_conversion_ranks, at
cp/typeck.cc
Product: gcc
Version: 15.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: 522024330006 at smail dot nju.edu.cn
Target Milestone: ---
I find this ICE on the 13.1 and later.
Compiler Explorer: https://godbolt.org/z/8Pn1zY1vK
Program:
```c
typedef long double TFmode __attribute__((mode(TF)));
typedef long double TDmode __attribute__((mode(TD)));
TFmode tf_add (TFmode a, TFmode b) {
return a + b;
}
TDmode td_diff (TDmode c, TDmode d) {
return c - d;
}
int main() {
TFmode tfa = .0L, tfb = .5L;
td_diff(tfa+tfb, tfa-tfb);
return 0;
}
```
Part of the traceback:
48800.fuzz:35:12: internal compiler error: in
cp_compare_floating_point_conversion_ranks, at cp/typeck.cc:308
35 | td_diff(tfa+tfb, tfa-tfb); //
| ~~~~~~~^~~~~~~~~~~~~~~~~~
0x5da1dc8 internal_error(char const*, ...)
/workspace/install/gcc/src/gcc/gcc/diagnostic-global-context.cc:517
0x5d3f858 fancy_abort(char const*, int, char const*)
/workspace/install/gcc/src/gcc/gcc/diagnostic.cc:1749
0x168c9af cp_compare_floating_point_conversion_ranks(tree_node*, tree_node*)
/workspace/install/gcc/src/gcc/gcc/cp/typeck.cc:308
0xe7cade standard_conversion
/workspace/install/gcc/src/gcc/gcc/cp/call.cc:1633
0xe7f6c7 implicit_conversion
/workspace/install/gcc/src/gcc/gcc/cp/call.cc:2189
0xe83328 add_function_candidate
/workspace/install/gcc/src/gcc/gcc/cp/call.cc:2637
0xe9fce6 add_candidates
/workspace/install/gcc/src/gcc/gcc/cp/call.cc:6887
0xe934c1 perform_overload_resolution
/workspace/install/gcc/src/gcc/gcc/cp/call.cc:5117
0xe93b6c build_new_function_call(tree_node*, vec<tree_node*, va_gc,
vl_embed>**, int)
/workspace/install/gcc/src/gcc/gcc/cp/call.cc:5218
0x15ccac3 finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**,
bool, bool, int)
/workspace/install/gcc/src/gcc/gcc/cp/semantics.cc:3504
0x137449f cp_parser_postfix_expression
/workspace/install/gcc/src/gcc/gcc/cp/parser.cc:8474
0x137a2ce cp_parser_unary_expression
/workspace/install/gcc/src/gcc/gcc/cp/parser.cc:9735
0x137cf99 cp_parser_cast_expression
/workspace/install/gcc/src/gcc/gcc/cp/parser.cc:10650
0x137d167 cp_parser_binary_expression
/workspace/install/gcc/src/gcc/gcc/cp/parser.cc:10753
0x137f132 cp_parser_assignment_expression
/workspace/install/gcc/src/gcc/gcc/cp/parser.cc:11098
0x137fa66 cp_parser_expression
/workspace/install/gcc/src/gcc/gcc/cp/parser.cc:11281
0x138b392 cp_parser_expression_statement
/workspace/install/gcc/src/gcc/gcc/cp/parser.cc:13598
0x138a175 cp_parser_statement
/workspace/install/gcc/src/gcc/gcc/cp/parser.cc:13342
0x138c529 cp_parser_statement_seq_opt
/workspace/install/gcc/src/gcc/gcc/cp/parser.cc:13861
0x138bd1e cp_parser_compound_statement
/workspace/install/gcc/src/gcc/gcc/cp/parser.cc:13708
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.
The gcc version I used is:
Using built-in specs.
COLLECT_GCC=/workspace/install/gcc/install_15.2.0/bin/gcc
COLLECT_LTO_WRAPPER=/workspace/install/gcc/install_15.2.0/libexec/gcc/x86_64-pc-linux-gnu/15.2.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /workspace/install/gcc/src/gcc/configure --enable-coverage
--enable-checking --disable-multilib --disable-shared --disable-bootstrap
--enable-languages=c,c++ --prefix=/workspace/install/gcc/install_15.2.0
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.2.0 (GCC)