[Bug c++/101597] [12 Regression] ICE in pretty-printer formatting an OBJ_TYPE_REF since r12-2132-ga110855667782dac

msebor at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Jul 23 17:15:43 GMT 2021


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

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|tree-optimization           |c++
            Summary|[12 Regression] ICE in evrp |[12 Regression] ICE in
                   |since                       |pretty-printer formatting
                   |r12-2132-ga110855667782dac  |an OBJ_TYPE_REF since
                   |                            |r12-2132-ga110855667782dac

--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> ---
The ICE happens in a call to inform(..., "...%qE...", allocfn) with allocfn set
to the OBJ_TYPE_REF argument below.  The pretty-printer winds up passing the
argument to resolve_virtual_fun_from_obj_type_ref() in cp/error.c which
computes a null pointer that it eventually dereferences.

The inform() call looks valid to me so the bug is most likely in the C++ frond
end's pretty-printer.

 <obj_type_ref 0x7fffea9d3630
    type <pointer_type 0x7fffea987f18
        type <method_type 0x7fffea987bd0 type <pointer_type 0x7fffea981348>
            QI
            size <integer_cst 0x7fffea7f6fd8 constant 8>
            unit-size <integer_cst 0x7fffea816000 constant 1>
            align:8 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7fffea987bd0 method basetype <record_type 0x7fffea96b690 PluginViewBase>
            arg-types <tree_list 0x7fffea9881e0 value <pointer_type
0x7fffea9879d8>
                chain <tree_list 0x7fffea9881b8 value <pointer_type
0x7fffea981348>
                    chain <tree_list 0x7fffea80a8e8 value <void_type
0x7fffea814f18 void>>>>
            pointer_to_this <pointer_type 0x7fffea987f18>>
        public unsigned DI
        size <integer_cst 0x7fffea7f6ee8 constant 64>
        unit-size <integer_cst 0x7fffea7f6f00 constant 8>
        align:64 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7fffea987f18>

    arg:0 <ssa_name 0x7fffea9cc630
        type <pointer_type 0x7fffea952498 __vtbl_ptr_type type <function_type
0x7fffea9523f0>
            public unsigned type_6 DI size <integer_cst 0x7fffea7f6ee8 64>
unit-size <integer_cst 0x7fffea7f6f00 8>
            align:64 warn_if_not_align:0 symtab:0 alias-set 5 canonical-type
0x7fffea952498
            pointer_to_this <pointer_type 0x7fffea952690>>
        visited
        def_stmt _12 = *_11;
        version:12
        ptr-info 0x7fffea9d5f30>
    arg:1 <ssa_name 0x7fffea9cc558
        type <pointer_type 0x7fffea98f000 type <record_type 0x7fffea981540
Widget>
            public unsigned DI size <integer_cst 0x7fffea7f6ee8 64> unit-size
<integer_cst 0x7fffea7f6f00 8>
            align:64 warn_if_not_align:0 symtab:0 alias-set 7 canonical-type
0x7fffea98f000
            pointer_to_this <pointer_type 0x7fffea9a43f0>>

        def_stmt pluginScriptObjectFromPluginViewBase_pluginWidget.2_9 =
ASSERT_EXPR <pluginScriptObjectFromPluginViewBase_pluginWidget.2_10,
pluginScriptObjectFromPluginViewBase_pluginWidget.2_10 != 0B>;
        version:9
        ptr-info 0x7fffea9d9000>
    arg:2 <integer_cst 0x7fffea816288 type <integer_type 0x7fffea8145e8 int>
constant 0>>


More information about the Gcc-bugs mailing list