From 62b233f22449de60755b07c16f16b1a020c0708c Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Tue, 5 Apr 2016 08:05:06 +0000 Subject: [PATCH] re PR middle-end/70499 (internal compiler error: in make_ssa_name_fn, at tree-ssanames.c:266) 2016-04-05 Richard Biener PR middle-end/70499 * gimplify-me.c (gimple_regimplify_operands): Do not rewrite non-register type temporaries into SSA. * g++.dg/torture/pr70499.C: New testcase. From-SVN: r234738 --- gcc/ChangeLog | 6 ++++ gcc/gimplify-me.c | 3 +- gcc/testsuite/ChangeLog | 5 ++++ gcc/testsuite/g++.dg/torture/pr70499.C | 39 ++++++++++++++++++++++++++ 4 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/g++.dg/torture/pr70499.C diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d9ad89c3dd6..b97f4ac848f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2016-04-05 Richard Biener + + PR middle-end/70499 + * gimplify-me.c (gimple_regimplify_operands): Do not rewrite + non-register type temporaries into SSA. + 2016-04-04 Jan Hubicka PR ipa/66223 diff --git a/gcc/gimplify-me.c b/gcc/gimplify-me.c index c80a4ff459d..28e467b990e 100644 --- a/gcc/gimplify-me.c +++ b/gcc/gimplify-me.c @@ -299,7 +299,8 @@ gimple_regimplify_operands (gimple *stmt, gimple_stmt_iterator *gsi_p) if (need_temp) { tree temp = create_tmp_reg (TREE_TYPE (lhs)); - if (gimple_in_ssa_p (cfun)) + if (gimple_in_ssa_p (cfun) + && is_gimple_reg_type (TREE_TYPE (lhs))) temp = make_ssa_name (temp); gimple_set_lhs (stmt, temp); post_stmt = gimple_build_assign (lhs, temp); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4a701c4ab5a..baebdb0a21b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-04-05 Richard Biener + + PR middle-end/70499 + * g++.dg/torture/pr70499.C: New testcase. + 2016-04-05 Richard Biener * gcc.dg/tree-ssa/20030814-6.c: Fix testcase, disable FRE, diff --git a/gcc/testsuite/g++.dg/torture/pr70499.C b/gcc/testsuite/g++.dg/torture/pr70499.C new file mode 100644 index 00000000000..954fea5de2f --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr70499.C @@ -0,0 +1,39 @@ +// { dg-do compile } +// { dg-additional-options "-w -Wno-psabi" } +// { dg-additional-options "-mavx" { target x86_64-*-* i?86-*-* } } + +typedef double __m256d __attribute__ ((__vector_size__ (32), __may_alias__)); + +struct SIMD { + __m256d data; + SIMD() {}; + SIMD (double val) { } + SIMD(__m256d _data) { data = _data; } + SIMD operator* (SIMD a) { return a; } +}; + +struct Foo { + SIMD val; + SIMD dval[2]; + __attribute__((__always_inline__)) SIMD & Value() throw() { return val; } + __attribute__((__always_inline__)) Foo operator* ( const Foo & y) throw() + { + Foo res; + SIMD hx; + SIMD hy; + res.Value() = hx*hy; + res.dval[0] = hx*hy; + return res; + } +}; + +template +__attribute__((__always_inline__)) inline void inlineFunc(Tx hx[]) { + Tx x = hx[0], y = hx[1]; + Tx lam[1] = (x*y); +} + +void FooBarFunc () { + Foo adp[2]; + inlineFunc (adp); +}