[Bug middle-end/99857] [11 Regression] FAIL: libgomp.c/declare-variant-1.c (test for excess errors) by r11-7926

2021-04-10 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99857

Jakub Jelinek  changed:

   What|Removed |Added

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

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

[Bug middle-end/99857] [11 Regression] FAIL: libgomp.c/declare-variant-1.c (test for excess errors) by r11-7926

2021-04-10 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99857

--- Comment #8 from CVS Commits  ---
The master branch has been updated by Jan Hubicka :

https://gcc.gnu.org/g:1c9744fb3bf2fbf7cec5722f4b187eb553d98280

commit r11-8105-g1c9744fb3bf2fbf7cec5722f4b187eb553d98280
Author: Jan Hubicka 
Date:   Sat Apr 10 11:17:56 2021 +0200

Do not release body of declare_variant_alt

gcc/ChangeLog:

2021-04-10  Jan Hubicka  

PR lto/99857
* tree.c (free_lang_data_in_decl): Do not release body of
declare_variant_alt.

[Bug middle-end/99857] [11 Regression] FAIL: libgomp.c/declare-variant-1.c (test for excess errors) by r11-7926

2021-04-09 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99857

--- Comment #7 from Jakub Jelinek  ---
(In reply to Jan Hubicka from comment #6)
> Thanks for a testcase, it makes things easier to debug indeed :)
> The problem is that openmp uses declare_vairant_alt on symbols to make them
> special definitions, but the definition flag is not set.  That makes
> free_lang_data to call release_body and since the code depends on references
> things gets out of sync.
> 
> I am testing.
> 
> diff --git a/gcc/tree.c b/gcc/tree.c
> index 7c44c226a33..e4e74ac8afc 100644
> --- a/gcc/tree.c
> +++ b/gcc/tree.c
> @@ -5849,7 +5849,7 @@ free_lang_data_in_decl (tree decl, class
> free_lang_data_d *fld)
>if (!(node = cgraph_node::get (decl))
>   || (!node->definition && !node->clones))
> {
> - if (node)
> + if (node && !node->declare_variant_alt)
> node->release_body ();
>   else
> {

Or
-  || (!node->definition && !node->clones))
+  || (!node->definition && !node->clones &&
!node->declare_variant_alt))
?

[Bug middle-end/99857] [11 Regression] FAIL: libgomp.c/declare-variant-1.c (test for excess errors) by r11-7926

2021-04-09 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99857

--- Comment #6 from Jan Hubicka  ---
Thanks for a testcase, it makes things easier to debug indeed :)
The problem is that openmp uses declare_vairant_alt on symbols to make them
special definitions, but the definition flag is not set.  That makes
free_lang_data to call release_body and since the code depends on references
things gets out of sync.

I am testing.

diff --git a/gcc/tree.c b/gcc/tree.c
index 7c44c226a33..e4e74ac8afc 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -5849,7 +5849,7 @@ free_lang_data_in_decl (tree decl, class free_lang_data_d
*fld)
   if (!(node = cgraph_node::get (decl))
  || (!node->definition && !node->clones))
{
- if (node)
+ if (node && !node->declare_variant_alt)
node->release_body ();
  else
{

For next stage1 I think we want to set definition bit for them and remove all
the special cases of declare_vairant_alt that makes them to behave as
definitions. We also want to add checking that !definition symbols are extenral
symbols which is missed in the verifier.

[Bug middle-end/99857] [11 Regression] FAIL: libgomp.c/declare-variant-1.c (test for excess errors) by r11-7926

2021-04-08 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99857

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org
   Priority|P3  |P1

[Bug middle-end/99857] [11 Regression] FAIL: libgomp.c/declare-variant-1.c (test for excess errors) by r11-7926

2021-04-08 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99857

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |11.0

[Bug middle-end/99857] [11 Regression] FAIL: libgomp.c/declare-variant-1.c (test for excess errors) by r11-7926

2021-04-07 Thread asolokha at gmx dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99857

Arseny Solokha  changed:

   What|Removed |Added

 CC||asolokha at gmx dot com

--- Comment #5 from Arseny Solokha  ---
(In reply to Jan Hubicka from comment #4)
> Having smaller testcase is nice - the libgomp one had quite few
> release_body calls at compile time.

How about this one, reduced from
gcc/testsuite/c-c++-common/gomp/declare-variant-5.c?

void
f3 (void);

#pragma omp declare variant(f3) match(construct = {simd})
void
f5 (void)
{
  int i;

#pragma omp simd
  for (i = 0; i < 1; i++)
f5 ();
}

% gcc-11.0.1 -flto -fopenmp -c wskzgdhe.c
during IPA pass: modref
wskzgdhe.c:13:1: internal compiler error: in
omp_lto_output_declare_variant_alt, at omp-general.c:2368
   13 | }
  | ^
0x69caf3 omp_lto_output_declare_variant_alt(lto_simple_output_block*,
cgraph_node*, lto_symtab_encoder_d*)
   
/var/tmp/portage/sys-devel/gcc-11.0.1_alpha20210404/work/gcc-11-20210404/gcc/omp-general.c:2368
0xc8dca6 output_refs
   
/var/tmp/portage/sys-devel/gcc-11.0.1_alpha20210404/work/gcc-11-20210404/gcc/lto-cgraph.c:773
0xc8dca6 output_symtab()
   
/var/tmp/portage/sys-devel/gcc-11.0.1_alpha20210404/work/gcc-11-20210404/gcc/lto-cgraph.c:1017
0xca3961 lto_output()
   
/var/tmp/portage/sys-devel/gcc-11.0.1_alpha20210404/work/gcc-11-20210404/gcc/lto-streamer-out.c:2810
0xd2b351 write_lto
   
/var/tmp/portage/sys-devel/gcc-11.0.1_alpha20210404/work/gcc-11-20210404/gcc/passes.c:2680
0xd2b351 ipa_write_summaries_1
   
/var/tmp/portage/sys-devel/gcc-11.0.1_alpha20210404/work/gcc-11-20210404/gcc/passes.c:2744
0xd2b351 ipa_write_summaries()
   
/var/tmp/portage/sys-devel/gcc-11.0.1_alpha20210404/work/gcc-11-20210404/gcc/passes.c:2800
0x9a176d ipa_passes
   
/var/tmp/portage/sys-devel/gcc-11.0.1_alpha20210404/work/gcc-11-20210404/gcc/cgraphunit.c:2204
0x9a176d symbol_table::compile()
   
/var/tmp/portage/sys-devel/gcc-11.0.1_alpha20210404/work/gcc-11-20210404/gcc/cgraphunit.c:2291
0x9a3f87 symbol_table::compile()
   
/var/tmp/portage/sys-devel/gcc-11.0.1_alpha20210404/work/gcc-11-20210404/gcc/cgraphunit.c:2271
0x9a3f87 symbol_table::finalize_compilation_unit()
   
/var/tmp/portage/sys-devel/gcc-11.0.1_alpha20210404/work/gcc-11-20210404/gcc/cgraphunit.c:2539

[Bug middle-end/99857] [11 Regression] FAIL: libgomp.c/declare-variant-1.c (test for excess errors) by r11-7926

2021-04-06 Thread hubicka at ucw dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99857

--- Comment #4 from Jan Hubicka  ---
> Honza stated that he's "looking into it",
> .
I do just got distracted by easter.  Problem has to be release_body
happening mid offloading streaming process that is bit odd by itself.
Having smaller testcase is nice - the libgomp one had quite few
release_body calls at compile time.

Honza

[Bug middle-end/99857] [11 Regression] FAIL: libgomp.c/declare-variant-1.c (test for excess errors) by r11-7926

2021-04-06 Thread tschwinge at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99857

Thomas Schwinge  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |hubicka at gcc dot 
gnu.org
   Last reconfirmed|2021-04-01 00:00:00 |2021-4-6
 CC||tschwinge at gcc dot gnu.org
 Status|NEW |ASSIGNED

--- Comment #3 from Thomas Schwinge  ---
Honza stated that he's "looking into it",
.

---

With offloading enabled, there are more similar failures:

[-PASS:-]{+FAIL:+} libgomp.c/../libgomp.c-c++-common/task-detach-6.c (test
for excess errors)

[-PASS:-]{+FAIL:+} libgomp.c/pr99555-1.c (test for excess errors)

[-PASS:-]{+FAIL:+} libgomp.c/target-42.c (test for excess errors)

[-PASS:-]{+FAIL:+} libgomp.c++/../libgomp.c-c++-common/task-detach-6.c
(test for excess errors)

[-PASS:-]{+FAIL:+} libgomp.fortran/task-detach-6.f90   -O0  (test for
excess errors)
[-PASS:-]{+FAIL:+} libgomp.fortran/task-detach-6.f90   -O1  (test for
excess errors)
[-PASS:-]{+FAIL:+} libgomp.fortran/task-detach-6.f90   -O2  (test for
excess errors)
[-PASS:-]{+FAIL:+} libgomp.fortran/task-detach-6.f90   -O3
-fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions 
(test for excess errors)
[-PASS:-]{+FAIL:+} libgomp.fortran/task-detach-6.f90   -O3 -g  (test for
excess errors)
[-PASS:-]{+FAIL:+} libgomp.fortran/task-detach-6.f90   -Os  (test for
excess errors)

..., and:

during IPA pass: modref
[...]/libgomp/testsuite/libgomp.c/target-32.c:55:1: internal compiler
error: in omp_lto_output_declare_variant_alt, at omp-general.c:2368

... seen for:

[-PASS:-]{+FAIL: libgomp.c/target-32.c (internal compiler error)+}
{+FAIL:+} libgomp.c/target-32.c (test for excess errors)

[-PASS:-]{+FAIL: libgomp.c/thread-limit-2.c (internal compiler error)+}
{+FAIL:+} libgomp.c/thread-limit-2.c (test for excess errors)

[Bug middle-end/99857] [11 Regression] FAIL: libgomp.c/declare-variant-1.c (test for excess errors) by r11-7926

2021-04-01 Thread hjl.tools at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99857

H.J. Lu  changed:

   What|Removed |Added

 Status|RESOLVED|NEW
 Ever confirmed|0   |1
   Last reconfirmed||2021-04-01
 Resolution|FIXED   |---

--- Comment #2 from H.J. Lu  ---
> Fixed with g:23ce9945d5efa77c96161443f68e03664705ada3.

No, it doesn't fix this regression.

[Bug middle-end/99857] [11 Regression] FAIL: libgomp.c/declare-variant-1.c (test for excess errors) by r11-7926

2021-03-31 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99857

Martin Liška  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|UNCONFIRMED |RESOLVED
 CC||marxin at gcc dot gnu.org

--- Comment #1 from Martin Liška  ---
Fixed with g:23ce9945d5efa77c96161443f68e03664705ada3.