public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/97947] New: [11 Regression] ICE in digest_init_r, at cp/typeck2.c:1145
@ 2020-11-23 12:34 asolokha at gmx dot com
  2020-11-23 18:23 ` [Bug c++/97947] " mpolacek at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: asolokha at gmx dot com @ 2020-11-23 12:34 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 97947
           Summary: [11 Regression] ICE in digest_init_r, at
                    cp/typeck2.c:1145
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: asolokha at gmx dot com
  Target Milestone: ---
            Target: powerpc-*-linux-gnu

gcc-11.0.0-alpha20201122 snapshot (g:e23f47ec4065e9eec53c4ad9db91bc36a4f90793)
ICEs when compiling the following testcase, reduced from
gcc/testsuite/gcc.target/powerpc/mma-builtin-2.c:

void
x1 (__vector_pair *ur)
{
  __vector_pair dd = *ur;
}

% powerpc-e300c3-linux-gnu-g++-11.0.0 -c lv5swte0.c
lv5swte0.c: In function 'void x1(__vector_pair*)':
lv5swte0.c:4:23: internal compiler error: in digest_init_r, at
cp/typeck2.c:1145
    4 |   __vector_pair dd = *ur;
      |                       ^~
0x69162f digest_init_r
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20201122/work/gcc-11-20201122/gcc/cp/typeck2.c:1145
0xae37ed store_init_value(tree_node*, tree_node*, vec<tree_node*, va_gc,
vl_embed>**, int)
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20201122/work/gcc-11-20201122/gcc/cp/typeck2.c:729
0x930ab0 check_initializer
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20201122/work/gcc-11-20201122/gcc/cp/decl.c:6923
0x956e52 cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20201122/work/gcc-11-20201122/gcc/cp/decl.c:7841
0xa0b1e7 cp_parser_init_declarator
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20201122/work/gcc-11-20201122/gcc/cp/parser.c:21380
0x9e7801 cp_parser_simple_declaration
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20201122/work/gcc-11-20201122/gcc/cp/parser.c:13962
0xa053da cp_parser_declaration_statement
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20201122/work/gcc-11-20201122/gcc/cp/parser.c:13362
0x9e97b4 cp_parser_statement
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20201122/work/gcc-11-20201122/gcc/cp/parser.c:11586
0x9ea902 cp_parser_statement_seq_opt
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20201122/work/gcc-11-20201122/gcc/cp/parser.c:11952
0x9ea9e0 cp_parser_compound_statement
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20201122/work/gcc-11-20201122/gcc/cp/parser.c:11902
0xa0554f cp_parser_function_body
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20201122/work/gcc-11-20201122/gcc/cp/parser.c:23569
0xa0554f cp_parser_ctor_initializer_opt_and_function_body
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20201122/work/gcc-11-20201122/gcc/cp/parser.c:23620
0xa0a360 cp_parser_function_definition_after_declarator
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20201122/work/gcc-11-20201122/gcc/cp/parser.c:29510
0xa0b7ed cp_parser_function_definition_from_specifiers_and_declarator
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20201122/work/gcc-11-20201122/gcc/cp/parser.c:29426
0xa0b7ed cp_parser_init_declarator
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20201122/work/gcc-11-20201122/gcc/cp/parser.c:21142
0x9e7801 cp_parser_simple_declaration
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20201122/work/gcc-11-20201122/gcc/cp/parser.c:13962
0xa15e84 cp_parser_declaration
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20201122/work/gcc-11-20201122/gcc/cp/parser.c:13659
0xa16730 cp_parser_translation_unit
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20201122/work/gcc-11-20201122/gcc/cp/parser.c:4806
0xa16730 c_parse_file()
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20201122/work/gcc-11-20201122/gcc/cp/parser.c:44613
0xb46fb9 c_common_parse_file()
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20201122/work/gcc-11-20201122/gcc/c-family/c-opts.c:1198

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/97947] [11 Regression] ICE in digest_init_r, at cp/typeck2.c:1145
  2020-11-23 12:34 [Bug c++/97947] New: [11 Regression] ICE in digest_init_r, at cp/typeck2.c:1145 asolokha at gmx dot com
@ 2020-11-23 18:23 ` mpolacek at gcc dot gnu.org
  2020-11-23 18:26 ` mpolacek at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-11-23 18:23 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2020-11-23
             Status|UNCONFIRMED                 |NEW
   Target Milestone|---                         |11.0
     Ever confirmed|0                           |1
                 CC|                            |mpolacek at gcc dot gnu.org

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Confirmed with powerpc64le-unknown-linux-gnu cross.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/97947] [11 Regression] ICE in digest_init_r, at cp/typeck2.c:1145
  2020-11-23 12:34 [Bug c++/97947] New: [11 Regression] ICE in digest_init_r, at cp/typeck2.c:1145 asolokha at gmx dot com
  2020-11-23 18:23 ` [Bug c++/97947] " mpolacek at gcc dot gnu.org
@ 2020-11-23 18:26 ` mpolacek at gcc dot gnu.org
  2020-12-01 18:17 ` acsawdey at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-11-23 18:26 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
We crash here

1143   /* Come here only for aggregates: records, arrays, unions, complex
numbers
1144      and vectors.  */
1145   gcc_assert (code == ARRAY_TYPE
1146               || VECTOR_TYPE_P (type)
1147               || code == RECORD_TYPE
1148               || code == UNION_TYPE
1149               || code == COMPLEX_TYPE);

because code == OPAQUE_TYPE.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/97947] [11 Regression] ICE in digest_init_r, at cp/typeck2.c:1145
  2020-11-23 12:34 [Bug c++/97947] New: [11 Regression] ICE in digest_init_r, at cp/typeck2.c:1145 asolokha at gmx dot com
  2020-11-23 18:23 ` [Bug c++/97947] " mpolacek at gcc dot gnu.org
  2020-11-23 18:26 ` mpolacek at gcc dot gnu.org
@ 2020-12-01 18:17 ` acsawdey at gcc dot gnu.org
  2020-12-01 18:18 ` mpolacek at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: acsawdey at gcc dot gnu.org @ 2020-12-01 18:17 UTC (permalink / raw)
  To: gcc-bugs

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

acsawdey at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |acsawdey at gcc dot gnu.org

--- Comment #3 from acsawdey at gcc dot gnu.org ---
I'll take a look at this. Probably missed something when adding OPAQUE_TYPE.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/97947] [11 Regression] ICE in digest_init_r, at cp/typeck2.c:1145
  2020-11-23 12:34 [Bug c++/97947] New: [11 Regression] ICE in digest_init_r, at cp/typeck2.c:1145 asolokha at gmx dot com
                   ` (2 preceding siblings ...)
  2020-12-01 18:17 ` acsawdey at gcc dot gnu.org
@ 2020-12-01 18:18 ` mpolacek at gcc dot gnu.org
  2020-12-01 20:05 ` bergner at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-12-01 18:18 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/97947] [11 Regression] ICE in digest_init_r, at cp/typeck2.c:1145
  2020-11-23 12:34 [Bug c++/97947] New: [11 Regression] ICE in digest_init_r, at cp/typeck2.c:1145 asolokha at gmx dot com
                   ` (3 preceding siblings ...)
  2020-12-01 18:18 ` mpolacek at gcc dot gnu.org
@ 2020-12-01 20:05 ` bergner at gcc dot gnu.org
  2020-12-02  0:27 ` bergner at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: bergner at gcc dot gnu.org @ 2020-12-01 20:05 UTC (permalink / raw)
  To: gcc-bugs

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

Peter Bergner <bergner at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|acsawdey at gcc dot gnu.org        |bergner at gcc dot gnu.org

--- Comment #4 from Peter Bergner <bergner at gcc dot gnu.org> ---
(In reply to acsawdey from comment #3)
> I'll take a look at this. Probably missed something when adding OPAQUE_TYPE.

Aaron and I talked offline and I will actually be looking at this.  I have it
recreated with a native build.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/97947] [11 Regression] ICE in digest_init_r, at cp/typeck2.c:1145
  2020-11-23 12:34 [Bug c++/97947] New: [11 Regression] ICE in digest_init_r, at cp/typeck2.c:1145 asolokha at gmx dot com
                   ` (4 preceding siblings ...)
  2020-12-01 20:05 ` bergner at gcc dot gnu.org
@ 2020-12-02  0:27 ` bergner at gcc dot gnu.org
  2020-12-03  0:14 ` cvs-commit at gcc dot gnu.org
  2020-12-03  0:22 ` bergner at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: bergner at gcc dot gnu.org @ 2020-12-02  0:27 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Peter Bergner <bergner at gcc dot gnu.org> ---
(In reply to Marek Polacek from comment #2)
> We crash here
> 
> 1143   /* Come here only for aggregates: records, arrays, unions, complex
> numbers
> 1144      and vectors.  */
> 1145   gcc_assert (code == ARRAY_TYPE
> 1146               || VECTOR_TYPE_P (type)
> 1147               || code == RECORD_TYPE
> 1148               || code == UNION_TYPE
> 1149               || code == COMPLEX_TYPE);
> 
> because code == OPAQUE_TYPE.

Since OPAQUE_TYPE is a type of aggregate, I modified the assert to allow code
== OPAQUE_TYPE and that fixes the ICE.  I don't feel comfortable sprinkling
other OPAQUE_TYPE usage around anywhere else unless we have a test case that
shows we need it.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/97947] [11 Regression] ICE in digest_init_r, at cp/typeck2.c:1145
  2020-11-23 12:34 [Bug c++/97947] New: [11 Regression] ICE in digest_init_r, at cp/typeck2.c:1145 asolokha at gmx dot com
                   ` (5 preceding siblings ...)
  2020-12-02  0:27 ` bergner at gcc dot gnu.org
@ 2020-12-03  0:14 ` cvs-commit at gcc dot gnu.org
  2020-12-03  0:22 ` bergner at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-12-03  0:14 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Peter Bergner <bergner@gcc.gnu.org>:

https://gcc.gnu.org/g:7e231b2cfbfa5f99bbf581555ca74eaaba42ad7f

commit r11-5687-g7e231b2cfbfa5f99bbf581555ca74eaaba42ad7f
Author: Peter Bergner <bergner@linux.ibm.com>
Date:   Wed Dec 2 18:12:59 2020 -0600

    c++: Treat OPAQUE_TYPE types as an aggregate type [PR97947]

    MODE_OPAQUE and the associated OPAQUE_TYPE were added to stop the
optimizers
    from knowing how the bits in a variable with an opaque type are laid out.
    This makes them a kind of pseudo aggregate type and we need to treat them
    as such when we process the INIT initializer for variables with an
    opaque type.

    2020-12-02  Peter Bergner  <bergner@linux.ibm.com>

    gcc/cp/
            PR c++/97947
            * typeck2.c (digest_init_r): Handle OPAQUE_TYPE as an aggregate
type.

    gcc/testsuite/
            PR c++/97947
            * g++.target/powerpc/pr97947.C: New test.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/97947] [11 Regression] ICE in digest_init_r, at cp/typeck2.c:1145
  2020-11-23 12:34 [Bug c++/97947] New: [11 Regression] ICE in digest_init_r, at cp/typeck2.c:1145 asolokha at gmx dot com
                   ` (6 preceding siblings ...)
  2020-12-03  0:14 ` cvs-commit at gcc dot gnu.org
@ 2020-12-03  0:22 ` bergner at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: bergner at gcc dot gnu.org @ 2020-12-03  0:22 UTC (permalink / raw)
  To: gcc-bugs

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

Peter Bergner <bergner at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED
                URL|                            |https://gcc.gnu.org/piperma
                   |                            |il/gcc-patches/2020-Decembe
                   |                            |r/560922.html

--- Comment #7 from Peter Bergner <bergner at gcc dot gnu.org> ---
Fix pushed to trunk.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-12-03  0:22 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-23 12:34 [Bug c++/97947] New: [11 Regression] ICE in digest_init_r, at cp/typeck2.c:1145 asolokha at gmx dot com
2020-11-23 18:23 ` [Bug c++/97947] " mpolacek at gcc dot gnu.org
2020-11-23 18:26 ` mpolacek at gcc dot gnu.org
2020-12-01 18:17 ` acsawdey at gcc dot gnu.org
2020-12-01 18:18 ` mpolacek at gcc dot gnu.org
2020-12-01 20:05 ` bergner at gcc dot gnu.org
2020-12-02  0:27 ` bergner at gcc dot gnu.org
2020-12-03  0:14 ` cvs-commit at gcc dot gnu.org
2020-12-03  0:22 ` bergner at gcc dot gnu.org

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).