This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Fix verifier ICE on array simplification
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 24 Dec 2018 12:22:44 +0100
- Subject: Fix verifier ICE on array simplification
As discussed in the PR log, it seems difficult to simplify zero sized
arrays and keep gimple verification happy. Since this has only minor
effect on memory use, I am disabling it for GCC9 and will re-visit the
issue for GCC 10.
Bootstrapped/regtested x86_64-linux.
Honza
PR lto/88140
* tree.c (fld_simplified_type): Temporarily disable array
simplification.
* gcc.c-torture/pr88140.c: New testcase.
Index: tree.c
===================================================================
--- tree.c (revision 267397)
+++ tree.c (working copy)
@@ -5372,7 +5372,8 @@ fld_simplified_type (tree t, struct free
return t;
if (POINTER_TYPE_P (t))
return fld_incomplete_type_of (t, fld);
- if (TREE_CODE (t) == ARRAY_TYPE)
+ /* FIXME: This triggers verification error, see PR88140. */
+ if (TREE_CODE (t) == ARRAY_TYPE && 0)
return fld_process_array_type (t, fld_simplified_type (TREE_TYPE (t), fld),
fld_simplified_types, fld);
return t;
Index: testsuite/gcc.c-torture/pr88140.c
===================================================================
--- testsuite/gcc.c-torture/pr88140.c (nonexistent)
+++ testsuite/gcc.c-torture/pr88140.c (working copy)
@@ -0,0 +1,9 @@
+typedef struct {
+} a;
+
+typedef struct {
+ a *b[0];
+} c;
+
+void d() { ((c *)0)->b[0] = 0; }
+