From 77e9f49535e298fb326cf0ebc208636d1dcf3f37 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Mon, 24 Dec 2018 12:21:25 +0100 Subject: [PATCH] tree.c (fld_simplified_type): Temporarily disable array simplification. * tree.c (fld_simplified_type): Temporarily disable array simplification. * gcc.c-torture/pr88140.c: New testcase. From-SVN: r267398 --- gcc/ChangeLog | 6 ++++++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.c-torture/pr88140.c | 19 +++++++++++++++++++ gcc/tree.c | 3 ++- 4 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.c-torture/pr88140.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 77631ac9a21..dce70c80634 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-12-24 Jan Hubicka + + PR lto/88140 + * tree.c (fld_simplified_type): Temporarily disable array + simplification. + 2018-12-24 Jan Hubicka * lto-symtab.c (lto_symtab_merge_decls_2): Do not report ODR violations diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 933b716b9f9..6cd73cc9775 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-12-24 Jan Hubicka + + PR lto/88140 + * gcc.c-torture/pr88140.c: New testcase. + 2018-12-24 Iain Sandoe PR testsuite/67974 diff --git a/gcc/testsuite/gcc.c-torture/pr88140.c b/gcc/testsuite/gcc.c-torture/pr88140.c new file mode 100644 index 00000000000..a08c2cb89d8 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/pr88140.c @@ -0,0 +1,19 @@ +typedef struct { +} a; + +typedef struct { + a *b[0]; +} c; + +void d() { ((c *)0)->b[0] = 0; } + +typedef struct { +} a; + +typedef struct { + a *b[0]; +} c; + +void d() { ((c *)0)->b[0] = 0; } + + diff --git a/gcc/tree.c b/gcc/tree.c index c3d4bb8a00a..5fd3be1e1f3 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -5372,7 +5372,8 @@ fld_simplified_type (tree t, struct free_lang_data_d *fld) 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; -- 2.30.2