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

--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
So the C++ front-end produces:

(gdb) p debug_generic_expr(t)
VIEW_CONVERT_EXPR<long unsigned int>(var) + NON_LVALUE_EXPR <2>
(gdb) p debug_tree(t)
 <plus_expr 0x7ffff79aeac8
    type <integer_type 0x7ffff78267e0 long unsigned int public unsigned type_6
DI
        size <integer_cst 0x7ffff7820168 constant 64>
        unit-size <integer_cst 0x7ffff7820180 constant 8>
        align:64 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7ffff78267e0 precision:64 min <integer_cst 0x7ffff7820438 0> max <integer_cst
0x7ffff7803640 18446744073709551615>
        pointer_to_this <pointer_type 0x7ffff7838a80>>

    arg:0 <view_convert_expr 0x7ffff79a6ba0 type <integer_type 0x7ffff78267e0
long unsigned int>
        public
        arg:0 <parm_decl 0x7ffff7fb7100 var type <integer_type 0x7ffff78267e0
long unsigned int>
            used unsigned read DI t.cc:2:23 size <integer_cst 0x7ffff7820168
64> unit-size <integer_cst 0x7ffff7820180 8>
            align:64 warn_if_not_align:0 context <function_decl 0x7ffff79b4c00
f> arg-type <integer_type 0x7ffff78267e0 long unsigned int>>
        t.cc:3:11 start: t.cc:3:11 finish: t.cc:3:13>
    arg:1 <non_lvalue_expr 0x7ffff79a6bc0
        type <integer_type 0x7ffff78265e8 int public type_6 SI
            size <integer_cst 0x7ffff78203a8 constant 32>
            unit-size <integer_cst 0x7ffff78203c0 constant 4>
            align:32 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7ffff78265e8 precision:32 min <integer_cst 0x7ffff7820360 -2147483648> max
<integer_cst 0x7ffff7820378 2147483647>
            pointer_to_this <pointer_type 0x7ffff782db28>>
        constant public
        arg:0 <integer_cst 0x7ffff78208e8 constant 2>
        t.cc:3:17 start: t.cc:3:17 finish: t.cc:3:17>
    t.cc:3:15 start: t.cc:3:11 finish: t.cc:3:17>



But the type of NON_LVALUE_EXPR/2 is int:
(gdb) p debug_tree((tree)0x7ffff79a6bc0)
 <non_lvalue_expr 0x7ffff79a6bc0
    type <integer_type 0x7ffff78265e8 int public type_6 SI
        size <integer_cst 0x7ffff78203a8 constant 32>
        unit-size <integer_cst 0x7ffff78203c0 constant 4>
        align:32 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7ffff78265e8 precision:32 min <integer_cst 0x7ffff7820360 -2147483648> max
<integer_cst 0x7ffff7820378 2147483647>
        pointer_to_this <pointer_type 0x7ffff782db28>>
    constant public
    arg:0 <integer_cst 0x7ffff78208e8 type <integer_type 0x7ffff78265e8 int>
constant 2>
    t.cc:3:17 start: t.cc:3:17 finish: t.cc:3:17>


Which breaks the type system for generic.

Reply via email to