From: Richard Biener Date: Thu, 13 Jun 2019 13:03:13 +0000 (+0000) Subject: re PR tree-optimization/90856 (ICE: verify_gimple failed (error: incompatible types... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9bc83b61ff2b3353934704befe02c2262c48d2bc;p=gcc.git re PR tree-optimization/90856 (ICE: verify_gimple failed (error: incompatible types in 'PHI' argument 1)) 2019-06-13 Richard Biener PR tree-optimization/90856 * tree-sra.c (build_ref_for_model): Only use build_reconstructed_reference when address-spaces are the same. * gcc.target/i386/pr90856.c: New testcase. From-SVN: r272244 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b8eba5e1c48..685c06d76b8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-06-13 Richard Biener + + PR tree-optimization/90856 + * tree-sra.c (build_ref_for_model): Only use + build_reconstructed_reference when address-spaces are the same. + 2019-06-13 Jakub Jelinek * config/nvptx/nvptx.c (nvptx_sese_number, nvptx_sese_pseudo): Don't diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5dbfc35df03..b1d8ecc6465 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-06-13 Richard Biener + + PR tree-optimization/90856 + * gcc.target/i386/pr90856.c: New testcase. + 2019-06-13 Jakub Jelinek * g++.dg/tree-ssa/ssa-dse-1.C: Don't match exact number of chars of diff --git a/gcc/testsuite/gcc.target/i386/pr90856.c b/gcc/testsuite/gcc.target/i386/pr90856.c new file mode 100644 index 00000000000..a9a909b9eda --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr90856.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-options "-O3" } */ + +typedef struct { int v; } S1; +typedef struct { S1 s1[32]; } S2; + +S1 clearS1() { S1 s; s.v = 1; return s; } + +void +clearS2(__seg_gs S2 *p, int n) +{ + for (int i = 0; i < n; ++i) + p->s1[i] = clearS1(); +} diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c index 074d4964379..03c1a2ae9e9 100644 --- a/gcc/tree-sra.c +++ b/gcc/tree-sra.c @@ -1854,6 +1854,8 @@ build_ref_for_model (location_t loc, tree base, HOST_WIDE_INT offset, tree res; if (model->grp_same_access_path && !TREE_THIS_VOLATILE (base) + && (TYPE_ADDR_SPACE (TREE_TYPE (base)) + == TYPE_ADDR_SPACE (TREE_TYPE (model->expr))) && offset <= model->offset /* build_reconstructed_reference can still fail if we have already massaged BASE because of another type incompatibility. */