public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/95315] New: [11 Regression] ICE: Segmentation fault (in lookup_page_table_entry)
@ 2020-05-25 14:37 asolokha at gmx dot com
  2020-05-25 14:46 ` [Bug middle-end/95315] " rguenth at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: asolokha at gmx dot com @ 2020-05-25 14:37 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 95315
           Summary: [11 Regression] ICE: Segmentation fault (in
                    lookup_page_table_entry)
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code, openmp
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: asolokha at gmx dot com
  Target Milestone: ---

gcc-11.0.0-alpha20200524 snapshot (g:d176184d98a00ab379ae5959aed1908a79995e6b)
ICEs when compiling gcc/testsuite/c-c++-common/gomp/declare-variant-5.c w/ -O2
-fopenmp --param ggc-min-heapsize=0:

% gcc-11.0.0 -O2 -fopenmp --param ggc-min-heapsize=0 -c
gcc/testsuite/c-c++-common/gomp/declare-variant-5.c
gcc/testsuite/c-c++-common/gomp/declare-variant-5.c: In function 'test':
gcc/testsuite/c-c++-common/gomp/declare-variant-5.c:36:1: internal compiler
error: Segmentation fault
   36 | }
      | ^
0xd9fcff crash_signal
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200524/work/gcc-11-20200524/gcc/toplev.c:328
0x8af45b lookup_page_table_entry
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200524/work/gcc-11-20200524/gcc/ggc-page.c:630
0x8af45b ggc_set_mark(void const*)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200524/work/gcc-11-20200524/gcc/ggc-page.c:1544
0xb0b331 gt_ggc_mx_symtab_node(void*)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200524/work/build/gcc/gtype-desc.c:1300
0xc58316 gt_ggc_mx_omp_declare_variant_base_entry(void*)
        ./gt-omp-general.h:47
0xc58316 gt_ggc_mx_omp_declare_variant_base_entry(void*)
        ./gt-omp-general.h:41
0xc58316 gt_ggc_mx(omp_declare_variant_base_entry*&)
        ./gt-omp-general.h:65
0xc55121
ggc_remove<omp_declare_variant_base_entry*>::ggc_mx(omp_declare_variant_base_entry*&)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200524/work/gcc-11-20200524/gcc/hash-traits.h:237
0xc55121
ggc_remove<omp_declare_variant_base_entry*>::ggc_maybe_mx(omp_declare_variant_base_entry*&)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200524/work/gcc-11-20200524/gcc/hash-traits.h:244
0xc55121 gt_ggc_mx<omp_declare_variant_alt_hasher>
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200524/work/gcc-11-20200524/gcc/hash-table.h:1163
0xc55121 gt_ggc_mx_hash_table_omp_declare_variant_alt_hasher_(void*)
        ./gt-omp-general.h:90
0xc55121 gt_ggc_mx_hash_table_omp_declare_variant_alt_hasher_(void*)
        ./gt-omp-general.h:85
0xa93055 ggc_mark_root_tab
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200524/work/gcc-11-20200524/gcc/ggc-common.c:78
0xa9336c ggc_mark_roots()
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200524/work/gcc-11-20200524/gcc/ggc-common.c:95
0x8afdc8 ggc_collect()
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200524/work/gcc-11-20200524/gcc/ggc-page.c:2220

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

* [Bug middle-end/95315] [11 Regression] ICE: Segmentation fault (in lookup_page_table_entry)
  2020-05-25 14:37 [Bug middle-end/95315] New: [11 Regression] ICE: Segmentation fault (in lookup_page_table_entry) asolokha at gmx dot com
@ 2020-05-25 14:46 ` rguenth at gcc dot gnu.org
  2020-05-26  7:21 ` [Bug middle-end/95315] [11 Regression] ICE: Segmentation fault (in lookup_page_table_entry) since r11-382-g7a50e7087567cffb marxin at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-05-25 14:46 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |11.0
                 CC|                            |jakub at gcc dot gnu.org

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

* [Bug middle-end/95315] [11 Regression] ICE: Segmentation fault (in lookup_page_table_entry) since r11-382-g7a50e7087567cffb
  2020-05-25 14:37 [Bug middle-end/95315] New: [11 Regression] ICE: Segmentation fault (in lookup_page_table_entry) asolokha at gmx dot com
  2020-05-25 14:46 ` [Bug middle-end/95315] " rguenth at gcc dot gnu.org
@ 2020-05-26  7:21 ` marxin at gcc dot gnu.org
  2020-05-26 11:50 ` jakub at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-05-26  7:21 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |marxin at gcc dot gnu.org
      Known to fail|                            |11.0
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2020-05-26
     Ever confirmed|0                           |1
      Known to work|                            |10.1.0
            Summary|[11 Regression] ICE:        |[11 Regression] ICE:
                   |Segmentation fault (in      |Segmentation fault (in
                   |lookup_page_table_entry)    |lookup_page_table_entry)
                   |                            |since
                   |                            |r11-382-g7a50e7087567cffb

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r11-382-g7a50e7087567cffb.

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

* [Bug middle-end/95315] [11 Regression] ICE: Segmentation fault (in lookup_page_table_entry) since r11-382-g7a50e7087567cffb
  2020-05-25 14:37 [Bug middle-end/95315] New: [11 Regression] ICE: Segmentation fault (in lookup_page_table_entry) asolokha at gmx dot com
  2020-05-25 14:46 ` [Bug middle-end/95315] " rguenth at gcc dot gnu.org
  2020-05-26  7:21 ` [Bug middle-end/95315] [11 Regression] ICE: Segmentation fault (in lookup_page_table_entry) since r11-382-g7a50e7087567cffb marxin at gcc dot gnu.org
@ 2020-05-26 11:50 ` jakub at gcc dot gnu.org
  2020-05-27  8:30 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-05-26 11:50 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |jakub at gcc dot gnu.org
             Status|NEW                         |ASSIGNED

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 48603
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48603&action=edit
gcc11-pr95315.patch

Untested fix.

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

* [Bug middle-end/95315] [11 Regression] ICE: Segmentation fault (in lookup_page_table_entry) since r11-382-g7a50e7087567cffb
  2020-05-25 14:37 [Bug middle-end/95315] New: [11 Regression] ICE: Segmentation fault (in lookup_page_table_entry) asolokha at gmx dot com
                   ` (2 preceding siblings ...)
  2020-05-26 11:50 ` jakub at gcc dot gnu.org
@ 2020-05-27  8:30 ` cvs-commit at gcc dot gnu.org
  2020-05-27 10:53 ` asolokha at gmx dot com
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-05-27  8:30 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 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:baff22c48bdee9cb644b7336bf6f20f799531507

commit r11-653-gbaff22c48bdee9cb644b7336bf6f20f799531507
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Wed May 27 10:25:56 2020 +0200

    openmp: Fix up omp_declare_variant{s,_alt} htab handling

    This patch fixes a GC ICE.  During debugging, I've found that during
    gimplification we can actually call omp_resolve_declare_variant multiple
    times and it would create a new magic declare_variant_alt FUNCTION_DECL
    each time, which is undesirable, once we have such a decl, we should just
    use that.  The other problem is that there was no cgraph node removal hook.
    As the omp_declare_variants htab is used just early during gimplification,
    we can just clear the whole htab, rather than trying to lookup and remove
    a particular entry.  The other hash table is used later as well and that
    one uses just DECL_UID as hash, so in that case the patch removes the elt.

    2020-05-27  Jakub Jelinek  <jakub@redhat.com>

            PR middle-end/95315
            * omp-general.c (omp_declare_variant_remove_hook): New function.
            (omp_resolve_declare_variant): Always return base if it is already
            declare_variant_alt magic decl itself.  Register
            omp_declare_variant_remove_hook as cgraph node removal hook.

            * gcc.dg/gomp/pr95315.c: New test.

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

* [Bug middle-end/95315] [11 Regression] ICE: Segmentation fault (in lookup_page_table_entry) since r11-382-g7a50e7087567cffb
  2020-05-25 14:37 [Bug middle-end/95315] New: [11 Regression] ICE: Segmentation fault (in lookup_page_table_entry) asolokha at gmx dot com
                   ` (3 preceding siblings ...)
  2020-05-27  8:30 ` cvs-commit at gcc dot gnu.org
@ 2020-05-27 10:53 ` asolokha at gmx dot com
  2020-05-27 10:57 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: asolokha at gmx dot com @ 2020-05-27 10:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Arseny Solokha <asolokha at gmx dot com> ---
(In reply to Jakub Jelinek from comment #2)
> Created attachment 48603 [details]
> gcc11-pr95315.patch
> 
> Untested fix.

@@ -1823,6 +1850,12 @@ omp_resolve_declare_variant (tree base)
            }
        }

+      static struct cgraph_node_hook_list *node_removal_hook_holder;
+      if (node_removal_hook_holder)
+       node_removal_hook_holder
+         = symtab->add_cgraph_removal_hook (omp_declare_variant_remove_hook,
+                                            NULL);
+
       if (omp_declare_variants == NULL)
        omp_declare_variants
          = hash_table<omp_declare_variant_hasher>::create_ggc (64);

Shouldn't there be

  if (!node_removal_hook_holder)
    node_removal_hook_holder
      = symtab->add_cgraph_removal_hook (…

instead?

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

* [Bug middle-end/95315] [11 Regression] ICE: Segmentation fault (in lookup_page_table_entry) since r11-382-g7a50e7087567cffb
  2020-05-25 14:37 [Bug middle-end/95315] New: [11 Regression] ICE: Segmentation fault (in lookup_page_table_entry) asolokha at gmx dot com
                   ` (4 preceding siblings ...)
  2020-05-27 10:53 ` asolokha at gmx dot com
@ 2020-05-27 10:57 ` jakub at gcc dot gnu.org
  2020-05-29  8:50 ` cvs-commit at gcc dot gnu.org
  2020-05-29  9:42 ` jakub at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-05-27 10:57 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Arseny Solokha from comment #4)
> Shouldn't there be
> 
>   if (!node_removal_hook_holder)
>     node_removal_hook_holder
>       = symtab->add_cgraph_removal_hook (…
> 
> instead?

Of course, good catch.  For the particular testcase, only the non-removal_hook
related part of the patch is sufficient, and I didn't try to come up with a
testcase where a function is originally needed, but e.g. early inlining makes
it go away.  Will try to construct that and see if the removal hook fix will
fix that.

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

* [Bug middle-end/95315] [11 Regression] ICE: Segmentation fault (in lookup_page_table_entry) since r11-382-g7a50e7087567cffb
  2020-05-25 14:37 [Bug middle-end/95315] New: [11 Regression] ICE: Segmentation fault (in lookup_page_table_entry) asolokha at gmx dot com
                   ` (5 preceding siblings ...)
  2020-05-27 10:57 ` jakub at gcc dot gnu.org
@ 2020-05-29  8:50 ` cvs-commit at gcc dot gnu.org
  2020-05-29  9:42 ` jakub at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-05-29  8:50 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 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:3d0675f3bb54b58903bc9214d05c8e6d20e5f313

commit r11-712-g3d0675f3bb54b58903bc9214d05c8e6d20e5f313
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Fri May 29 10:48:40 2020 +0200

    openmp: One omp_resolve_declare_variant followup

    As noticed by Arseny, I got the condition when to call the add removal hook
    wrong wrong.  Fixed thusly.

    2020-05-28  Jakub Jelinek  <jakub@redhat.com>

            PR middle-end/95315
            * omp-general.c (omp_resolve_declare_variant): Fix up addition of
            declare variant cgraph node removal callback.

            * gcc.dg/gomp/pr95315-2.c: New test.

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

* [Bug middle-end/95315] [11 Regression] ICE: Segmentation fault (in lookup_page_table_entry) since r11-382-g7a50e7087567cffb
  2020-05-25 14:37 [Bug middle-end/95315] New: [11 Regression] ICE: Segmentation fault (in lookup_page_table_entry) asolokha at gmx dot com
                   ` (6 preceding siblings ...)
  2020-05-29  8:50 ` cvs-commit at gcc dot gnu.org
@ 2020-05-29  9:42 ` jakub at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-05-29  9:42 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed.

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

end of thread, other threads:[~2020-05-29  9:42 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-25 14:37 [Bug middle-end/95315] New: [11 Regression] ICE: Segmentation fault (in lookup_page_table_entry) asolokha at gmx dot com
2020-05-25 14:46 ` [Bug middle-end/95315] " rguenth at gcc dot gnu.org
2020-05-26  7:21 ` [Bug middle-end/95315] [11 Regression] ICE: Segmentation fault (in lookup_page_table_entry) since r11-382-g7a50e7087567cffb marxin at gcc dot gnu.org
2020-05-26 11:50 ` jakub at gcc dot gnu.org
2020-05-27  8:30 ` cvs-commit at gcc dot gnu.org
2020-05-27 10:53 ` asolokha at gmx dot com
2020-05-27 10:57 ` jakub at gcc dot gnu.org
2020-05-29  8:50 ` cvs-commit at gcc dot gnu.org
2020-05-29  9:42 ` jakub 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).