[Bug middle-end/126497] ICE with bitint(1)

"pinskia at gcc dot gnu.org via Gcc-bugs" <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126497

Drea Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2026-07-30
          Component|tree-optimization           |middle-end
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
      Known to fail|                            |14.1.0

--- Comment #1 from Drea Pinski <pinskia at gcc dot gnu.org> ---
(gdb) p debug_tree(*expr_p)
 <parm_decl 0x7ffff7810aa0 a
    type <bitint_type 0x7ffff79c92a0 U sizes-gimplified public unsigned QI
        size <integer_cst 0x7ffff781f090 constant 8>
        unit-size <integer_cst 0x7ffff781f0a8 constant 1>
        align:8 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7ffff79c9150 precision:1 min <integer_cst 0x7ffff79dc4e0 0> max <integer_cst
0x7ffff79dc4f8 1>>
    used unsigned read QI t1.c:4:9 size <integer_cst 0x7ffff781f090 8>
unit-size <integer_cst 0x7ffff781f0a8 1>
    align:8 warn_if_not_align:0 context <function_decl 0x7ffff79d8100 ge>
arg-type <bitint_type 0x7ffff79c92a0 U>>
$2 = void


[apinski@xeond2 gcc]$ ../stage1-gcc/cc1 t1.c
 ge
Analyzing compilation unit
t1.c: In function ‘ge’:
t1.c:4:25: internal compiler error: in recalculate_side_effects, at
gimplify.cc:3368
    4 | U ge (U a) { U t; t = a >= 1; return t; }   /* ICE */
      |                       ~~^~~~
0x3a8325a internal_error(char const*, ...)
       
/home/apinski/src/upstream-gcc-new/gcc/gcc/diagnostic-global-context.cc:787
0x3a91b6b fancy_abort(char const*, int, char const*)
        /home/apinski/src/upstream-gcc-new/gcc/gcc/diagnostics/context.cc:1813
0x156cb43 recalculate_side_effects
        /home/apinski/src/upstream-gcc-new/gcc/gcc/gimplify.cc:3368
0x15bba6f gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        /home/apinski/src/upstream-gcc-new/gcc/gcc/gimplify.cc:21367
0x157b85e gimplify_modify_expr
        /home/apinski/src/upstream-gcc-new/gcc/gcc/gimplify.cc:7327
0x15b861d gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        /home/apinski/src/upstream-gcc-new/gcc/gcc/gimplify.cc:20509
0x1580842 gimplify_stmt(tree_node**, gimple**)
        /home/apinski/src/upstream-gcc-new/gcc/gcc/gimplify.cc:8570
0x15690c8 gimplify_statement_list
        /home/apinski/src/upstream-gcc-new/gcc/gcc/gimplify.cc:2166
0x15ba500 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        /home/apinski/src/upstream-gcc-new/gcc/gcc/gimplify.cc:20960
0x1580842 gimplify_stmt(tree_node**, gimple**)
        /home/apinski/src/upstream-gcc-new/gcc/gcc/gimplify.cc:8570
0x1566cd0 gimplify_bind_expr
        /home/apinski/src/upstream-gcc-new/gcc/gcc/gimplify.cc:1561
0x15b93a0 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        /home/apinski/src/upstream-gcc-new/gcc/gcc/gimplify.cc:20710
0x1580842 gimplify_stmt(tree_node**, gimple**)
        /home/apinski/src/upstream-gcc-new/gcc/gcc/gimplify.cc:8570
0x15bd472 gimplify_body(tree_node*, bool)
        /home/apinski/src/upstream-gcc-new/gcc/gcc/gimplify.cc:21816
0x15bddc7 gimplify_function_tree(tree_node*)
        /home/apinski/src/upstream-gcc-new/gcc/gcc/gimplify.cc:22025
0x12b2fb5 cgraph_node::analyze()
        /home/apinski/src/upstream-gcc-new/gcc/gcc/cgraphunit.cc:691
0x12b53b6 analyze_functions
        /home/apinski/src/upstream-gcc-new/gcc/gcc/cgraphunit.cc:1270
0x12b8934 symbol_table::finalize_compilation_unit()
        /home/apinski/src/upstream-gcc-new/gcc/gcc/cgraphunit.cc:2593
../stage1-gcc/cc1 t1.c
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.


We are gimplifying:
t = a != 0;

into  just `t = a;` and then call recalculate_side_effects on the `a`.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.