[Bug middle-end/95315] [11 Regression] ICE: Segmentation fault (in lookup_page_table_entry) since r11-382-g7a50e7087567cffb

2020-05-29 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95315

Jakub Jelinek  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #7 from Jakub Jelinek  ---
Fixed.

[Bug middle-end/95315] [11 Regression] ICE: Segmentation fault (in lookup_page_table_entry) since r11-382-g7a50e7087567cffb

2020-05-29 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95315

--- Comment #6 from CVS Commits  ---
The master branch has been updated by Jakub Jelinek :

https://gcc.gnu.org/g:3d0675f3bb54b58903bc9214d05c8e6d20e5f313

commit r11-712-g3d0675f3bb54b58903bc9214d05c8e6d20e5f313
Author: Jakub Jelinek 
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  

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.

[Bug middle-end/95315] [11 Regression] ICE: Segmentation fault (in lookup_page_table_entry) since r11-382-g7a50e7087567cffb

2020-05-27 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95315

--- Comment #5 from Jakub Jelinek  ---
(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.

[Bug middle-end/95315] [11 Regression] ICE: Segmentation fault (in lookup_page_table_entry) since r11-382-g7a50e7087567cffb

2020-05-27 Thread asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95315

--- Comment #4 from Arseny Solokha  ---
(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::create_ggc (64);

Shouldn't there be

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

instead?

[Bug middle-end/95315] [11 Regression] ICE: Segmentation fault (in lookup_page_table_entry) since r11-382-g7a50e7087567cffb

2020-05-27 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95315

--- Comment #3 from CVS Commits  ---
The master branch has been updated by Jakub Jelinek :

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

commit r11-653-gbaff22c48bdee9cb644b7336bf6f20f799531507
Author: Jakub Jelinek 
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  

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.

[Bug middle-end/95315] [11 Regression] ICE: Segmentation fault (in lookup_page_table_entry) since r11-382-g7a50e7087567cffb

2020-05-26 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95315

Jakub Jelinek  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  ---
Created attachment 48603
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48603=edit
gcc11-pr95315.patch

Untested fix.

[Bug middle-end/95315] [11 Regression] ICE: Segmentation fault (in lookup_page_table_entry) since r11-382-g7a50e7087567cffb

2020-05-26 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95315

Martin Liška  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  ---
Started with r11-382-g7a50e7087567cffb.