public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/95548] New: ice in tree_to_shwi, at tree.c:7321
@ 2020-06-05  6:51 dcb314 at hotmail dot com
  2020-06-05  8:12 ` [Bug c++/95548] " dcb314 at hotmail dot com
                   ` (9 more replies)
  0 siblings, 10 replies; 13+ messages in thread
From: dcb314 at hotmail dot com @ 2020-06-05  6:51 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 95548
           Summary: ice in tree_to_shwi, at tree.c:7321
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

Created attachment 48681
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48681&action=edit
gzipped C++ source code

For the attached C++ code, with recent gcc trunk and
compiler flags -flto and -std=c++17, does this:

during IPA pass: odr
assert.cc:52:1: internal compiler error: in tree_to_shwi, at tree.c:7321
0x1238302 tree_to_shwi(tree_node const*)
        ../../trunk.git/gcc/tree.c:7321
0xce5418 ipa_odr_summary_write()
        ../../trunk.git/gcc/ipa-devirt.c:4051
0xe7843a ipa_write_summaries_2(opt_pass*, lto_out_decl_state*)
        ../../trunk.git/gcc/passes.c:2645
0xe76f5a ipa_write_summaries_1(lto_symtab_encoder_d*)
        ../../trunk.git/gcc/passes.c:2676

The bug first seems to appear sometime between 20200603 and
20200604.

I'll have a go at reducing the code.

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

* [Bug c++/95548] ice in tree_to_shwi, at tree.c:7321
  2020-06-05  6:51 [Bug c++/95548] New: ice in tree_to_shwi, at tree.c:7321 dcb314 at hotmail dot com
@ 2020-06-05  8:12 ` dcb314 at hotmail dot com
  2020-06-05  9:50 ` [Bug lto/95548] " rguenth at gcc dot gnu.org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: dcb314 at hotmail dot com @ 2020-06-05  8:12 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from David Binderman <dcb314 at hotmail dot com> ---
Reduced C++ code is

enum a { b = (unsigned long)-1 } c;

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

* [Bug lto/95548] ice in tree_to_shwi, at tree.c:7321
  2020-06-05  6:51 [Bug c++/95548] New: ice in tree_to_shwi, at tree.c:7321 dcb314 at hotmail dot com
  2020-06-05  8:12 ` [Bug c++/95548] " dcb314 at hotmail dot com
@ 2020-06-05  9:50 ` rguenth at gcc dot gnu.org
  2020-06-05 10:46   ` Jan Hubicka
  2020-06-05 10:46 ` hubicka at ucw dot cz
                   ` (7 subsequent siblings)
  9 siblings, 1 reply; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-06-05  9:50 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hubicka at gcc dot gnu.org,
                   |                            |marxin at gcc dot gnu.org
            Version|unknown                     |11.0
          Component|c++                         |lto

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
I think Honza ran into this himself.

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

* Re: [Bug lto/95548] ice in tree_to_shwi, at tree.c:7321
  2020-06-05  9:50 ` [Bug lto/95548] " rguenth at gcc dot gnu.org
@ 2020-06-05 10:46   ` Jan Hubicka
  2020-06-05 10:52     ` Jakub Jelinek
  0 siblings, 1 reply; 13+ messages in thread
From: Jan Hubicka @ 2020-06-05 10:46 UTC (permalink / raw)
  To: rguenth at gcc dot gnu.org; +Cc: gcc-bugs

> I think Honza ran into this himself.
Yep, i converted code to use wide-ints. But it is nice to have short
testcase.

Honza


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

* [Bug lto/95548] ice in tree_to_shwi, at tree.c:7321
  2020-06-05  6:51 [Bug c++/95548] New: ice in tree_to_shwi, at tree.c:7321 dcb314 at hotmail dot com
  2020-06-05  8:12 ` [Bug c++/95548] " dcb314 at hotmail dot com
  2020-06-05  9:50 ` [Bug lto/95548] " rguenth at gcc dot gnu.org
@ 2020-06-05 10:46 ` hubicka at ucw dot cz
  2020-06-05 10:52 ` jakub at redhat dot com
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: hubicka at ucw dot cz @ 2020-06-05 10:46 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jan Hubicka <hubicka at ucw dot cz> ---
> I think Honza ran into this himself.
Yep, i converted code to use wide-ints. But it is nice to have short
testcase.

Honza

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

* Re: [Bug lto/95548] ice in tree_to_shwi, at tree.c:7321
  2020-06-05 10:46   ` Jan Hubicka
@ 2020-06-05 10:52     ` Jakub Jelinek
  0 siblings, 0 replies; 13+ messages in thread
From: Jakub Jelinek @ 2020-06-05 10:52 UTC (permalink / raw)
  To: Jan Hubicka; +Cc: rguenth at gcc dot gnu.org, gcc-bugs

On Fri, Jun 05, 2020 at 12:46:15PM +0200, Jan Hubicka wrote:
> > I think Honza ran into this himself.
> Yep, i converted code to use wide-ints. But it is nice to have short
> testcase.

For the testsuite perhaps also add another one with __int128_t and/or
__uint128_t enumerators (guarded with #ifdef __SIZEOF_INT128__).

	Jakub



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

* [Bug lto/95548] ice in tree_to_shwi, at tree.c:7321
  2020-06-05  6:51 [Bug c++/95548] New: ice in tree_to_shwi, at tree.c:7321 dcb314 at hotmail dot com
                   ` (2 preceding siblings ...)
  2020-06-05 10:46 ` hubicka at ucw dot cz
@ 2020-06-05 10:52 ` jakub at redhat dot com
  2020-06-06 20:20 ` cvs-commit at gcc dot gnu.org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: jakub at redhat dot com @ 2020-06-05 10:52 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Jakub Jelinek <jakub at redhat dot com> ---
On Fri, Jun 05, 2020 at 12:46:15PM +0200, Jan Hubicka wrote:
> > I think Honza ran into this himself.
> Yep, i converted code to use wide-ints. But it is nice to have short
> testcase.

For the testsuite perhaps also add another one with __int128_t and/or
__uint128_t enumerators (guarded with #ifdef __SIZEOF_INT128__).

        Jakub

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

* [Bug lto/95548] ice in tree_to_shwi, at tree.c:7321
  2020-06-05  6:51 [Bug c++/95548] New: ice in tree_to_shwi, at tree.c:7321 dcb314 at hotmail dot com
                   ` (3 preceding siblings ...)
  2020-06-05 10:52 ` jakub at redhat dot com
@ 2020-06-06 20:20 ` cvs-commit at gcc dot gnu.org
  2020-06-08  8:11 ` ro at gcc dot gnu.org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-06-06 20:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jan Hubicka <hubicka@gcc.gnu.org>:

https://gcc.gnu.org/g:eca7a60bd24ebd91addd785e420a06d8f5086634

commit r11-1016-geca7a60bd24ebd91addd785e420a06d8f5086634
Author: Jan Hubicka <jh@suse.cz>
Date:   Sat Jun 6 22:19:46 2020 +0200

    Fix ICE in ODR enum streaming [PR95548]

    gcc/ChangeLog:

    2020-06-06  Jan Hubicka  <hubicka@ucw.cz>

            PR lto/95548
            * ipa-devirt.c (struct odr_enum_val): Turn values to wide_int.
            (ipa_odr_summary_write): Update streaming.
            (ipa_odr_read_section): Update streaming.

    gcc/testsuite/ChangeLog:

    2020-06-06  Jan Hubicka  <hubicka@ucw.cz>

            * g++.dg/torture/pr95548.C: New test.

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

* [Bug lto/95548] ice in tree_to_shwi, at tree.c:7321
  2020-06-05  6:51 [Bug c++/95548] New: ice in tree_to_shwi, at tree.c:7321 dcb314 at hotmail dot com
                   ` (4 preceding siblings ...)
  2020-06-06 20:20 ` cvs-commit at gcc dot gnu.org
@ 2020-06-08  8:11 ` ro at gcc dot gnu.org
  2020-06-08  8:31 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: ro at gcc dot gnu.org @ 2020-06-08  8:11 UTC (permalink / raw)
  To: gcc-bugs

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

Rainer Orth <ro at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ro at gcc dot gnu.org

--- Comment #6 from Rainer Orth <ro at gcc dot gnu.org> ---
The new testcase FAILs everywhere:

+FAIL: g++.dg/torture/pr95548.C   -O0  (test for excess errors)
+FAIL: g++.dg/torture/pr95548.C   -O1  (test for excess errors)
+FAIL: g++.dg/torture/pr95548.C   -O2  (test for excess errors)
+FAIL: g++.dg/torture/pr95548.C   -O2 -flto  (test for excess errors)
+FAIL: g++.dg/torture/pr95548.C   -O2 -flto -flto-partition=none  (test for
excess errors)
+FAIL: g++.dg/torture/pr95548.C   -O3 -g  (test for excess errors)
+FAIL: g++.dg/torture/pr95548.C   -Os  (test for excess errors)

Excess errors:
/vol/gcc/src/hg/master/local/gcc/testsuite/g++.dg/torture/pr95548.C:6:1:
warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]

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

* [Bug lto/95548] ice in tree_to_shwi, at tree.c:7321
  2020-06-05  6:51 [Bug c++/95548] New: ice in tree_to_shwi, at tree.c:7321 dcb314 at hotmail dot com
                   ` (5 preceding siblings ...)
  2020-06-08  8:11 ` ro at gcc dot gnu.org
@ 2020-06-08  8:31 ` cvs-commit at gcc dot gnu.org
  2020-08-13 15:50 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-06-08  8:31 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:296d644b9f526e44fbe574426f24799c1d545fd3

commit r11-1064-g296d644b9f526e44fbe574426f24799c1d545fd3
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Mon Jun 8 10:30:48 2020 +0200

    testsuite: Fix up pr95548.C testcase.

    2020-06-08  Jakub Jelinek  <jakub@redhat.com>

            PR lto/95548
            * g++.dg/torture/pr95548.C: Change from dg-do compile to dg-do
link,
            add return type for main, for __SIZEOF_INT128__ test with
__uint128_t
            enumerator constants and add a test with unsigned long long
            enumerators for all targets.

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

* [Bug lto/95548] ice in tree_to_shwi, at tree.c:7321
  2020-06-05  6:51 [Bug c++/95548] New: ice in tree_to_shwi, at tree.c:7321 dcb314 at hotmail dot com
                   ` (6 preceding siblings ...)
  2020-06-08  8:31 ` cvs-commit at gcc dot gnu.org
@ 2020-08-13 15:50 ` cvs-commit at gcc dot gnu.org
  2020-08-14 16:28 ` cvs-commit at gcc dot gnu.org
  2021-04-21  1:08 ` pinskia at gcc dot gnu.org
  9 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-08-13 15:50 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Jan Hubicka
<hubicka@gcc.gnu.org>:

https://gcc.gnu.org/g:aa81d093bf26a263131ecc1add04e27274457bb9

commit r10-8625-gaa81d093bf26a263131ecc1add04e27274457bb9
Author: Jan Hubicka <jh@suse.cz>
Date:   Sat Jun 6 22:19:46 2020 +0200

    Fix ICE in ODR enum streaming [PR95548]

    gcc/ChangeLog:

    2020-06-06  Jan Hubicka  <hubicka@ucw.cz>

            PR lto/95548
            * ipa-devirt.c (struct odr_enum_val): Turn values to wide_int.
            (ipa_odr_summary_write): Update streaming.
            (ipa_odr_read_section): Update streaming.

    gcc/testsuite/ChangeLog:

    2020-06-06  Jan Hubicka  <hubicka@ucw.cz>

            * g++.dg/torture/pr95548.C: New test.

    (cherry picked from commit eca7a60bd24ebd91addd785e420a06d8f5086634)

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

* [Bug lto/95548] ice in tree_to_shwi, at tree.c:7321
  2020-06-05  6:51 [Bug c++/95548] New: ice in tree_to_shwi, at tree.c:7321 dcb314 at hotmail dot com
                   ` (7 preceding siblings ...)
  2020-08-13 15:50 ` cvs-commit at gcc dot gnu.org
@ 2020-08-14 16:28 ` cvs-commit at gcc dot gnu.org
  2021-04-21  1:08 ` pinskia at gcc dot gnu.org
  9 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-08-14 16:28 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Jan Hubicka
<hubicka@gcc.gnu.org>:

https://gcc.gnu.org/g:eae728e6597727393b96886c77dbf0727a9fa720

commit r10-8630-geae728e6597727393b96886c77dbf0727a9fa720
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Mon Jun 8 10:30:48 2020 +0200

    testsuite: Fix up pr95548.C testcase.

    2020-06-08  Jakub Jelinek  <jakub@redhat.com>

            PR lto/95548
            * g++.dg/torture/pr95548.C: Change from dg-do compile to dg-do
link,
            add return type for main, for __SIZEOF_INT128__ test with
__uint128_t
            enumerator constants and add a test with unsigned long long
            enumerators for all targets.

    (cherry picked from commit 296d644b9f526e44fbe574426f24799c1d545fd3)

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

* [Bug lto/95548] ice in tree_to_shwi, at tree.c:7321
  2020-06-05  6:51 [Bug c++/95548] New: ice in tree_to_shwi, at tree.c:7321 dcb314 at hotmail dot com
                   ` (8 preceding siblings ...)
  2020-08-14 16:28 ` cvs-commit at gcc dot gnu.org
@ 2021-04-21  1:08 ` pinskia at gcc dot gnu.org
  9 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-04-21  1:08 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code
   Target Milestone|---                         |10.3
         Resolution|---                         |FIXED
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #10 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Fixed for a few months now.

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

end of thread, other threads:[~2021-04-21  1:08 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-05  6:51 [Bug c++/95548] New: ice in tree_to_shwi, at tree.c:7321 dcb314 at hotmail dot com
2020-06-05  8:12 ` [Bug c++/95548] " dcb314 at hotmail dot com
2020-06-05  9:50 ` [Bug lto/95548] " rguenth at gcc dot gnu.org
2020-06-05 10:46   ` Jan Hubicka
2020-06-05 10:52     ` Jakub Jelinek
2020-06-05 10:46 ` hubicka at ucw dot cz
2020-06-05 10:52 ` jakub at redhat dot com
2020-06-06 20:20 ` cvs-commit at gcc dot gnu.org
2020-06-08  8:11 ` ro at gcc dot gnu.org
2020-06-08  8:31 ` cvs-commit at gcc dot gnu.org
2020-08-13 15:50 ` cvs-commit at gcc dot gnu.org
2020-08-14 16:28 ` cvs-commit at gcc dot gnu.org
2021-04-21  1:08 ` pinskia 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).