https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78775
Bug ID: 78775 Summary: [7 Regression] ICE in maybe_warn_alloc_args_overflow Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: marxin at gcc dot gnu.org CC: msebor at gcc dot gnu.org Target Milestone: --- Starting with Martin's commit r243470, we ICE for following code: $ cat ice.i int a, b, *c; int main () { unsigned long d = 0; while (1) { switch (b) case 'S': d = a; c = __builtin_malloc (d); } } $ gcc -O2 -c ice.i #11 0x00000000009646e1 in operand_signed_p (op=0x7ffff68907e0) at ../../gcc/calls.c:1277 #12 0x00000000009646e1 in operand_signed_p (op=0x7ffff6890798) at ../../gcc/calls.c:1277 #13 0x00000000009646e1 in operand_signed_p (op=0x7ffff68907e0) at ../../gcc/calls.c:1277 #14 0x00000000009646e1 in operand_signed_p (op=0x7ffff6890798) at ../../gcc/calls.c:1277 #15 0x00000000009646e1 in operand_signed_p (op=0x7ffff68907e0) at ../../gcc/calls.c:1277 #16 0x00000000009646e1 in operand_signed_p (op=0x7ffff6890798) at ../../gcc/calls.c:1277 #17 0x00000000009646e1 in operand_signed_p (op=0x7ffff68907e0) at ../../gcc/calls.c:1277 #18 0x00000000009646e1 in operand_signed_p (op=0x7ffff6890798) at ../../gcc/calls.c:1277 #19 0x00000000009646e1 in operand_signed_p (op=0x7ffff68907e0) at ../../gcc/calls.c:1277 #20 0x00000000009646e1 in operand_signed_p (op=0x7ffff6890798) at ../../gcc/calls.c:1277 #21 0x00000000009646e1 in operand_signed_p (op=0x7ffff68907e0) at ../../gcc/calls.c:1277 #22 0x0000000000964ea4 in maybe_warn_alloc_args_overflow (fn=0x7ffff6944200, exp=0x7ffff6892bd0, args=0x7fffffffc470, idx=0x7fffffffc480) at ../../gcc/calls.c:1385 #23 0x00000000009677a6 in initialize_argument_information (num_actuals=1, args=0x7fffffffc570, args_size=0x7fffffffc7f0, n_named_args=2, exp=0x7ffff6892bd0, struct_value_addr_value=0x0, fndecl=0x7ffff6944200, fntype=0x7ffff6930498, args_so_far=..., reg_parm_stack_space=0, old_stack_level=0x7fffffffc748, old_pending_adj=0x7fffffffc744, must_preallocate=0x7fffffffc768, ecf_flags=0x7fffffffc760, may_tailcall=0x7fffffffc82f, call_from_thunk_p=false) at ../../gcc/calls.c:1936 #24 0x000000000096b844 in expand_call (exp=0x7ffff6892bd0, target=0x7ffff69c26c0, ignore=0) at ../../gcc/calls.c:3272 #25 0x000000000094f0d0 in expand_builtin (exp=0x7ffff6892bd0, target=0x7ffff69c26c0, subtarget=0x0, mode=DImode, ignore=0) at ../../gcc/builtins.c:7485 #26 0x0000000000af23cc in expand_expr_real_1 (exp=0x7ffff6892bd0, target=0x7ffff69c26c0, tmode=DImode, modifier=EXPAND_NORMAL, alt_rtl=0x7fffffffd110, inner_reference_p=false) at ../../gcc/expr.c:10772 #27 0x0000000000ae636e in expand_expr_real (exp=0x7ffff6892bd0, target=0x7ffff69c26c0, tmode=DImode, modifier=EXPAND_NORMAL, alt_rtl=0x7fffffffd110, inner_reference_p=false) at ../../gcc/expr.c:8087 #28 0x0000000000add259 in store_expr_with_bounds (exp=0x7ffff6892bd0, target=0x7ffff69c26c0, call_param_p=0, nontemporal=false, reverse=false, btarget=0x7ffff6890708) at ../../gcc/expr.c:5551 #29 0x0000000000adbcae in expand_assignment (to=0x7ffff6890708, from=0x7ffff6892bd0, nontemporal=false) at ../../gcc/expr.c:5320 #30 0x00000000009847d3 in expand_call_stmt (stmt=0x7ffff7fedcf0) at ../../gcc/cfgexpand.c:2656 #31 0x0000000000987a03 in expand_gimple_stmt_1 (stmt=0x7ffff7fedcf0) at ../../gcc/cfgexpand.c:3571 #32 0x00000000009880f9 in expand_gimple_stmt (stmt=0x7ffff7fedcf0) at ../../gcc/cfgexpand.c:3737 #33 0x000000000098f959 in expand_gimple_basic_block (bb=0x7ffff68913a8, disable_tail_calls=false) at ../../gcc/cfgexpand.c:5744 #34 0x00000000009913e1 in (anonymous namespace)::pass_expand::execute (this=0x2886100, fun=0x7ffff69b7000) at ../../gcc/cfgexpand.c:6355 #35 0x0000000000df7273 in execute_one_pass (pass=0x2886100) at ../../gcc/passes.c:2370 #36 0x0000000000df75c4 in execute_pass_list_1 (pass=0x2886100) at ../../gcc/passes.c:2459 #37 0x0000000000df764d in execute_pass_list (fn=0x7ffff69b7000, pass=0x2882730) at ../../gcc/passes.c:2470 #38 0x00000000009d829e in cgraph_node::expand (this=0x7ffff69bb000) at ../../gcc/cgraphunit.c:2001 #39 0x00000000009d88d7 in expand_all_functions () at ../../gcc/cgraphunit.c:2137 #40 0x00000000009d946d in symbol_table::compile (this=0x7ffff688a100) at ../../gcc/cgraphunit.c:2494 #41 0x00000000009d96ac in symbol_table::finalize_compilation_unit (this=0x7ffff688a100) at ../../gcc/cgraphunit.c:2584 #42 0x0000000000f1cb89 in compile_file () at ../../gcc/toplev.c:488 #43 0x0000000000f1f062 in do_compile () at ../../gcc/toplev.c:1983 #44 0x0000000000f1f33e in toplev::main (this=0x7fffffffd9f0, argc=13, argv=0x7fffffffdaf8) at ../../gcc/toplev.c:2117 #45 0x0000000001a262e0 in main (argc=13, argv=0x7fffffffdaf8) at ../../gcc/main.c:39 There's an infinite recursion.