public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/97350] New: [11 Regression ] Ada bootstrap fails with: self_referential_size, at stor-layout.c:172
@ 2020-10-09 10:36 marxin at gcc dot gnu.org
  2020-10-09 11:21 ` [Bug ada/97350] [11 Regression] " rguenth at gcc dot gnu.org
                   ` (16 more replies)
  0 siblings, 17 replies; 18+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-10-09 10:36 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 97350
           Summary: [11 Regression ] Ada bootstrap fails with:
                    self_referential_size, at stor-layout.c:172
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: ada
          Assignee: unassigned at gcc dot gnu.org
          Reporter: marxin at gcc dot gnu.org
                CC: ebotcazou at gcc dot gnu.org
  Target Milestone: ---

The following fails:
$ ../configure --with-build-config=bootstrap-lto-lean --enable-checking=release
--enable-languages=c,c++,lto,ada
$ make profiledbootstrap 'BOOT_CFLAGS=-O3' -j160

/home/mliska/Programming/gcc/objdir/./gcc/xgcc
-B/home/mliska/Programming/gcc/objdir/./gcc/ -B/usr/x86_64-suse-linux/bin/
-B/usr/x86_64-suse-linux/lib/ -isystem /usr/x86_64-suse-linux/include -isystem
/usr/x86_64-suse-linux/sys-include    -c -g -O2  -fpic  -W -Wall -gnatpg
-nostdinc   a-cgarso.adb -o a-cgarso.o
compilation abandoned
compilation abandoned
/home/mliska/Programming/gcc/objdir/./gcc/xgcc
-B/home/mliska/Programming/gcc/objdir/./gcc/ -B/usr/x86_64-suse-linux/bin/
-B/usr/x86_64-suse-linux/lib/ -isystem /usr/x86_64-suse-linux/include -isystem
/usr/x86_64-suse-linux/sys-include    -c -g -O2  -fpic  -W -Wall -gnatpg
-nostdinc   a-cgcaso.adb -o a-cgcaso.o
make[7]: *** [../gcc-interface/Makefile:299: a-assert.o] Error 1
make[7]: *** Waiting for unfinished jobs....
make[7]: *** [../gcc-interface/Makefile:299: a-catizo.o] Error 1
make[7]: *** [../gcc-interface/Makefile:299: a-calari.o] Error 1
+===========================GNAT BUG DETECTED==============================+
| 11.0.0 20201008 (experimental) (x86_64-suse-linux) GCC error:            |
| in self_referential_size, at stor-layout.c:172                           |
| Error detected around <built-in>:0                                       |
| Please submit a bug report; see https://gcc.gnu.org/bugs/ .              |
| Use a subject line meaningful to you and us to track the bug.            |
| Include the entire contents of this bug box in the report.               |
| Include the exact command that you entered.                              |
| Also include sources listed below.                                       |
+==========================================================================+

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

* [Bug ada/97350] [11 Regression] Ada bootstrap fails with: self_referential_size, at stor-layout.c:172
  2020-10-09 10:36 [Bug ada/97350] New: [11 Regression ] Ada bootstrap fails with: self_referential_size, at stor-layout.c:172 marxin at gcc dot gnu.org
@ 2020-10-09 11:21 ` rguenth at gcc dot gnu.org
  2020-10-09 11:37 ` ebotcazou at gcc dot gnu.org
                   ` (15 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-10-09 11:21 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|10.0                        |11.0
   Target Milestone|---                         |11.0
           Keywords|                            |build

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

* [Bug ada/97350] [11 Regression] Ada bootstrap fails with: self_referential_size, at stor-layout.c:172
  2020-10-09 10:36 [Bug ada/97350] New: [11 Regression ] Ada bootstrap fails with: self_referential_size, at stor-layout.c:172 marxin at gcc dot gnu.org
  2020-10-09 11:21 ` [Bug ada/97350] [11 Regression] " rguenth at gcc dot gnu.org
@ 2020-10-09 11:37 ` ebotcazou at gcc dot gnu.org
  2020-10-09 11:37 ` [Bug bootstrap/97350] " ebotcazou at gcc dot gnu.org
                   ` (14 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2020-10-09 11:37 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
This looks like a miscompilation of the compiler with this particular setup so
reclassifying (regular bootstrap works just fine).

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

* [Bug bootstrap/97350] [11 Regression] Ada bootstrap fails with: self_referential_size, at stor-layout.c:172
  2020-10-09 10:36 [Bug ada/97350] New: [11 Regression ] Ada bootstrap fails with: self_referential_size, at stor-layout.c:172 marxin at gcc dot gnu.org
  2020-10-09 11:21 ` [Bug ada/97350] [11 Regression] " rguenth at gcc dot gnu.org
  2020-10-09 11:37 ` ebotcazou at gcc dot gnu.org
@ 2020-10-09 11:37 ` ebotcazou at gcc dot gnu.org
  2020-10-09 11:48 ` marxin at gcc dot gnu.org
                   ` (13 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2020-10-09 11:37 UTC (permalink / raw)
  To: gcc-bugs

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

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2020-10-09
          Component|ada                         |bootstrap
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW

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

* [Bug bootstrap/97350] [11 Regression] Ada bootstrap fails with: self_referential_size, at stor-layout.c:172
  2020-10-09 10:36 [Bug ada/97350] New: [11 Regression ] Ada bootstrap fails with: self_referential_size, at stor-layout.c:172 marxin at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2020-10-09 11:37 ` [Bug bootstrap/97350] " ebotcazou at gcc dot gnu.org
@ 2020-10-09 11:48 ` marxin at gcc dot gnu.org
  2020-10-12 11:45 ` rguenth at gcc dot gnu.org
                   ` (12 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-10-09 11:48 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |needs-bisection

--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
(In reply to Eric Botcazou from comment #1)
> This looks like a miscompilation of the compiler with this particular setup
> so reclassifying (regular bootstrap works just fine).

Yes, it seems like a miscompilation. I'm trying to bisect that..

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

* [Bug bootstrap/97350] [11 Regression] Ada bootstrap fails with: self_referential_size, at stor-layout.c:172
  2020-10-09 10:36 [Bug ada/97350] New: [11 Regression ] Ada bootstrap fails with: self_referential_size, at stor-layout.c:172 marxin at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2020-10-09 11:48 ` marxin at gcc dot gnu.org
@ 2020-10-12 11:45 ` rguenth at gcc dot gnu.org
  2020-10-12 11:54 ` marxin at gcc dot gnu.org
                   ` (11 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-10-12 11:45 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Maybe it was modref and thus is fixed now?

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

* [Bug bootstrap/97350] [11 Regression] Ada bootstrap fails with: self_referential_size, at stor-layout.c:172
  2020-10-09 10:36 [Bug ada/97350] New: [11 Regression ] Ada bootstrap fails with: self_referential_size, at stor-layout.c:172 marxin at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2020-10-12 11:45 ` rguenth at gcc dot gnu.org
@ 2020-10-12 11:54 ` marxin at gcc dot gnu.org
  2020-10-12 12:28 ` marxin at gcc dot gnu.org
                   ` (10 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-10-12 11:54 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Martin Liška <marxin at gcc dot gnu.org> ---
So it really started with g:ada353b87909fd6cd37a30083b4fdcb76acbf5fe.
I'm going to re-check the current master.

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

* [Bug bootstrap/97350] [11 Regression] Ada bootstrap fails with: self_referential_size, at stor-layout.c:172
  2020-10-09 10:36 [Bug ada/97350] New: [11 Regression ] Ada bootstrap fails with: self_referential_size, at stor-layout.c:172 marxin at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2020-10-12 11:54 ` marxin at gcc dot gnu.org
@ 2020-10-12 12:28 ` marxin at gcc dot gnu.org
  2020-10-13  8:46 ` marxin at gcc dot gnu.org
                   ` (9 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-10-12 12:28 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Martin Liška <marxin at gcc dot gnu.org> ---
Can be reproduced with the current master
(g:91d80cf4bd2827dd9c40fe6a7c719c909d79083d).

One needs to following patch to work-around a different PR95582:

diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h
index 38daa05aebb..0e21b7f4ff7 100644
--- a/gcc/tree-vectorizer.h
+++ b/gcc/tree-vectorizer.h
@@ -1303,11 +1303,11 @@ struct gather_scatter_info {
    VECTOR_BOOLEAN_TYPE_P.  */

 #define VECT_SCALAR_BOOLEAN_TYPE_P(TYPE) \
-  (TREE_CODE (TYPE) == BOOLEAN_TYPE            \
-   || ((TREE_CODE (TYPE) == INTEGER_TYPE       \
-       || TREE_CODE (TYPE) == ENUMERAL_TYPE)   \
-       && TYPE_PRECISION (TYPE) == 1           \
-       && TYPE_UNSIGNED (TYPE)))
+  ((TREE_CODE (TYPE) == BOOLEAN_TYPE    \
+    || TREE_CODE (TYPE) == INTEGER_TYPE         \
+    || TREE_CODE (TYPE) == ENUMERAL_TYPE)\
+    && TYPE_PRECISION (TYPE) == 1       \
+    && TYPE_UNSIGNED (TYPE))

 static inline bool
 nested_in_vect_loop_p (class loop *loop, stmt_vec_info stmt_info)

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

* [Bug bootstrap/97350] [11 Regression] Ada bootstrap fails with: self_referential_size, at stor-layout.c:172
  2020-10-09 10:36 [Bug ada/97350] New: [11 Regression ] Ada bootstrap fails with: self_referential_size, at stor-layout.c:172 marxin at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2020-10-12 12:28 ` marxin at gcc dot gnu.org
@ 2020-10-13  8:46 ` marxin at gcc dot gnu.org
  2020-10-13 10:46 ` hubicka at gcc dot gnu.org
                   ` (8 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-10-13  8:46 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Martin Liška <marxin at gcc dot gnu.org> ---
And it's still present after latest Honza's patches as of
g:ca4938fa8e0e72fd59307f1f058db800c1e4a8f3.

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

* [Bug bootstrap/97350] [11 Regression] Ada bootstrap fails with: self_referential_size, at stor-layout.c:172
  2020-10-09 10:36 [Bug ada/97350] New: [11 Regression ] Ada bootstrap fails with: self_referential_size, at stor-layout.c:172 marxin at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2020-10-13  8:46 ` marxin at gcc dot gnu.org
@ 2020-10-13 10:46 ` hubicka at gcc dot gnu.org
  2020-10-13 10:58 ` rguenth at gcc dot gnu.org
                   ` (7 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: hubicka at gcc dot gnu.org @ 2020-10-13 10:46 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
Interesting, i get different ICE
during GIMPLE pass: slp
../../gcc/ada/libgnat/s-os_lib.adb: In function
‘system__os_lib__normalize_pathname__missed_drive_letter’:
../../gcc/ada/libgnat/s-os_lib.adb:2133:7: internal compiler error: in
vect_init_pattern_stmt, at tree-vect-patterns.c:115
 2133 |       function Missed_Drive_Letter (Name : String) return Boolean is
      |       ^
0x6534d9 vect_init_pattern_stmt
        ../../gcc/tree-vect-patterns.c:115
0x13e2913 vect_set_pattern_stmt
        ../../gcc/tree-vect-patterns.c:133
0x13e2913 vect_mark_pattern_stmts
        ../../gcc/tree-vect-patterns.c:5287
0x13e2913 vect_pattern_recog_1
        ../../gcc/tree-vect-patterns.c:5403
0x13ef3a1 vect_pattern_recog(vec_info*)
        ../../gcc/tree-vect-patterns.c:5543
0xcda2ce vect_slp_analyze_bb_1
        ../../gcc/tree-vect-slp.c:3819
0xcda2ce vect_slp_region
        ../../gcc/tree-vect-slp.c:3918
0xcda2ce vect_slp_bbs
        ../../gcc/tree-vect-slp.c:4074
0xcdb9d8 vect_slp_function(function*)
        ../../gcc/tree-vect-slp.c:4125
0xcdd085 execute
        ../../gcc/tree-vectorizer.c:1432

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

* [Bug bootstrap/97350] [11 Regression] Ada bootstrap fails with: self_referential_size, at stor-layout.c:172
  2020-10-09 10:36 [Bug ada/97350] New: [11 Regression ] Ada bootstrap fails with: self_referential_size, at stor-layout.c:172 marxin at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2020-10-13 10:46 ` hubicka at gcc dot gnu.org
@ 2020-10-13 10:58 ` rguenth at gcc dot gnu.org
  2020-10-13 11:58 ` marxin at gcc dot gnu.org
                   ` (6 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-10-13 10:58 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Jan Hubicka from comment #7)
> Interesting, i get different ICE
> during GIMPLE pass: slp
> ../../gcc/ada/libgnat/s-os_lib.adb: In function
> ‘system__os_lib__normalize_pathname__missed_drive_letter’:
> ../../gcc/ada/libgnat/s-os_lib.adb:2133:7: internal compiler error: in
> vect_init_pattern_stmt, at tree-vect-patterns.c:115
>  2133 |       function Missed_Drive_Letter (Name : String) return Boolean is
>       |       ^
> 0x6534d9 vect_init_pattern_stmt
>         ../../gcc/tree-vect-patterns.c:115
> 0x13e2913 vect_set_pattern_stmt
>         ../../gcc/tree-vect-patterns.c:133
> 0x13e2913 vect_mark_pattern_stmts
>         ../../gcc/tree-vect-patterns.c:5287
> 0x13e2913 vect_pattern_recog_1
>         ../../gcc/tree-vect-patterns.c:5403
> 0x13ef3a1 vect_pattern_recog(vec_info*)
>         ../../gcc/tree-vect-patterns.c:5543
> 0xcda2ce vect_slp_analyze_bb_1
>         ../../gcc/tree-vect-slp.c:3819
> 0xcda2ce vect_slp_region
>         ../../gcc/tree-vect-slp.c:3918
> 0xcda2ce vect_slp_bbs
>         ../../gcc/tree-vect-slp.c:4074
> 0xcdb9d8 vect_slp_function(function*)
>         ../../gcc/tree-vect-slp.c:4125
> 0xcdd085 execute
>         ../../gcc/tree-vectorizer.c:1432

That's PR95582

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

* [Bug bootstrap/97350] [11 Regression] Ada bootstrap fails with: self_referential_size, at stor-layout.c:172
  2020-10-09 10:36 [Bug ada/97350] New: [11 Regression ] Ada bootstrap fails with: self_referential_size, at stor-layout.c:172 marxin at gcc dot gnu.org
                   ` (9 preceding siblings ...)
  2020-10-13 10:58 ` rguenth at gcc dot gnu.org
@ 2020-10-13 11:58 ` marxin at gcc dot gnu.org
  2020-10-13 17:01 ` hubicka at gcc dot gnu.org
                   ` (5 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-10-13 11:58 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Martin Liška <marxin at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #8)
> (In reply to Jan Hubicka from comment #7)
> > Interesting, i get different ICE
> > during GIMPLE pass: slp
> > ../../gcc/ada/libgnat/s-os_lib.adb: In function
> > ‘system__os_lib__normalize_pathname__missed_drive_letter’:
> > ../../gcc/ada/libgnat/s-os_lib.adb:2133:7: internal compiler error: in
> > vect_init_pattern_stmt, at tree-vect-patterns.c:115
> >  2133 |       function Missed_Drive_Letter (Name : String) return Boolean is
> >       |       ^
> > 0x6534d9 vect_init_pattern_stmt
> >         ../../gcc/tree-vect-patterns.c:115
> > 0x13e2913 vect_set_pattern_stmt
> >         ../../gcc/tree-vect-patterns.c:133
> > 0x13e2913 vect_mark_pattern_stmts
> >         ../../gcc/tree-vect-patterns.c:5287
> > 0x13e2913 vect_pattern_recog_1
> >         ../../gcc/tree-vect-patterns.c:5403
> > 0x13ef3a1 vect_pattern_recog(vec_info*)
> >         ../../gcc/tree-vect-patterns.c:5543
> > 0xcda2ce vect_slp_analyze_bb_1
> >         ../../gcc/tree-vect-slp.c:3819
> > 0xcda2ce vect_slp_region
> >         ../../gcc/tree-vect-slp.c:3918
> > 0xcda2ce vect_slp_bbs
> >         ../../gcc/tree-vect-slp.c:4074
> > 0xcdb9d8 vect_slp_function(function*)
> >         ../../gcc/tree-vect-slp.c:4125
> > 0xcdd085 execute
> >         ../../gcc/tree-vectorizer.c:1432
> 
> That's PR95582

And it was documented in #c5.

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

* [Bug bootstrap/97350] [11 Regression] Ada bootstrap fails with: self_referential_size, at stor-layout.c:172
  2020-10-09 10:36 [Bug ada/97350] New: [11 Regression ] Ada bootstrap fails with: self_referential_size, at stor-layout.c:172 marxin at gcc dot gnu.org
                   ` (10 preceding siblings ...)
  2020-10-13 11:58 ` marxin at gcc dot gnu.org
@ 2020-10-13 17:01 ` hubicka at gcc dot gnu.org
  2020-10-13 17:42 ` hubicka at gcc dot gnu.org
                   ` (4 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: hubicka at gcc dot gnu.org @ 2020-10-13 17:01 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
OK, I was poking a bit about the problem and indeed the bootstrapped gnat with
-O3 and PGO ices, while gnat built normally does not.
We fail:

#2  0x00000000019b7dcb in _Z13variable_sizeP9tree_node (size=0x7ffff7448900) at
../../gcc/stor-layout.c:172
172       gcc_assert (self_refs.length () > 0);
(gdb) l
167       if (TREE_CODE (t) == CALL_EXPR || self_referential_component_ref_p
(t))
168         return size;
169
170       /* Collect the list of self-references in the expression.  */
171       find_placeholder_in_expr (size, &self_refs);
172       gcc_assert (self_refs.length () > 0);
173
174       /* Obtain a private copy of the expression.  */
175       t = size;

here the gcc_assert fires. Sadly self_refs has no debug info.
Size is:
 <cond_expr 0x7ffff7448900
    type <integer_type 0x7ffff745f0a8 bitsizetype public unsigned TI
        size <integer_cst 0x7ffff744ac00 constant visited 128>
        unit-size <integer_cst 0x7ffff744ac18 constant visited 16>
        align:128 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7ffff745f0a8 precision:128 min <integer_cst 0x7ffff744ac30 0> max
<integer_cst 0x7ffff745e848 0xffffffffffffffffffffffffffffffff>>
    readonly
    arg:0 <ge_expr 0x7ffff7470640
        type <boolean_type 0x7ffff746ae70 boolean sizes-gimplified public
visited unsigned QI
            size <integer_cst 0x7ffff744aca8 constant visited 8>
            unit-size <integer_cst 0x7ffff744acc0 constant visited 1>
            align:8 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7ffff746ae70 precision:8 min <integer_cst 0x7ffff74680d8 0> max <integer_cst
0x7ffff7468000 255> context <translation_unit_decl 0x7ffff7454168 a-assert.adb>
RM size <integer_cst 0x7ffff744afa8 1> RM max <integer_cst 0x7ffff7468108 1>>
        readonly visited
        arg:0 <component_ref 0x7ffff74487e0 type <integer_type 0x7ffff746c1f8
positive___XDLU_1__2147483647>
            readonly visited
            arg:0 <indirect_ref 0x7ffff744b7c0 type <record_type 0x7ffff746cc78
string___XUB>
                readonly nothrow visited
                arg:0 <component_ref 0x7ffff7448750 type <pointer_type
0x7ffff746cd20>
                    visited
                    arg:0 <placeholder_expr 0x7ffff7468510 type <record_type
0x7ffff746cf18 string___XUP>
                        visited> arg:1 <field_decl 0x7ffff7467a18 P_BOUNDS>>>
arg:1 <field_decl 0x7ffff7473260 UB0>>
        arg:1 <component_ref 0x7ffff74487b0 type <integer_type 0x7ffff746c1f8
positive___XDLU_1__2147483647>
            readonly visited arg:0 <indirect_ref 0x7ffff744b7c0> arg:1
<field_decl 0x7ffff74731c8 LB0>>>
    arg:1 <mult_expr 0x7ffff74706e0 type <integer_type 0x7ffff745f0a8
bitsizetype>
        readonly
        arg:0 <nop_expr 0x7ffff744b8c0 type <integer_type 0x7ffff745f0a8
bitsizetype>
            readonly
            arg:0 <plus_expr 0x7ffff74706b8 type <integer_type 0x7ffff745f000
sizetype>
                readonly
                arg:0 <minus_expr 0x7ffff7470690 type <integer_type
0x7ffff745f000 sizetype>
                    readonly
                    arg:0 <nop_expr 0x7ffff744b840 type <integer_type
0x7ffff745f000 sizetype>
                        readonly visited arg:0 <component_ref 0x7ffff74487e0>>
                    arg:1 <nop_expr 0x7ffff744b820 type <integer_type
0x7ffff745f000 sizetype>
                        readonly visited arg:0 <component_ref 0x7ffff74487b0>>>
arg:1 <integer_cst 0x7ffff744acc0 1>>> arg:1 <integer_cst 0x7ffff744aca8 8>>
    arg:2 <integer_cst 0x7ffff744ac30 type <integer_type 0x7ffff745f0a8
bitsizetype> constant 0>>

<PLACEHOLDER_EXPR struct >.P_BOUNDS->UB0 >= <PLACEHOLDER_EXPR struct
>.P_BOUNDS->LB0 ? (bitsizetype) (((sizetype) <PLACEHOLDER_EXPR struct
>.P_BOUNDS->UB0 - (sizetype) <PLACEHOLDER_EXPR struct >.P_BOUNDS->LB0) + 1) * 8
: 0;

I am not expert on Ada type sizes but it seems like well formed expression.

and backtrace is:
#0  _Z14internal_errorPKcz (gmsgid=0xac <error: Cannot access memory at address
0xac>) at ../../gcc/diagnostic.c:1752
#1  0x00000000010ba114 in _Z11fancy_abortPKciS0_ (file=0x23a38a8 "in %s, at
%s:%d", line=172, function=0x1e507bb "self_referential_size") at
../../gcc/diagnostic.c:1824
#2  0x00000000019b7dcb in _Z13variable_sizeP9tree_node (size=0x7ffff7448900) at
../../gcc/stor-layout.c:172
#3  _Z13variable_sizeP9tree_node (size=0x7ffff7448900) at
../../gcc/stor-layout.c:67
#4  0x000000000128f4e0 in finalize_type_size (type=0x7ffff746c3f0) at
../../gcc/stor-layout.c:1967
#5  0x000000000128df40 in _Z11layout_typeP9tree_node (type=0x23a38a8) at
../../gcc/stor-layout.c:2625
#6  0x000000000190e307 in _ZL18build_array_type_1P9tree_nodeS0_bbb.lto_priv.0
(elt_type=0x7ffff745f3f0, index_type=0x7ffff746c348, typeless_storage=59,
shared=172, set_canonical=59)
    at ../../gcc/tree.c:8194
#7  0x0000000001567bcc in _Z18gnat_to_gnu_entityiP9tree_nodeb
(gnat_entity=37370024, gnu_expr=0x1e507bb, definition=59) at
../../gcc/ada/gcc-interface/decl.c:2366
#8  0x00000000015618f5 in _Z16gnat_to_gnu_typei (gnat_entity=37370024) at
../../gcc/ada/gcc-interface/decl.c:4887
#9  0x00000000015687a9 in _Z18gnat_to_gnu_entityiP9tree_nodeb
(gnat_entity=37370024, gnu_expr=0x1e507bb, definition=59) at
../../gcc/ada/gcc-interface/decl.c:4814
#10 0x00000000015618f5 in _Z16gnat_to_gnu_typei (gnat_entity=37370024) at
../../gcc/ada/gcc-interface/decl.c:4887
#11 0x00000000019ea47c in gigi (gnat_root=37370024, max_gnat_node=31786939,
number_name=30016059, nodes_ptr=0xac, flags_ptr=0x1ca023b, next_node_ptr=0x73,
prev_node_ptr=0x0, 
    elists_ptr=0x0, elmts_ptr=0x0, strings_ptr=0x0, string_chars_ptr=0x0,
list_headers_ptr=0x0, number_file=12, file_info_ptr=0x7fffffffe3c0,
standard_boolean=16, standard_integer=37, 
    standard_character=107, standard_long_long_float=100,
standard_exception_type=1704, gigi_operating_mode=0) at
../../gcc/ada/gcc-interface/trans.c:463
#12 0x00000000019e406d in back_end__call_back_end (mode=(unknown: 1704)) at
../../gcc/ada/back_end.adb:155
#13 0x0000000001928eed in _ada_gnat1drv () at ../../gcc/ada/gnat1drv.adb:1608
#14 0x0000000001910a4b in _ZL15gnat_parse_filev.lto_priv.0 () at
../../gcc/ada/gcc-interface/misc.c:118
#15 0x00000000019107f4 in _ZL12compile_filev.lto_priv.0 () at
../../gcc/toplev.c:460
#16 0x00000000018f3296 in _ZN6toplev4mainEiPPc (this=0x7fffffffe63e, argc=21,
argv=0x7fffffffe728) at ../../gcc/toplev.c:2321
#17 0x00000000018f26ec in main (argc=30016059, argv=0x1ca023b) at
../../gcc/main.c:39

Breakpointing on 171 works and vector seems to be filled in. However the
disasembly shows:

   0x00000000019b7db2 <+98>:    callq  0x1a1c050
<_Z24find_placeholder_in_exprP9tree_nodeP3vecIS0_7va_heap6vl_ptrE>
=> 0x00000000019b7db7 <+103>:   mov    $0x1e507bb,%edx
   0x00000000019b7dbc <+108>:   mov    $0xac,%esi
   0x00000000019b7dc1 <+113>:   mov    $0x1ca0231,%edi
   0x00000000019b7dc6 <+118>:   callq  0x10ba0f0 <_Z11fancy_abortPKciS0_>

so it seems that the vector length test is completely optimized out in function
_Z13variable_sizeP9tree_node (after call to
_Z24find_placeholder_in_exprP9tree_nodeP3vecIS0_7va_heap6vl_ptrE).

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

* [Bug bootstrap/97350] [11 Regression] Ada bootstrap fails with: self_referential_size, at stor-layout.c:172
  2020-10-09 10:36 [Bug ada/97350] New: [11 Regression ] Ada bootstrap fails with: self_referential_size, at stor-layout.c:172 marxin at gcc dot gnu.org
                   ` (11 preceding siblings ...)
  2020-10-13 17:01 ` hubicka at gcc dot gnu.org
@ 2020-10-13 17:42 ` hubicka at gcc dot gnu.org
  2020-10-13 18:04 ` hubicka at gcc dot gnu.org
                   ` (3 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: hubicka at gcc dot gnu.org @ 2020-10-13 17:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
In WPA we seem to see the store to vector:
Propagated modref for push_without_duplicates/1089577                           
  loads:                                                                        
    Limits: 32 bases, 16 refs                                                   
    Every base                                                                  
  stores:                                                                       
    Limits: 32 bases, 16 refs                                                   
      Base 0:struct vec (alias set 544)                                         
        Ref 0:unsigned int (alias set 3)                                        
          Every access                                                          
      Base 1:union tree_node * (alias set 21)                                   
        Ref 0:union tree_node * (alias set 21)                                  
          Every access                                                          


Propagated modref for find_placeholder_in_expr/1089578                          
  loads:                                                                        
    Limits: 32 bases, 16 refs                                                   
    Every base                                                                  
  stores:                                                                       
    Limits: 32 bases, 16 refs                                                   
      Base 0:struct vec (alias set 544)                                         
        Ref 0:unsigned int (alias set 3)                                        
          Every access                                                          
      Base 1:union tree_node * (alias set 21)                                   
        Ref 0:union tree_node * (alias set 21)                                  
          Every access                                                          

I guess base 0, ref 0 is the length adjustment (m_num is unsigned int).
What seems interesting is that find_placeholder_in_expr lives in other
partition then variable_size.
It is read as:

Read modref for find_placeholder_in_expr/1089578                                
  loads:                                                                        
    Limits: 32 bases, 16 refs                                                   
    Every base                                                                  
  stores:                                                                       
    Limits: 32 bases, 16 refs                                                   
      Base 0: alias set 17                                                      
        Ref 0: alias set 3                                                      
          Every access                                                          
      Base 1: alias set 16                                                      
        Ref 0: alias set 16                                                     
          Every access                                                          

so alias set 17 and 3 are vec and unsigned_int.
However in fre3 we get:

ipa-modref: call stmt find_placeholder_in_expr (size_8(D), &self_refs);         
ipa-modref: call to find_placeholder_in_expr/1089578 does not clobber ref:
self_refs.m_vec alias sets: 11->12

This seems odd: alias set 11 and 12 seems quite different form 17 and 3.
Moreover 3 is usual alias set for a builtin type (unsigned int).

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

* [Bug bootstrap/97350] [11 Regression] Ada bootstrap fails with: self_referential_size, at stor-layout.c:172
  2020-10-09 10:36 [Bug ada/97350] New: [11 Regression ] Ada bootstrap fails with: self_referential_size, at stor-layout.c:172 marxin at gcc dot gnu.org
                   ` (12 preceding siblings ...)
  2020-10-13 17:42 ` hubicka at gcc dot gnu.org
@ 2020-10-13 18:04 ` hubicka at gcc dot gnu.org
  2020-10-13 20:00 ` hubicka at gcc dot gnu.org
                   ` (2 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: hubicka at gcc dot gnu.org @ 2020-10-13 18:04 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #12 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
Aha, the code in question is:
  # USE = nonlocal null { D.8330 D.22051 D.22054 D.22059 D.22060 } (nonlocal,
escaped, interposable)
  # CLB = nonlocal null { D.8330 D.22051 D.22054 D.22059 D.22060 } (nonlocal,
escaped, interposable)
  find_placeholder_in_expr (size_8(D), &self_refs);                             
  # PT = nonlocal escaped null                                                  
  _30 = self_refs.m_vec;                                                        
  if (_30 != 0B)                                                                
    goto <bb 10>; [100.00%]                                                     
  else                                                                          
    goto <bb 11>; [0.00%]                                                       

  <bb 10> [count: 7690]:                                                        
  _31 = MEM[(const struct vec *)_30].m_vecpfx.m_num;                            
  if (_31 == 0)                                                                 
    goto <bb 11>; [0.00%]                                                       
  else                                                                          
    goto <bb 12>; [100.00%]                                                     

What we seem to optimize out is the to m_vec, here alias set 12 makes more
sense.
and indeed it seems that this is missing in the summary. Smells like a bug in
ipa_merge_modref_summary_after_inlining since the function is split and
re-merged by inliner.

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

* [Bug bootstrap/97350] [11 Regression] Ada bootstrap fails with: self_referential_size, at stor-layout.c:172
  2020-10-09 10:36 [Bug ada/97350] New: [11 Regression ] Ada bootstrap fails with: self_referential_size, at stor-layout.c:172 marxin at gcc dot gnu.org
                   ` (13 preceding siblings ...)
  2020-10-13 18:04 ` hubicka at gcc dot gnu.org
@ 2020-10-13 20:00 ` hubicka at gcc dot gnu.org
  2020-10-14  8:54 ` cvs-commit at gcc dot gnu.org
  2020-11-09 12:45 ` marxin at gcc dot gnu.org
  16 siblings, 0 replies; 18+ messages in thread
From: hubicka at gcc dot gnu.org @ 2020-10-13 20:00 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #13 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
bug in SCC discovery.   I am testing
diff --git a/gcc/ipa-modref.c b/gcc/ipa-modref.c
index 4f86b9ccea1..771a0a88f9a 100644
--- a/gcc/ipa-modref.c
+++ b/gcc/ipa-modref.c
@@ -1603,6 +1603,11 @@ make_pass_ipa_modref (gcc::context *ctxt)
 static bool
 ignore_edge (struct cgraph_edge *e)
 {
+  /* We merge summaries of inline clones into summaries of functions they
+     are inlined to.  For that reason the complete function bodies must
+     act as unit.  */
+  if (!e->inline_failed)
+    return false;
   enum availability avail;
   cgraph_node *callee = e->callee->function_or_virtual_thunk_symbol
                          (&avail, e->caller);

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

* [Bug bootstrap/97350] [11 Regression] Ada bootstrap fails with: self_referential_size, at stor-layout.c:172
  2020-10-09 10:36 [Bug ada/97350] New: [11 Regression ] Ada bootstrap fails with: self_referential_size, at stor-layout.c:172 marxin at gcc dot gnu.org
                   ` (14 preceding siblings ...)
  2020-10-13 20:00 ` hubicka at gcc dot gnu.org
@ 2020-10-14  8:54 ` cvs-commit at gcc dot gnu.org
  2020-11-09 12:45 ` marxin at gcc dot gnu.org
  16 siblings, 0 replies; 18+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-10-14  8:54 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #14 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:87d75a11a5cb93668ae0bf6d97030e01b2eae3f2

commit r11-3864-g87d75a11a5cb93668ae0bf6d97030e01b2eae3f2
Author: Jan Hubicka <jh@suse.cz>
Date:   Wed Oct 14 10:54:00 2020 +0200

    Fix SCC discovery in ipa-modref

    this patch fixes SCC discovery in ipa-modref which is causing
misoptimization
    of gnat bootstrapped with LTO, PGO and -O3.

    I also improved debug info and spotted wrong parameter to ignore_stores_p
    (which is probably quite harmless since we only inline matching functions,
but
    it is better to be consistent).

            PR bootstrap/97350
            * ipa-modref.c (ignore_edge): Do not ignore inlined edes.
            (ipa_merge_modref_summary_after_inlining): Improve debug output and
            fix parameter of ignore_stores_p.

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

* [Bug bootstrap/97350] [11 Regression] Ada bootstrap fails with: self_referential_size, at stor-layout.c:172
  2020-10-09 10:36 [Bug ada/97350] New: [11 Regression ] Ada bootstrap fails with: self_referential_size, at stor-layout.c:172 marxin at gcc dot gnu.org
                   ` (15 preceding siblings ...)
  2020-10-14  8:54 ` cvs-commit at gcc dot gnu.org
@ 2020-11-09 12:45 ` marxin at gcc dot gnu.org
  16 siblings, 0 replies; 18+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-11-09 12:45 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #15 from Martin Liška <marxin at gcc dot gnu.org> ---
I guess it's fixed.

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

end of thread, other threads:[~2020-11-09 12:45 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-09 10:36 [Bug ada/97350] New: [11 Regression ] Ada bootstrap fails with: self_referential_size, at stor-layout.c:172 marxin at gcc dot gnu.org
2020-10-09 11:21 ` [Bug ada/97350] [11 Regression] " rguenth at gcc dot gnu.org
2020-10-09 11:37 ` ebotcazou at gcc dot gnu.org
2020-10-09 11:37 ` [Bug bootstrap/97350] " ebotcazou at gcc dot gnu.org
2020-10-09 11:48 ` marxin at gcc dot gnu.org
2020-10-12 11:45 ` rguenth at gcc dot gnu.org
2020-10-12 11:54 ` marxin at gcc dot gnu.org
2020-10-12 12:28 ` marxin at gcc dot gnu.org
2020-10-13  8:46 ` marxin at gcc dot gnu.org
2020-10-13 10:46 ` hubicka at gcc dot gnu.org
2020-10-13 10:58 ` rguenth at gcc dot gnu.org
2020-10-13 11:58 ` marxin at gcc dot gnu.org
2020-10-13 17:01 ` hubicka at gcc dot gnu.org
2020-10-13 17:42 ` hubicka at gcc dot gnu.org
2020-10-13 18:04 ` hubicka at gcc dot gnu.org
2020-10-13 20:00 ` hubicka at gcc dot gnu.org
2020-10-14  8:54 ` cvs-commit at gcc dot gnu.org
2020-11-09 12:45 ` marxin 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).