public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/99857] New: [11 Regression] FAIL: libgomp.c/declare-variant-1.c (test for excess errors) by r11-7926
@ 2021-03-31 20:58 hjl.tools at gmail dot com
  2021-04-01  4:43 ` [Bug middle-end/99857] " marxin at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: hjl.tools at gmail dot com @ 2021-03-31 20:58 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 99857
           Summary: [11 Regression] FAIL: libgomp.c/declare-variant-1.c
                    (test for excess errors) by r11-7926
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hjl.tools at gmail dot com
                CC: jh at suse dot cz
  Target Milestone: ---

r11-7926 caused:

lto1: fatal error: bytecode stream: trying to read 0 bytes after the end of the
input buffer^M
compilation terminated.^M
lto-wrapper: fatal error:
/export/users/hjl/build/gnu/tools-build/gcc-32bit-gitlab-native/build-i686-linux/./gcc/xgcc
returned 1 exit status^M
compilation terminated.^M
/usr/local32/bin/ld: error: lto-wrapper failed^M
collect2: error: ld returned 1 exit status^M
See ":er exited with status 1.
FAIL: libgomp.c/declare-variant-1.c (test for excess errors)fter the end of the
Excess errors:

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

* [Bug middle-end/99857] [11 Regression] FAIL: libgomp.c/declare-variant-1.c (test for excess errors) by r11-7926
  2021-03-31 20:58 [Bug middle-end/99857] New: [11 Regression] FAIL: libgomp.c/declare-variant-1.c (test for excess errors) by r11-7926 hjl.tools at gmail dot com
@ 2021-04-01  4:43 ` marxin at gcc dot gnu.org
  2021-04-01 12:22 ` hjl.tools at gmail dot com
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-04-01  4:43 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Fixed with g:23ce9945d5efa77c96161443f68e03664705ada3.

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

* [Bug middle-end/99857] [11 Regression] FAIL: libgomp.c/declare-variant-1.c (test for excess errors) by r11-7926
  2021-03-31 20:58 [Bug middle-end/99857] New: [11 Regression] FAIL: libgomp.c/declare-variant-1.c (test for excess errors) by r11-7926 hjl.tools at gmail dot com
  2021-04-01  4:43 ` [Bug middle-end/99857] " marxin at gcc dot gnu.org
@ 2021-04-01 12:22 ` hjl.tools at gmail dot com
  2021-04-06 12:19 ` tschwinge at gcc dot gnu.org
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: hjl.tools at gmail dot com @ 2021-04-01 12:22 UTC (permalink / raw)
  To: gcc-bugs

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

H.J. Lu <hjl.tools at gmail dot com> changed:

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

--- Comment #2 from H.J. Lu <hjl.tools at gmail dot com> ---
> Fixed with g:23ce9945d5efa77c96161443f68e03664705ada3.

No, it doesn't fix this regression.

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

* [Bug middle-end/99857] [11 Regression] FAIL: libgomp.c/declare-variant-1.c (test for excess errors) by r11-7926
  2021-03-31 20:58 [Bug middle-end/99857] New: [11 Regression] FAIL: libgomp.c/declare-variant-1.c (test for excess errors) by r11-7926 hjl.tools at gmail dot com
  2021-04-01  4:43 ` [Bug middle-end/99857] " marxin at gcc dot gnu.org
  2021-04-01 12:22 ` hjl.tools at gmail dot com
@ 2021-04-06 12:19 ` tschwinge at gcc dot gnu.org
  2021-04-06 13:33 ` hubicka at ucw dot cz
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: tschwinge at gcc dot gnu.org @ 2021-04-06 12:19 UTC (permalink / raw)
  To: gcc-bugs

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

Thomas Schwinge <tschwinge at gcc dot gnu.org> 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 <tschwinge at gcc dot gnu.org> ---
Honza stated that he's "looking into it",
<http://mid.mail-archive.com/20210401092922.GE3851@kam.mff.cuni.cz>.

---

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)

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

* [Bug middle-end/99857] [11 Regression] FAIL: libgomp.c/declare-variant-1.c (test for excess errors) by r11-7926
  2021-03-31 20:58 [Bug middle-end/99857] New: [11 Regression] FAIL: libgomp.c/declare-variant-1.c (test for excess errors) by r11-7926 hjl.tools at gmail dot com
                   ` (2 preceding siblings ...)
  2021-04-06 12:19 ` tschwinge at gcc dot gnu.org
@ 2021-04-06 13:33 ` hubicka at ucw dot cz
  2021-04-08  3:01 ` asolokha at gmx dot com
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: hubicka at ucw dot cz @ 2021-04-06 13:33 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Jan Hubicka <hubicka at ucw dot cz> ---
> Honza stated that he's "looking into it",
> <http://mid.mail-archive.com/20210401092922.GE3851@kam.mff.cuni.cz>.
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

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

* [Bug middle-end/99857] [11 Regression] FAIL: libgomp.c/declare-variant-1.c (test for excess errors) by r11-7926
  2021-03-31 20:58 [Bug middle-end/99857] New: [11 Regression] FAIL: libgomp.c/declare-variant-1.c (test for excess errors) by r11-7926 hjl.tools at gmail dot com
                   ` (3 preceding siblings ...)
  2021-04-06 13:33 ` hubicka at ucw dot cz
@ 2021-04-08  3:01 ` asolokha at gmx dot com
  2021-04-08 14:25 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: asolokha at gmx dot com @ 2021-04-08  3:01 UTC (permalink / raw)
  To: gcc-bugs

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

Arseny Solokha <asolokha at gmx dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |asolokha at gmx dot com

--- Comment #5 from Arseny Solokha <asolokha at gmx dot com> ---
(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

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

* [Bug middle-end/99857] [11 Regression] FAIL: libgomp.c/declare-variant-1.c (test for excess errors) by r11-7926
  2021-03-31 20:58 [Bug middle-end/99857] New: [11 Regression] FAIL: libgomp.c/declare-variant-1.c (test for excess errors) by r11-7926 hjl.tools at gmail dot com
                   ` (4 preceding siblings ...)
  2021-04-08  3:01 ` asolokha at gmx dot com
@ 2021-04-08 14:25 ` rguenth at gcc dot gnu.org
  2021-04-08 14:35 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-04-08 14:25 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |11.0

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

* [Bug middle-end/99857] [11 Regression] FAIL: libgomp.c/declare-variant-1.c (test for excess errors) by r11-7926
  2021-03-31 20:58 [Bug middle-end/99857] New: [11 Regression] FAIL: libgomp.c/declare-variant-1.c (test for excess errors) by r11-7926 hjl.tools at gmail dot com
                   ` (5 preceding siblings ...)
  2021-04-08 14:25 ` rguenth at gcc dot gnu.org
@ 2021-04-08 14:35 ` jakub at gcc dot gnu.org
  2021-04-09 12:45 ` hubicka at gcc dot gnu.org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-04-08 14:35 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org
           Priority|P3                          |P1

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

* [Bug middle-end/99857] [11 Regression] FAIL: libgomp.c/declare-variant-1.c (test for excess errors) by r11-7926
  2021-03-31 20:58 [Bug middle-end/99857] New: [11 Regression] FAIL: libgomp.c/declare-variant-1.c (test for excess errors) by r11-7926 hjl.tools at gmail dot com
                   ` (6 preceding siblings ...)
  2021-04-08 14:35 ` jakub at gcc dot gnu.org
@ 2021-04-09 12:45 ` hubicka at gcc dot gnu.org
  2021-04-09 13:03 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: hubicka at gcc dot gnu.org @ 2021-04-09 12:45 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
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.

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

* [Bug middle-end/99857] [11 Regression] FAIL: libgomp.c/declare-variant-1.c (test for excess errors) by r11-7926
  2021-03-31 20:58 [Bug middle-end/99857] New: [11 Regression] FAIL: libgomp.c/declare-variant-1.c (test for excess errors) by r11-7926 hjl.tools at gmail dot com
                   ` (7 preceding siblings ...)
  2021-04-09 12:45 ` hubicka at gcc dot gnu.org
@ 2021-04-09 13:03 ` jakub at gcc dot gnu.org
  2021-04-10  9:18 ` cvs-commit at gcc dot gnu.org
  2021-04-10 10:52 ` jakub at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-04-09 13:03 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(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))
?

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

* [Bug middle-end/99857] [11 Regression] FAIL: libgomp.c/declare-variant-1.c (test for excess errors) by r11-7926
  2021-03-31 20:58 [Bug middle-end/99857] New: [11 Regression] FAIL: libgomp.c/declare-variant-1.c (test for excess errors) by r11-7926 hjl.tools at gmail dot com
                   ` (8 preceding siblings ...)
  2021-04-09 13:03 ` jakub at gcc dot gnu.org
@ 2021-04-10  9:18 ` cvs-commit at gcc dot gnu.org
  2021-04-10 10:52 ` jakub at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-04-10  9:18 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 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:1c9744fb3bf2fbf7cec5722f4b187eb553d98280

commit r11-8105-g1c9744fb3bf2fbf7cec5722f4b187eb553d98280
Author: Jan Hubicka <jh@suse.cz>
Date:   Sat Apr 10 11:17:56 2021 +0200

    Do not release body of declare_variant_alt

    gcc/ChangeLog:

    2021-04-10  Jan Hubicka  <hubicka@ucw.cz>

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

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

* [Bug middle-end/99857] [11 Regression] FAIL: libgomp.c/declare-variant-1.c (test for excess errors) by r11-7926
  2021-03-31 20:58 [Bug middle-end/99857] New: [11 Regression] FAIL: libgomp.c/declare-variant-1.c (test for excess errors) by r11-7926 hjl.tools at gmail dot com
                   ` (9 preceding siblings ...)
  2021-04-10  9:18 ` cvs-commit at gcc dot gnu.org
@ 2021-04-10 10:52 ` jakub at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-04-10 10:52 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

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

end of thread, other threads:[~2021-04-10 10:52 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-31 20:58 [Bug middle-end/99857] New: [11 Regression] FAIL: libgomp.c/declare-variant-1.c (test for excess errors) by r11-7926 hjl.tools at gmail dot com
2021-04-01  4:43 ` [Bug middle-end/99857] " marxin at gcc dot gnu.org
2021-04-01 12:22 ` hjl.tools at gmail dot com
2021-04-06 12:19 ` tschwinge at gcc dot gnu.org
2021-04-06 13:33 ` hubicka at ucw dot cz
2021-04-08  3:01 ` asolokha at gmx dot com
2021-04-08 14:25 ` rguenth at gcc dot gnu.org
2021-04-08 14:35 ` jakub at gcc dot gnu.org
2021-04-09 12:45 ` hubicka at gcc dot gnu.org
2021-04-09 13:03 ` jakub at gcc dot gnu.org
2021-04-10  9:18 ` cvs-commit at gcc dot gnu.org
2021-04-10 10:52 ` 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).