[Bug ipa/87957] New: [9 Regression] ICE tree check: expected tree that contains ‘decl minimal’ structure, have ‘identifier_node’ in warn_odr, at ipa-devirt.c:1051 since r265519

classic Classic list List threaded Threaded
22 messages Options
12
Reply | Threaded
Open this post in threaded view
|

[Bug ipa/87957] New: [9 Regression] ICE tree check: expected tree that contains ‘decl minimal’ structure, have ‘identifier_node’ in warn_odr, at ipa-devirt.c:1051 since r265519

asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87957

            Bug ID: 87957
           Summary: [9 Regression] ICE tree check: expected tree that
                    contains ‘decl minimal’ structure, have
                    ‘identifier_node’ in warn_odr, at ipa-devirt.c:1051
                    since r265519
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: ipa
          Assignee: unassigned at gcc dot gnu.org
          Reporter: marxin at gcc dot gnu.org
                CC: hubicka at gcc dot gnu.org, marxin at gcc dot gnu.org
  Target Milestone: ---

Following is causing a new ICE:

$ cat 1.ii
typedef struct {
  int a;
} YYSTYPE;
union yyalloc {
  short yyss;
  YYSTYPE yyvs;
};
void b() { yyalloc c; }

$ cat 2.ii
typedef struct YYSTYPE {
} YYSTYPE;
union yyalloc {
  short yyss;
  YYSTYPE yyvs;
};
void a() { yyalloc b; }

$ g++ -flto [12].ii
1.ii:3:3: warning: type ‘struct YYSTYPE’ violates the C++ One Definition Rule
[-Wodr]
    3 | } YYSTYPE;
      |   ^
lto1: internal compiler error: tree check: expected tree that contains ‘decl
minimal’ structure, have ‘identifier_node’ in warn_odr, at ipa-devirt.c:1051
0x6b540e tree_contains_struct_check_failed(tree_node const*,
tree_node_structure_enum, char const*, int, char const*)
        ../../gcc/tree.c:9790
0x614bd4 contains_struct_check(tree_node*, tree_node_structure_enum, char
const*, int, char const*)
        ../../gcc/tree.h:3268
0x614bd4 warn_odr
        ../../gcc/ipa-devirt.c:1051
0xa01c9e type_variants_equivalent_p
        ../../gcc/ipa-devirt.c:651
0xa07f68 odr_subtypes_equivalent_p
        ../../gcc/ipa-devirt.c:697
0xa08faa odr_types_equivalent_p
        ../../gcc/ipa-devirt.c:1576
0xa05ea4 add_type_duplicate
        ../../gcc/ipa-devirt.c:1878
0xa05ea4 get_odr_type(tree_node*, bool)
        ../../gcc/ipa-devirt.c:2058
0x7894d6 lto_read_decls
        ../../gcc/lto/lto.c:1900
0x78a78e lto_file_finalize
        ../../gcc/lto/lto.c:2134
0x78a78e lto_create_files_from_ids
        ../../gcc/lto/lto.c:2144
0x78a78e lto_file_read
        ../../gcc/lto/lto.c:2185
0x78a78e read_cgraph_and_symbols
        ../../gcc/lto/lto.c:2865
0x78a78e lto_main()
        ../../gcc/lto/lto.c:3401
Reply | Threaded
Open this post in threaded view
|

[Bug ipa/87957] [9 Regression] ICE tree check: expected tree that contains ‘decl minimal’ structure, have ‘identifier_node’ in warn_odr, at ipa-devirt.c:1051 since r265519

asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87957

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2018-11-9
      Known to work|                            |8.2.0
   Target Milestone|---                         |9.0
      Known to fail|                            |9.0
Reply | Threaded
Open this post in threaded view
|

[Bug ipa/87957] [9 Regression] ICE tree check: expected tree that contains ‘decl minimal’ structure, have ‘identifier_node’ in warn_odr, at ipa-devirt.c:1051 since r265519

asolokha at gmx dot com
In reply to this post by asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87957

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
     Ever confirmed|0                           |1

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
I've got patch for it, let me take it.
Reply | Threaded
Open this post in threaded view
|

[Bug ipa/87957] [9 Regression] ICE tree check: expected tree that contains ‘decl minimal’ structure, have ‘identifier_node’ in warn_odr, at ipa-devirt.c:1051 since r265519

asolokha at gmx dot com
In reply to this post by asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87957

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |hubicka at gcc dot gnu.org

--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
There's patch candidate:

diff --git a/gcc/ipa-devirt.c b/gcc/ipa-devirt.c
index 4676bdbdf93..71cd35caf0c 100644
--- a/gcc/ipa-devirt.c
+++ b/gcc/ipa-devirt.c
@@ -1048,7 +1048,11 @@ warn_odr (tree t1, tree t2, tree st1, tree st2,
     }
   else
     return;
-  inform (DECL_SOURCE_LOCATION (decl2), reason);
+
+  location_t loc = (TYPE_NAME (t1) && TREE_CODE (TYPE_NAME (t1)) == TYPE_DECL
+                   ? DECL_SOURCE_LOCATION (TYPE_NAME (t1))
+                   : UNKNOWN_LOCATION);
+  inform (loc, reason);

   if (warned)
     *warned = true;

But now I see repeated Wodr:

$ g++ -flto [12].ii -shared
1.ii:3:3: warning: type ‘struct YYSTYPE’ violates the C++ One Definition Rule
[-Wodr]
    3 | } YYSTYPE;
      |   ^
1.ii:3:3: note: a type with different alignment is defined in another
translation unit
1.ii:4:7: warning: type ‘union yyalloc’ violates the C++ One Definition Rule
[-Wodr]
    4 | union yyalloc {
      |       ^
1.ii:4:7: note: a different type is defined in another translation unit
1.ii:6:11: note: the first difference of corresponding definitions is field
‘yyvs’
    6 |   YYSTYPE yyvs;
      |           ^
1.ii:4:7: note: a field of same name but different type is defined in another
translation unit
    4 | union yyalloc {
      |       ^
1.ii:3:3: note: type ‘struct YYSTYPE’ itself violates the C++ One Definition
Rule
    3 | } YYSTYPE;
      |   ^
1.ii:3:3: warning: type ‘struct YYSTYPE’ violates the C++ One Definition Rule
[-Wodr]
2.ii:1:16: note: a different type is defined in another translation unit
    1 | typedef struct YYSTYPE {
      |                ^
1.ii:2:7: note: the first difference of corresponding definitions is field ‘a’
    2 |   int a;
      |       ^
1.ii:3:3: note: a type with different number of fields is defined in another
translation unit
    3 | } YYSTYPE;
      |   ^

Leaving to Honza.
Reply | Threaded
Open this post in threaded view
|

[Bug ipa/87957] [9 Regression] ICE tree check: expected tree that contains ‘decl minimal’ structure, have ‘identifier_node’ in warn_odr, at ipa-devirt.c:1051 since r265519

asolokha at gmx dot com
In reply to this post by asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87957

--- Comment #3 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
Author: hubicka
Date: Sat Nov 17 11:35:01 2018
New Revision: 266235

URL: https://gcc.gnu.org/viewcvs?rev=266235&root=gcc&view=rev
Log:
        PR ipa/87957
        * ipa-devirt.c (warn_odr): Look for main variant to get TYPE_DECL.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/ipa-devirt.c
Reply | Threaded
Open this post in threaded view
|

[Bug ipa/87957] [9 Regression] ICE tree check: expected tree that contains ‘decl minimal’ structure, have ‘identifier_node’ in warn_odr, at ipa-devirt.c:1051 since r265519

asolokha at gmx dot com
In reply to this post by asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87957

--- Comment #4 from Jan Hubicka <hubicka at ucw dot cz> ---
ICE fixed, but lets keep the PR open to track the fact that warning is
quite confused.
Reply | Threaded
Open this post in threaded view
|

[Bug ipa/87957] [9 Regression] ICE tree check: expected tree that contains ‘decl minimal’ structure, have ‘identifier_node’ in warn_odr, at ipa-devirt.c:1051 since r265519

asolokha at gmx dot com
In reply to this post by asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87957

--- Comment #5 from Martin Liška <marxin at gcc dot gnu.org> ---
With current trunk, I still see following problem:

$ cat 1.ii
enum a {} b;

$ cat 2.ii
class a {
  int *b() const;
};
int *a::b() const { return 0; }

$ g++ -flto [12].ii
1.ii:1:6: warning: type ‘a’ violates the C++ One Definition Rule [-Wodr]
    1 | enum a {} b;
      |      ^
1.ii:1:6: note: a different type is defined in another translation unit
during IPA pass: pure-const
lto1: internal compiler error: tree check: expected enumeral_type, have
record_type in free_enum_values, at ipa-devirt.c:2276
0x6de7c0 tree_check_failed(tree_node const*, char const*, int, char const*,
...)
        /home/marxin/Programming/gcc/gcc/tree.c:9657
0x6413a6 tree_check(tree_node*, char const*, int, char const*, tree_code)
        /home/marxin/Programming/gcc/gcc/tree.h:3154
0x6413a6 free_enum_values
        /home/marxin/Programming/gcc/gcc/ipa-devirt.c:2276
0xa34174 build_type_inheritance_graph()
        /home/marxin/Programming/gcc/gcc/ipa-devirt.c:2292
0xa6d852 symbol_table::remove_unreachable_nodes(_IO_FILE*)
        /home/marxin/Programming/gcc/gcc/ipa.c:310
0x7b3832 read_cgraph_and_symbols
        /home/marxin/Programming/gcc/gcc/lto/lto.c:3017
0x7b3832 lto_main()
        /home/marxin/Programming/gcc/gcc/lto/lto.c:3401
Reply | Threaded
Open this post in threaded view
|

[Bug ipa/87957] [9 Regression] ICE tree check: expected tree that contains ‘decl minimal’ structure, have ‘identifier_node’ in warn_odr, at ipa-devirt.c:1051 since r265519

asolokha at gmx dot com
In reply to this post by asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87957

--- Comment #6 from Jan Hubicka <hubicka at ucw dot cz> ---
I think we have separate PR for this ICE.  It is the ODR violation
confusing the walk of duplicates. It needs to stop assuming that all
duplicates are same TREE_CODE of type.

I will cook up patch.

Honza
Reply | Threaded
Open this post in threaded view
|

[Bug ipa/87957] [9 Regression] ICE tree check: expected tree that contains ‘decl minimal’ structure, have ‘identifier_node’ in warn_odr, at ipa-devirt.c:1051 since r265519

asolokha at gmx dot com
In reply to this post by asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87957

--- Comment #7 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
Author: hubicka
Date: Mon Nov 19 23:27:10 2018
New Revision: 266289

URL: https://gcc.gnu.org/viewcvs?rev=266289&root=gcc&view=rev
Log:

        PR lto/87957
        * ipa-devirt.c (free_enum_values): Do not ICE on ODR vilations.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/ipa-devirt.c
Reply | Threaded
Open this post in threaded view
|

[Bug ipa/87957] [9 Regression] ICE tree check: expected tree that contains ‘decl minimal’ structure, have ‘identifier_node’ in warn_odr, at ipa-devirt.c:1051 since r265519

asolokha at gmx dot com
In reply to this post by asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87957

--- Comment #8 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
Author: hubicka
Date: Tue Nov 20 16:22:19 2018
New Revision: 266322

URL: https://gcc.gnu.org/viewcvs?rev=266322&root=gcc&view=rev
Log:

        PR lto/87957
        * ipa-devirt.c (odr_subtypes_equivalent_p): Report ODR violation
        when sybtype already violates ODR.
        (get_odr_type): Do not ICE when insert is false and type duplicate
        is not registered yet.
        (register_odr_type): Be sure to register subtypes first.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/ipa-devirt.c
Reply | Threaded
Open this post in threaded view
|

[Bug ipa/87957] [9 Regression] ICE tree check: expected tree that contains ‘decl minimal’ structure, have ‘identifier_node’ in warn_odr, at ipa-devirt.c:1051 since r265519

asolokha at gmx dot com
In reply to this post by asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87957

--- Comment #9 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
Author: hubicka
Date: Wed Nov 21 17:31:19 2018
New Revision: 266350

URL: https://gcc.gnu.org/viewcvs?rev=266350&root=gcc&view=rev
Log:

        PR lto/87957
        * tree.c (fld_decl_context): Break out from ...
        (free_lang_data_in_decl): ... here; free TREE_PUBLIC, TREE_PRIVATE
        DECL_ARTIFICIAL of TYPE_DECL; do not free TREE_TYPE of TYPE_DECL.
        (fld_incomplete_type_of): Build copy of TYP_DECL.
        * ipa-devirt.c (free_enum_values): Rename to ...
        (free_odr_warning_data): ... this one; free also duplicated TYPE_DECLs
        and TREE_TYPEs of TYPE_DECLs.
        (get_odr_type): Initialize odr_vtable_hash if needed.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/ipa-devirt.c
    trunk/gcc/tree.c
Reply | Threaded
Open this post in threaded view
|

[Bug ipa/87957] [9 Regression] ICE tree check: expected tree that contains ‘decl minimal’ structure, have ‘identifier_node’ in warn_odr, at ipa-devirt.c:1051 since r265519

asolokha at gmx dot com
In reply to this post by asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87957

--- Comment #10 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
Author: hubicka
Date: Wed Nov 21 17:32:19 2018
New Revision: 266351

URL: https://gcc.gnu.org/viewcvs?rev=266351&root=gcc&view=rev
Log:

        PR lto/87957
        * g++.dg/lto/odr-1_0.C: Extend by mismatched enum.
        * g++.dg/lto/odr-1_1.C: Extend by mismatched enum.
        * g++.dg/lto/odr-2_0.C: New.
        * g++.dg/lto/odr-2_0.C: New.
        * g++.dg/lto/odr-3_1.C: New.
        * g++.dg/lto/odr-3_1.C: New.

Added:
    trunk/gcc/testsuite/g++.dg/lto/odr-2_0.C
    trunk/gcc/testsuite/g++.dg/lto/odr-2_1.C
    trunk/gcc/testsuite/g++.dg/lto/odr-3_0.C
    trunk/gcc/testsuite/g++.dg/lto/odr-3_1.C
Modified:
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/g++.dg/lto/odr-1_0.C
    trunk/gcc/testsuite/g++.dg/lto/odr-1_1.C
Reply | Threaded
Open this post in threaded view
|

[Bug ipa/87957] [9 Regression] ICE tree check: expected tree that contains ‘decl minimal’ structure, have ‘identifier_node’ in warn_odr, at ipa-devirt.c:1051 since r265519

asolokha at gmx dot com
In reply to this post by asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87957

Jan Hubicka <hubicka at gcc dot gnu.org> changed:

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

--- Comment #11 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
Fixed.
Reply | Threaded
Open this post in threaded view
|

[Bug ipa/87957] [9 Regression] ICE tree check: expected tree that contains ‘decl minimal’ structure, have ‘identifier_node’ in warn_odr, at ipa-devirt.c:1051 since r265519

asolokha at gmx dot com
In reply to this post by asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87957

Rainer Orth <ro at gcc dot gnu.org> changed:

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

--- Comment #12 from Rainer Orth <ro at gcc dot gnu.org> ---
Your patch most likely caused a regression:

+FAIL: gnat.dg/lto8.adb (test for excess errors)
+FAIL: gnat.dg/lto8.adb 3 blank line(s) in output
+UNRESOLVED: gnat.dg/lto8.adb compilation failed to produce executable

+===========================GNAT BUG DETECTED==============================+
| 9.0.0 20181122 (experimental) [trunk revision 266382] (i386-pc-solaris2.11)
GCC error:|
| in fld_incomplete_type_of, at tree.c:5300                                |
| Error detected around
/var/gcc/regression/trunk/11-gcc-gas/build/i386-pc-solaris2.11/./libada/adainclude/s-atacco.ads:39:16|

Seen on i386-pc-solaris2.11 and sparc-sun-solaris2.11 (32 and 64-bit,
gcc-testresults
reports also on aarch64-suse-linux-gnu, arm-unknown-linux-gnueabihf,
s390x-ibm-linux-gnu default
Reply | Threaded
Open this post in threaded view
|

[Bug ipa/87957] [9 Regression] ICE tree check: expected tree that contains ‘decl minimal’ structure, have ‘identifier_node’ in warn_odr, at ipa-devirt.c:1051 since r265519

asolokha at gmx dot com
In reply to this post by asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87957

--- Comment #13 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
> Seen on i386-pc-solaris2.11 and sparc-sun-solaris2.11 (32 and 64-bit,
> gcc-testresults
> reports also on aarch64-suse-linux-gnu, arm-unknown-linux-gnueabihf,
> s390x-ibm-linux-gnu default

Also seen on darwin.
Reply | Threaded
Open this post in threaded view
|

[Bug ipa/87957] [9 Regression] ICE tree check: expected tree that contains ‘decl minimal’ structure, have ‘identifier_node’ in warn_odr, at ipa-devirt.c:1051 since r265519

asolokha at gmx dot com
In reply to this post by asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87957

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

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

--- Comment #14 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
That would be the
             gcc_checking_assert (TREE_TYPE (name) == t);
assert then.  So, what is TREE_TYPE (name) and what is t when this happens?
Reply | Threaded
Open this post in threaded view
|

[Bug ipa/87957] [9 Regression] ICE tree check: expected tree that contains ‘decl minimal’ structure, have ‘identifier_node’ in warn_odr, at ipa-devirt.c:1051 since r265519

asolokha at gmx dot com
In reply to this post by asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87957

--- Comment #15 from ro at CeBiTec dot Uni-Bielefeld.DE <ro at CeBiTec dot Uni-Bielefeld.DE> ---
> --- Comment #14 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
> That would be the
>              gcc_checking_assert (TREE_TYPE (name) == t);
> assert then.  So, what is TREE_TYPE (name) and what is t when this happens?

Here's what I find (after recompiling tree.c with -g3 -O0):

(gdb) up
#1  0x09777f85 in fld_incomplete_type_of (t=0xfa58cc60, fld=0xfeffd6a8)
    at /vol/gcc/src/hg/trunk/local/gcc/tree.c:5312
5312                  gcc_checking_assert (TREE_TYPE (name) == t);
(gdb) p name
$1 = (tree) 0xfa593000
(gdb) call TREE_TYPE (name)
$2 = (tree) 0xfa58ccc0
(gdb) pt
warning: Expression is not an assignment (and might have no effect)
 <record_type fa58ccc0
system__tasking__protected_objects__operations__communication_block
sizes-gimplified volatile visited type_2 BLK
    size <integer_cst fa4058fc type <integer_type faefb0c0 bitsizetype>
constant 64>
    unit-size <integer_cst fa405910 type <integer_type faefb060 sizetype>
constant 8>
    align:32 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type fa58ccc0
    fields <field_decl fa589e70 self
        type <pointer_type fa5a3a20 system__tasking__task_id type <record_type
fa5a3960 system__tasking__ada_task_control_block>
            static unsigned SI
            size <integer_cst fa4058ac constant 32>
            unit-size <integer_cst fa4058c0 constant 4>
            align:32 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
fa542900>
        side-effects volatile unsigned nonaddressable SI
/var/gcc/regression/trunk/11-gcc/build/i386-pc-solaris2.11/libada/adainclude/s-tpobop.ads:193:7
size <integer_cst fa4058ac 32> unit-size <integer_cst fa4058c0 4>
        align:32 warn_if_not_align:0 offset_align 128
        offset <integer_cst fa4058d4 constant 0>
        bit-offset <integer_cst fa405924 constant 0> context <record_type
fa58cc60 system__tasking__protected_objects__operations__communication_block>
        chain <field_decl fa589ec8 enqueued type <boolean_type fa41b480
boolean>
            side-effects volatile unsigned nonaddressable QI
/var/gcc/regression/trunk/11-gcc/build/i386-pc-solaris2.11/libada/adainclude/s-tpobop.ads:194:7
            size <integer_cst fa4059b0 constant 8>
            unit-size <integer_cst fa4059c4 constant 1>
            align:8 warn_if_not_align:0 offset_align 128 offset <integer_cst
fa4058d4 0> bit-offset <integer_cst fa4058ac 32> context <record_type fa58cc60
system__tasking__protected_objects__operations__communication_block> chain
<field_decl fa589f20 cancelled>>> context <translation_unit_decl fa40f558
/vol/gcc/src/hg/trunk/local/gcc/testsuite/gnat.dg/lto8.adb>
    Ada size <integer_cst fa558d98 type <integer_type faefb0c0 bitsizetype>
constant visited 48>
    pointer_to_this <pointer_type fa58ce40> reference_to_this <reference_type
fa58cd20> chain <type_decl fa593000
system__tasking__protected_objects__operations__communication_block>>
(gdb) p t
$3 = (tree) 0xfa58cc60
(gdb) pt
warning: Expression is not an assignment (and might have no effect)
 <record_type fa58cc60
system__tasking__protected_objects__operations__communication_block type_2 BLK
    size <integer_cst fa4058fc type <integer_type faefb0c0 bitsizetype>
constant 64>
    unit-size <integer_cst fa405910 type <integer_type faefb060 sizetype>
constant 8>
    align:32 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type fa58cc60
    fields <field_decl fa589e70 self
        type <pointer_type fa5a3a20 system__tasking__task_id type <record_type
fa5a3960 system__tasking__ada_task_control_block>
            static unsigned SI
            size <integer_cst fa4058ac constant 32>
            unit-size <integer_cst fa4058c0 constant 4>
            align:32 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
fa542900>
        side-effects volatile unsigned nonaddressable SI
/var/gcc/regression/trunk/11-gcc/build/i386-pc-solaris2.11/libada/adainclude/s-tpobop.ads:193:7
size <integer_cst fa4058ac 32> unit-size <integer_cst fa4058c0 4>
        align:32 warn_if_not_align:0 offset_align 128
        offset <integer_cst fa4058d4 constant 0>
        bit-offset <integer_cst fa405924 constant 0> context <record_type
fa58cc60 system__tasking__protected_objects__operations__communication_block>
        chain <field_decl fa589ec8 enqueued type <boolean_type fa41b480
boolean>
            side-effects volatile unsigned nonaddressable QI
/var/gcc/regression/trunk/11-gcc/build/i386-pc-solaris2.11/libada/adainclude/s-tpobop.ads:194:7
            size <integer_cst fa4059b0 constant 8>
            unit-size <integer_cst fa4059c4 constant 1>
            align:8 warn_if_not_align:0 offset_align 128 offset <integer_cst
fa4058d4 0> bit-offset <integer_cst fa4058ac 32> context <record_type fa58cc60
system__tasking__protected_objects__operations__communication_block> chain
<field_decl fa589f20 cancelled>>> context <translation_unit_decl fa40f558
/vol/gcc/src/hg/trunk/local/gcc/testsuite/gnat.dg/lto8.adb>
    Ada size <integer_cst fa558d98 type <integer_type faefb0c0 bitsizetype>
constant visited 48>
    chain <type_decl fa589f78
system__tasking__protected_objects__operations__communication_block>>
Reply | Threaded
Open this post in threaded view
|

[Bug ipa/87957] [9 Regression] ICE tree check: expected tree that contains ‘decl minimal’ structure, have ‘identifier_node’ in warn_odr, at ipa-devirt.c:1051 since r265519

asolokha at gmx dot com
In reply to this post by asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87957

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ebotcazou at gcc dot gnu.org

--- Comment #16 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
> (gdb) pt
> warning: Expression is not an assignment (and might have no effect)
>  <record_type fa58ccc0
> system__tasking__protected_objects__operations__communication_block
> sizes-gimplified volatile visited type_2 BLK

The problem is here ^^^^^^^ I think, i.e. we have a volatile variant.  The
problem may come from the Ada front-end, but it would be nice to have Jan's
viewpoint.
Reply | Threaded
Open this post in threaded view
|

[Bug ipa/87957] [9 Regression] ICE tree check: expected tree that contains ‘decl minimal’ structure, have ‘identifier_node’ in warn_odr, at ipa-devirt.c:1051 since r265519

asolokha at gmx dot com
In reply to this post by asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87957

--- Comment #17 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
> The problem is here ^^^^^^^ I think, i.e. we have a volatile variant.  The
> problem may come from the Ada front-end, but it would be nice to have Jan's
> viewpoint.

It comes from libgnarl/s-tpobop.ads:

   type Communication_Block is record
      Self      : Task_Id;
      Enqueued  : Boolean := True;
      Cancelled : Boolean := False;
   end record;
   pragma Volatile (Communication_Block);

i.e. the declared type is volatile (but of course the main variant is not).
Reply | Threaded
Open this post in threaded view
|

[Bug ipa/87957] [9 Regression] ICE tree check: expected tree that contains ‘decl minimal’ structure, have ‘identifier_node’ in warn_odr, at ipa-devirt.c:1051 since r265519

asolokha at gmx dot com
In reply to this post by asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87957

--- Comment #18 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I guess the middle-end relies on TYPE_NAME to have the TYPE_MAIN_VARIANT type
rather than be qualified.  The question if just here and it is possible to cope
with that, or elsewhere too.
12