public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ipa/101396] New: ICE in decompose, at wide-int.h:984 building webkitgtk-2.32.2 with -flto -fipa-pta
@ 2021-07-09 18:04 xry111 at mengyan1223 dot wang
  2021-07-10  9:26 ` [Bug ipa/101396] [12 Regression] " xry111 at mengyan1223 dot wang
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: xry111 at mengyan1223 dot wang @ 2021-07-09 18:04 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 101396
           Summary: ICE in decompose, at wide-int.h:984 building
                    webkitgtk-2.32.2 with -flto -fipa-pta
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ipa
          Assignee: unassigned at gcc dot gnu.org
          Reporter: xry111 at mengyan1223 dot wang
                CC: marxin at gcc dot gnu.org
  Target Milestone: ---

during IPA pass: odr
lto1: internal compiler error: in decompose, at wide-int.h:984
0xafd9a6 wi::int_traits<generic_wide_int<wide_int_storage> >::decompose(long*,
unsigned int, generic_wide_int<wide_int_storage> const&)
        ../../gcc/gcc/wide-int.h:984
0xafd5a2 wide_int_ref_storage<true,
false>::wide_int_ref_storage<generic_wide_int<wide_int_storage>
>(generic_wide_int<wide_int_storage> const&, unsigned int)
        ../../gcc/gcc/wide-int.h:1034
0xafb82c generic_wide_int<wide_int_ref_storage<true, false>
>::generic_wide_int<generic_wide_int<wide_int_storage>
>(generic_wide_int<wide_int_storage> const&, unsigned int)
        ../../gcc/gcc/wide-int.h:790
0xafb728 bool wi::eq_p<generic_wide_int<wide_int_storage>,
generic_wide_int<wide_int_storage> >(generic_wide_int<wide_int_storage> const&,
generic_wide_int<wide_int_storage> const&)
        ../../gcc/gcc/wide-int.h:1857
0xd52726 bool wi::ne_p<generic_wide_int<wide_int_storage>,
generic_wide_int<wide_int_storage> >(generic_wide_int<wide_int_storage> const&,
generic_wide_int<wide_int_storage> const&)
        ../../gcc/gcc/wide-int.h:1894
0xd4fbc4 wi::binary_traits<generic_wide_int<wide_int_storage>,
generic_wide_int<wide_int_storage>,
wi::int_traits<generic_wide_int<wide_int_storage> >::precision_type,
wi::int_traits<generic_wide_int<wide_int_storage>
>::precision_type>::predicate_result
operator!=<generic_wide_int<wide_int_storage>,
generic_wide_int<wide_int_storage> >(generic_wide_int<wide_int_storage> const&,
generic_wide_int<wide_int_storage> const&)
        ../../gcc/gcc/wide-int.h:3292
0xe86fa2 ipa_odr_read_section
        ../../gcc/gcc/ipa-devirt.c:4196
0xe87554 ipa_odr_summary_read
        ../../gcc/gcc/ipa-devirt.c:4310
0x10a5d5d ipa_read_summaries_1
        ../../gcc/gcc/passes.c:2904
0x10a5dfe ipa_read_summaries()
        ../../gcc/gcc/passes.c:2929
0xa9d964 read_cgraph_and_symbols(unsigned int, char const**)
        ../../gcc/gcc/lto/lto-common.c:2919
0xa72c70 lto_main()
        ../../gcc/gcc/lto/lto.c:625

I'll do more investigation and attempt to make a testcase tomorrow.

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

* [Bug ipa/101396] [12 Regression] ICE in decompose, at wide-int.h:984 building webkitgtk-2.32.2 with -flto -fipa-pta
  2021-07-09 18:04 [Bug ipa/101396] New: ICE in decompose, at wide-int.h:984 building webkitgtk-2.32.2 with -flto -fipa-pta xry111 at mengyan1223 dot wang
@ 2021-07-10  9:26 ` xry111 at mengyan1223 dot wang
  2021-07-10  9:48 ` [Bug ipa/101396] [12 Regression] ICE in decompose, at wide-int.h:984 with -flto and incompatible enum class definitions xry111 at mengyan1223 dot wang
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: xry111 at mengyan1223 dot wang @ 2021-07-10  9:26 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Xi Ruoyao <xry111 at mengyan1223 dot wang> ---
Testcase:

$ cat a.cpp

enum class A : __INT32_TYPE__ {
        a,
        b,
        c
};

int main()
{
        return (int) A::a;
}

$ cat b.cpp

enum class A : __UINT64_TYPE__ {
        a,
        b,
        c
};

int f(enum A x)
{
        return (int) x;
}

$ ~/gcc-trunk/bin/g++ a.cpp b.cpp -flto

during IPA pass: odr
lto1: internal compiler error: in decompose, at wide-int.h:984

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

* [Bug ipa/101396] [12 Regression] ICE in decompose, at wide-int.h:984 with -flto and incompatible enum class definitions
  2021-07-09 18:04 [Bug ipa/101396] New: ICE in decompose, at wide-int.h:984 building webkitgtk-2.32.2 with -flto -fipa-pta xry111 at mengyan1223 dot wang
  2021-07-10  9:26 ` [Bug ipa/101396] [12 Regression] " xry111 at mengyan1223 dot wang
@ 2021-07-10  9:48 ` xry111 at mengyan1223 dot wang
  2021-07-10 13:18 ` pinskia at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: xry111 at mengyan1223 dot wang @ 2021-07-10  9:48 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Xi Ruoyao <xry111 at mengyan1223 dot wang> ---
Created attachment 51128
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51128&action=edit
proposed patch

Patch proposed.  Will bootstrap & regtest to make sure it correct.

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

* [Bug ipa/101396] [12 Regression] ICE in decompose, at wide-int.h:984 with -flto and incompatible enum class definitions
  2021-07-09 18:04 [Bug ipa/101396] New: ICE in decompose, at wide-int.h:984 building webkitgtk-2.32.2 with -flto -fipa-pta xry111 at mengyan1223 dot wang
  2021-07-10  9:26 ` [Bug ipa/101396] [12 Regression] " xry111 at mengyan1223 dot wang
  2021-07-10  9:48 ` [Bug ipa/101396] [12 Regression] ICE in decompose, at wide-int.h:984 with -flto and incompatible enum class definitions xry111 at mengyan1223 dot wang
@ 2021-07-10 13:18 ` pinskia at gcc dot gnu.org
  2021-07-10 17:50 ` xry111 at mengyan1223 dot wang
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-07-10 13:18 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |12.0

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

* [Bug ipa/101396] [12 Regression] ICE in decompose, at wide-int.h:984 with -flto and incompatible enum class definitions
  2021-07-09 18:04 [Bug ipa/101396] New: ICE in decompose, at wide-int.h:984 building webkitgtk-2.32.2 with -flto -fipa-pta xry111 at mengyan1223 dot wang
                   ` (2 preceding siblings ...)
  2021-07-10 13:18 ` pinskia at gcc dot gnu.org
@ 2021-07-10 17:50 ` xry111 at mengyan1223 dot wang
  2021-07-30  7:59 ` cvs-commit at gcc dot gnu.org
  2021-07-30  8:04 ` xry111 at mengyan1223 dot wang
  5 siblings, 0 replies; 7+ messages in thread
From: xry111 at mengyan1223 dot wang @ 2021-07-10 17:50 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Xi Ruoyao <xry111 at mengyan1223 dot wang> ---
Patch sent to gcc-patches:
https://gcc.gnu.org/pipermail/gcc-patches/2021-July/574890.html

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

* [Bug ipa/101396] [12 Regression] ICE in decompose, at wide-int.h:984 with -flto and incompatible enum class definitions
  2021-07-09 18:04 [Bug ipa/101396] New: ICE in decompose, at wide-int.h:984 building webkitgtk-2.32.2 with -flto -fipa-pta xry111 at mengyan1223 dot wang
                   ` (3 preceding siblings ...)
  2021-07-10 17:50 ` xry111 at mengyan1223 dot wang
@ 2021-07-30  7:59 ` cvs-commit at gcc dot gnu.org
  2021-07-30  8:04 ` xry111 at mengyan1223 dot wang
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-07-30  7:59 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Xi Ruoyao <xry111@gcc.gnu.org>:

https://gcc.gnu.org/g:291416d3782e12e983483a3f7b2154a3dbfc9e1f

commit r12-2606-g291416d3782e12e983483a3f7b2154a3dbfc9e1f
Author: Xi Ruoyao <xry111@mengyan1223.wang>
Date:   Sat Jul 10 17:46:29 2021 +0800

    ipa-devirt: check precision mismatch of enum values [PR101396]

    We are comparing enum values (in wide_int) to check ODR violation.
    However, if we compare two wide_int values with different precision,
    we'll trigger an assert, leading to ICE.  With enum-base introduced
    in C++11, it's easy to sink into this situation.

    To fix the issue, we need to explicitly check this kind of mismatch,
    and emit a proper warning message if there is such one.

    gcc/

            PR ipa/101396
            * ipa-devirt.c (ipa_odr_read_section): Compare the precision of
              enum values, and emit a warning if they mismatch.

    gcc/testsuite/

            PR ipa/101396
            * g++.dg/lto/pr101396_0.C: New test.
            * g++.dg/lto/pr101396_1.C: New test.

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

* [Bug ipa/101396] [12 Regression] ICE in decompose, at wide-int.h:984 with -flto and incompatible enum class definitions
  2021-07-09 18:04 [Bug ipa/101396] New: ICE in decompose, at wide-int.h:984 building webkitgtk-2.32.2 with -flto -fipa-pta xry111 at mengyan1223 dot wang
                   ` (4 preceding siblings ...)
  2021-07-30  7:59 ` cvs-commit at gcc dot gnu.org
@ 2021-07-30  8:04 ` xry111 at mengyan1223 dot wang
  5 siblings, 0 replies; 7+ messages in thread
From: xry111 at mengyan1223 dot wang @ 2021-07-30  8:04 UTC (permalink / raw)
  To: gcc-bugs

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

Xi Ruoyao <xry111 at mengyan1223 dot wang> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|UNCONFIRMED                 |RESOLVED
      Known to work|                            |11.2.0

--- Comment #5 from Xi Ruoyao <xry111 at mengyan1223 dot wang> ---
Fixed in trunk.

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

end of thread, other threads:[~2021-07-30  8:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-09 18:04 [Bug ipa/101396] New: ICE in decompose, at wide-int.h:984 building webkitgtk-2.32.2 with -flto -fipa-pta xry111 at mengyan1223 dot wang
2021-07-10  9:26 ` [Bug ipa/101396] [12 Regression] " xry111 at mengyan1223 dot wang
2021-07-10  9:48 ` [Bug ipa/101396] [12 Regression] ICE in decompose, at wide-int.h:984 with -flto and incompatible enum class definitions xry111 at mengyan1223 dot wang
2021-07-10 13:18 ` pinskia at gcc dot gnu.org
2021-07-10 17:50 ` xry111 at mengyan1223 dot wang
2021-07-30  7:59 ` cvs-commit at gcc dot gnu.org
2021-07-30  8:04 ` xry111 at mengyan1223 dot wang

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