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

--- Comment #10 from John David Anglin <danglin at gcc dot gnu.org> ---
Another bit of information:

Breakpoint 5, type_has_trivial_fn (ctype=0x800003ffbfeb1f18,
    sfk=sfk_copy_constructor) at ../../gcc/gcc/cp/method.cc:399
399       switch (sfk)
(gdb) p debug_tree (ctype)
 <record_type 800003ffbfeb1f18 X addressable no-force-blk cxx-odr-p type_4
type_5 BLK
    size <integer_cst 800003ffbfd51c90 type <integer_type 800003ffbfd670a8
bitsizetype> constant 64>
    unit-size <integer_cst 800003ffbfd51ca8 type <integer_type 800003ffbfd67000
sizetype> constant 8>
    align:32 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
800003ffbfeb1f18
    fields <function_decl 800003ffbfeca400 __ct
        type <method_type 800003ffbfed0bd0 type <void_type 800003ffbfd67f18
void>
            DI size <integer_cst 800003ffbfd51c90 64> unit-size <integer_cst
800003ffbfd51ca8 8>
            align:64 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
800003ffbfed0bd0 method basetype <record_type 800003ffbfeb1f18 X>
            arg-types <tree_list 800003ffbfeade88 value <pointer_type
800003ffbfeb15e8>
                chain <tree_list 800003ffbfeade60 value <reference_type
800003ffbfec91f8>
                    chain <tree_list 800003ffbfd5aac8 value <void_type
800003ffbfd67f18 void>>>>
            throws <tree_list 800003ffbfead280
                purpose <integer_cst 800003ffbfd6e018 constant 1>>
            pointer_to_this <pointer_type 800003ffbfed0dc8>>
        addressable used nothrow public static deprecated external weak
autoinline decl_3 decl_5 decl_8 SI defer-output
/home/dave/gnu/gcc/gcc/gcc/testsuite/g++.dg/torture/tail-padding1.C:6:8
align:64 warn_if_not_align:0 context <record_type 800003ffbfeb1f18 X> initial
<block 800003ffbfeb4618>
        result <result_decl 800003ffbfd65380 D.2481 type <void_type
800003ffbfd67f18 void>
            ignored VOID
/home/dave/gnu/gcc/gcc/gcc/testsuite/g++.dg/torture/tail-padding1.C:6:8
            align:8 warn_if_not_align:0 context <function_decl 800003ffbfeca400
__ct >>
        full-name "constexpr X::X(const X&) noexcept"
        not-really-extern
        arguments <parm_decl 800003ffbfebe330 this type <pointer_type
800003ffbfeb1690>
            readonly unsigned read DI
/home/dave/gnu/gcc/gcc/gcc/testsuite/g++.dg/torture/tail-padding1.C:10:11 size
<integer_cst 800003ffbfd51c90 64> unit-size <integer_cst 800003ffbfd51ca8 8>
            align:64 warn_if_not_align:0 context <function_decl
800003ffbfeca400 __ct > arg-type <pointer_type 800003ffbfeb1690> chain
<parm_decl 800003ffbfebef68 D.2410>>
        struct-function 800003ffbff4f4e0
        chain <function_decl 800003ffbfeca600 __ct_base  type <method_type
800003ffbfed0bd0>
            used public static deprecated weak autoinline decl_3 decl_5 decl_8
SI /home/dave/gnu/gcc/gcc/gcc/testsuite/g++.dg/torture/tail-padding1.C:6:8
align:64 warn_if_not_align:0 context <record_type 800003ffbfeb1f18 X> initial
<block 800003ffbfeb47b8> result <result_decl 800003ffbfd65480 D.2485>
            full-name "constexpr X::X(const X&) noexcept" arguments <parm_decl
800003ffbfecc088 this>
            struct-function 800003ffbff4f5b0 chain <function_decl
800003ffbfeca500 __ct_comp >>> context <translation_unit_decl 800003ffbfd65000
/home/dave/gnu/gcc/gcc/gcc/testsuite/g++.dg/torture/tail-padding1.C>
    full-name "struct X"
    needs-destructor X() X(constX&) this=(X&) n_parents=0 use_template=0
interface-unknown
    pointer_to_this <pointer_type 800003ffbfeb15e8> reference_to_this
<reference_type 800003ffbfec9540> chain <type_decl 800003ffbfd78780 X>>
$18 = void

This code returns true:
    case sfk_copy_constructor:
      return !TYPE_HAS_COMPLEX_COPY_CTOR (ctype);

(gdb) bt
#0  type_has_trivial_fn (ctype=0x800003ffbfeb1f18, sfk=sfk_copy_constructor)
    at ../../gcc/gcc/cp/method.cc:399
#1  0x4000000000a1b0bc in trivial_fn_p (fn=<optimized out>)
    at ../../gcc/gcc/tree.h:3834
#2  0x40000000008ac244 in cxx_eval_call_expression (ctx=0x800003ffbfff3420,
    t=0x800003ffbfed30c0, lval=vc_prvalue, non_constant_p=0x800003ffbfff3471,
    overflow_p=0x800003ffbfff3470) at ../../gcc/gcc/cp/constexpr.cc:3051
#3  0x40000000008b1164 in cxx_eval_constant_expression (
    ctx=0x800003ffbfed30c0, t=<optimized out>, lval=<optimized out>,
    non_constant_p=0x800003ffbfff3471,
    overflow_p=0x8000000100438800 <tree_contains_struct>,
    jump_target=0x800003ffbfff3420) at ../../gcc/gcc/cp/constexpr.cc:7725
#4  0x40000000008c3308 in cxx_eval_outermost_constant_expr (
    t=0x800003ffbfed30c0, allow_non_constant=<optimized out>,
    strict=<optimized out>, manifestly_const_eval=<optimized out>,
    constexpr_dtor=<optimized out>, object=0x800003ffbfeb1f18)
    at ../../gcc/gcc/cp/constexpr.cc:9020
#5  0x40000000008cb064 in maybe_constant_value (t=<optimized out>,
    decl=0x800003ffbfff3420, manifestly_const_eval=-1074974528)
    at ../../gcc/gcc/cp/constexpr.cc:9323
[...]

Reply via email to