public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "marxin at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/102359] New: ICE gimplification failed since r12-3433-ga25e0b5e6ac8a77a
Date: Thu, 16 Sep 2021 08:54:04 +0000	[thread overview]
Message-ID: <bug-102359-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 102359
           Summary: ICE gimplification failed since
                    r12-3433-ga25e0b5e6ac8a77a
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: marxin at gcc dot gnu.org
                CC: qing.zhao at oracle dot com
  Target Milestone: ---

The following fails:

$ cat cxx.cpp
struct A {
  double a = 111;
  auto foo() {
    return [*this] { return a; };
  }
};
int X = A{}.foo()();

$ g++ cxx.cpp -c -ftrivial-auto-var-init=zero
gimplification failed:
&__closure->__this <addr_expr 0x7ffff77396c0
    type <pointer_type 0x7ffff7731000
        type <record_type 0x7ffff7718930 A readonly needs-constructing
cxx-odr-p type_5 DF
            size <integer_cst 0x7ffff75aff30 constant 64>
            unit-size <integer_cst 0x7ffff75aff48 constant 8>
            align:64 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7ffff7718930 fields <function_decl 0x7ffff7736000 __dt > context
<translation_unit_decl 0x7ffff75bd168 cxx.cpp>
            full-name "const struct A"
            needs-constructor X() X(constX&) this=(X&) n_parents=0
use_template=0 interface-unknown
            pointer_to_this <pointer_type 0x7ffff7718540> reference_to_this
<reference_type 0x7ffff77312a0>>
        readonly sizes-gimplified unsigned DI size <integer_cst 0x7ffff75aff30
64> unit-size <integer_cst 0x7ffff75aff48 8>
        align:64 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7ffff7731000>
    readonly
    arg:0 <component_ref 0x7ffff7734690 type <record_type 0x7ffff7718930 A>
        readonly
        arg:0 <mem_ref 0x7ffff7737910 type <record_type 0x7ffff77185e8
._anon_0>
            arg:0 <parm_decl 0x7ffff772c180 __closure>
            arg:1 <integer_cst 0x7ffff7725e88 constant 0>
            cxx.cpp:4:18 start: cxx.cpp:4:18 finish: cxx.cpp:4:18>
        arg:1 <field_decl 0x7ffff75deab0 __this type <record_type
0x7ffff7718b28 A>
            used nonlocal decl_7 DF cxx.cpp:4:14 size <integer_cst
0x7ffff75aff30 64> unit-size <integer_cst 0x7ffff75aff48 8>
            align:64 warn_if_not_align:0 offset_align 128
            offset <integer_cst 0x7ffff75aff60 constant 0>
            bit-offset <integer_cst 0x7ffff75affa8 constant 0> context
<record_type 0x7ffff77182a0 ._anon_0> chain <function_decl 0x7ffff771c500
operator()>>
        cxx.cpp:4:18 start: cxx.cpp:4:18 finish: cxx.cpp:4:18>>
cxx.cpp: In lambda function:
cxx.cpp:4:18: internal compiler error: gimplification failed
    4 |     return [*this] { return a; };
      |                  ^
0xf2510a gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        /home/marxin/Programming/gcc/gcc/gimplify.c:15569
0xf31e2b gimplify_modify_expr
        /home/marxin/Programming/gcc/gcc/gimplify.c:5960
0xf2161f gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        /home/marxin/Programming/gcc/gcc/gimplify.c:14556
0xf2515c gimplify_stmt(tree_node**, gimple**)
        /home/marxin/Programming/gcc/gcc/gimplify.c:7006
0xf25196 gimplify_and_add(tree_node*, gimple**)
        /home/marxin/Programming/gcc/gcc/gimplify.c:494
0xf25706 gimplify_assign(tree_node*, tree_node*, gimple**)
        /home/marxin/Programming/gcc/gcc/gimplify.c:16148
0xf33fc8 gimple_add_init_for_auto_var
        /home/marxin/Programming/gcc/gcc/gimplify.c:1777
0xf33fc8 gimplify_decl_expr
        /home/marxin/Programming/gcc/gcc/gimplify.c:1937
0xf21a03 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        /home/marxin/Programming/gcc/gcc/gimplify.c:14753
0xf2515c gimplify_stmt(tree_node**, gimple**)
        /home/marxin/Programming/gcc/gcc/gimplify.c:7006
0xf22f33 gimplify_statement_list
        /home/marxin/Programming/gcc/gcc/gimplify.c:1997
0xf22f33 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        /home/marxin/Programming/gcc/gcc/gimplify.c:15001
0xf2515c gimplify_stmt(tree_node**, gimple**)
        /home/marxin/Programming/gcc/gcc/gimplify.c:7006
0xf25fd0 gimplify_bind_expr
        /home/marxin/Programming/gcc/gcc/gimplify.c:1426
0xf21f1a gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        /home/marxin/Programming/gcc/gcc/gimplify.c:14757
0xf2515c gimplify_stmt(tree_node**, gimple**)
        /home/marxin/Programming/gcc/gcc/gimplify.c:7006
0xf275e3 gimplify_body(tree_node*, bool)
        /home/marxin/Programming/gcc/gcc/gimplify.c:15802
0xf27a7c gimplify_function_tree(tree_node*)
        /home/marxin/Programming/gcc/gcc/gimplify.c:15956
0xd5c037 cgraph_node::analyze()
        /home/marxin/Programming/gcc/gcc/cgraphunit.c:670
0xd5ec77 analyze_functions
        /home/marxin/Programming/gcc/gcc/cgraphunit.c:1234
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

             reply	other threads:[~2021-09-16  8:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-16  8:54 marxin at gcc dot gnu.org [this message]
2021-09-16  8:54 ` [Bug tree-optimization/102359] " marxin at gcc dot gnu.org
2021-09-16  9:37 ` rguenth at gcc dot gnu.org
2021-09-29 16:28 ` qinzhao at gcc dot gnu.org
2021-10-05 23:14 ` cvs-commit at gcc dot gnu.org
2021-10-05 23:16 ` qinzhao at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-102359-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).