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

            Bug ID: 125227
           Summary: [17 Regression] ICE in tree_check: expected
                    boolean_type or enumeral_type or integer_type or
                    bitint_type, have real_type in gimple_simplify_629
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dhruvc at gcc dot gnu.org
                CC: pzheng at gcc dot gnu.org
  Target Milestone: ---

Did not do a full bisect but most likely r17-370-g5dee3c6521c278.

Min-repro:

int a;
double b, c, d;
double e(double f, double g) { return f > g ? f : g; }
void h() {
  b = c * c + d;
  b = e(b, c * c + a);
}

Flags: -Ofast -mcpu=grace

Backtrace:

test.i:4:6: internal compiler error: tree check: expected boolean_type or
enumeral_type or integer_type or bitint_type, have real_type in
gimple_simplify_629, at gimple-match-6.cc:7833
    4 | void h() {
      |      ^
0x23de573 internal_error(char const*, ...)
        <path>/gcc/diagnostic-global-context.cc:787
0x8a4b7f tree_check_failed(tree_node const*, char const*, int, char const*,
...)
        <path>/gcc/tree.cc:9219
0x8aa943 any_integral_type_check(tree_node*, char const*, int, char const*)
        <path>/gcc/tree.h:4065
0x18a250b any_integral_type_check(tree_node*, char const*, int, char const*)
        <path>/gcc/tree.h:4065
0x18a250b gimple_simplify_629(gimple_match_op*, gimple**, tree_node*
(*)(tree_node*), tree_node*, tree_node**, tree_code)
        /tmp/tmp.lwmlf2vlUY/gcc/gimple-match-6.cc:7833
0x1a89af7 gimple_simplify_MAX_EXPR(gimple_match_op*, gimple**, tree_node*
(*)(tree_node*), code_helper, tree_node*, tree_node*, tree_node*)
        /tmp/tmp.lwmlf2vlUY/gcc/gimple-match-9.cc:24532
0x1b118b7 gimple_resimplify2
        <path>/gcc/gimple-match-exports.cc:1027
0x1b1209f gimple_simplify(gimple*, gimple_match_op*, gimple**, tree_node*
(*)(tree_node*), tree_node* (*)(tree_node*))
        <path>/gcc/gimple-match-exports.cc:894
0xcf8ab3 fold_stmt_1
        <path>/gcc/gimple-fold.cc:6887
0x12b633f execute
        <path>/gcc/tree-ssa-forwprop.cc:5788

Reply via email to