[Bug c++/84424] [8 Regression] ICE on C++ code: tree check: expected record_type or union_type or qual_union_type, have vector_type in reduced_constant_expression_p, at cp/constexpr.c:1766

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat Feb 17 00:07:00 GMT 2018


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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I can reproduce with latest trunk too.
The ICE is on:
1765          if (CONSTRUCTOR_NO_IMPLICIT_ZERO (t))
1766            field = next_initializable_field (TYPE_FIELDS (TREE_TYPE (t)));
1767          else
1768            field = NULL_TREE;
where t is:
 <constructor 0x7fffefdb3228
    type <vector_type 0x7fffefd9f9d8 vec
        type <integer_type 0x7fffefc625e8 int public type_6 SI
            size <integer_cst 0x7fffefc650c0 constant 32>
            unit-size <integer_cst 0x7fffefc650d8 constant 4>
            align:32 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7fffefc625e8 precision:32 min <integer_cst 0x7fffefc65078 -2147483648> max
<integer_cst 0x7fffefc65090 2147483647>
            pointer_to_this <pointer_type 0x7fffefc6aa80>>
        V2SI
        size <integer_cst 0x7fffefc45e70 constant 64>
        unit-size <integer_cst 0x7fffefc45e88 constant 8>
        align:64 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7fffefd72d20 nunits:2>
    constant tree_1 length:0>
created in:
4783      if (AGGREGATE_TYPE_P (type) || VECTOR_TYPE_P (type))
4784        {
4785          /* In C++14 an NSDMI can participate in aggregate initialization,
4786             and can refer to the address of the object being initialized,
so
4787             we need to pass in the relevant VAR_DECL if we want to do the
4788             evaluation in a single pass.  The evaluation will dynamically
4789             update ctx.values for the VAR_DECL.  We use the same strategy
4790             for C++11 constexpr constructors that refer to the object
being
4791             initialized.  */
4792          ctx.ctor = build_constructor (type, NULL);
4793          CONSTRUCTOR_NO_IMPLICIT_ZERO (ctx.ctor) = true;

VECTOR_TYPE obviously doesn't have TYPE_FIELDS.

I guess we need to teach reduced_constant_expression_p how to handle
VECTOR_TYPE constructors.


More information about the Gcc-bugs mailing list