Commit 8b5d2c55 by Jakub Jelinek Committed by Jakub Jelinek

re PR target/88965 (powerpc64le vector builtin hits ICE in verify_gimple)

	PR target/88965
	* config/rs6000/rs6000.c: Include tree-vrp.h and tree-ssanames.h.
	(rs6000_gimple_fold_builtin): If MEM_REF address doesn't satisfy
	is_gimple_mem_ref_addr predicate, force it into a SSA_NAME first.

	* gcc.target/powerpc/pr88965.c: New test.

From-SVN: r268166
parent 18a23298
2019-01-22 Jakub Jelinek <jakub@redhat.com>
PR target/88965
* config/rs6000/rs6000.c: Include tree-vrp.h and tree-ssanames.h.
(rs6000_gimple_fold_builtin): If MEM_REF address doesn't satisfy
is_gimple_mem_ref_addr predicate, force it into a SSA_NAME first.
PR middle-end/88968
* gimplify.c (gimplify_omp_atomic): Handle bitfield atomics with
non-integral DECL_BIT_FIELD_REPRESENTATIVEs.
......
......@@ -81,6 +81,8 @@
#include "case-cfn-macros.h"
#include "ppc-auxv.h"
#include "tree-ssa-propagate.h"
#include "tree-vrp.h"
#include "tree-ssanames.h"
/* This file should be included last. */
#include "target-def.h"
......@@ -15852,6 +15854,13 @@ rs6000_gimple_fold_builtin (gimple_stmt_iterator *gsi)
arg1_type, temp_addr,
build_int_cst (arg1_type, -16));
gsi_insert_seq_before (gsi, stmts, GSI_SAME_STMT);
if (!is_gimple_mem_ref_addr (aligned_addr))
{
tree t = make_ssa_name (TREE_TYPE (aligned_addr));
gimple *g = gimple_build_assign (t, aligned_addr);
gsi_insert_before (gsi, g, GSI_SAME_STMT);
aligned_addr = t;
}
/* Use the build2 helper to set up the mem_ref. The MEM_REF could also
take an offset, but since we've already incorporated the offset
above, here we just pass in a zero. */
......@@ -15897,6 +15906,13 @@ rs6000_gimple_fold_builtin (gimple_stmt_iterator *gsi)
arg2_type, temp_addr,
build_int_cst (arg2_type, -16));
gsi_insert_seq_before (gsi, stmts, GSI_SAME_STMT);
if (!is_gimple_mem_ref_addr (aligned_addr))
{
tree t = make_ssa_name (TREE_TYPE (aligned_addr));
gimple *g = gimple_build_assign (t, aligned_addr);
gsi_insert_before (gsi, g, GSI_SAME_STMT);
aligned_addr = t;
}
/* The desired gimple result should be similar to:
MEM[(__vector floatD.1407 *)_1] = vf1D.2697; */
gimple *g
......@@ -15934,6 +15950,13 @@ rs6000_gimple_fold_builtin (gimple_stmt_iterator *gsi)
tree temp_addr = gimple_build (&stmts, loc, POINTER_PLUS_EXPR,
arg1_type, arg1, temp_offset);
gsi_insert_seq_before (gsi, stmts, GSI_SAME_STMT);
if (!is_gimple_mem_ref_addr (temp_addr))
{
tree t = make_ssa_name (TREE_TYPE (temp_addr));
gimple *g = gimple_build_assign (t, temp_addr);
gsi_insert_before (gsi, g, GSI_SAME_STMT);
temp_addr = t;
}
/* Use the build2 helper to set up the mem_ref. The MEM_REF could also
take an offset, but since we've already incorporated the offset
above, here we just pass in a zero. */
......@@ -15970,6 +15993,13 @@ rs6000_gimple_fold_builtin (gimple_stmt_iterator *gsi)
tree temp_addr = gimple_build (&stmts, loc, POINTER_PLUS_EXPR,
arg2_type, arg2, temp_offset);
gsi_insert_seq_before (gsi, stmts, GSI_SAME_STMT);
if (!is_gimple_mem_ref_addr (temp_addr))
{
tree t = make_ssa_name (TREE_TYPE (temp_addr));
gimple *g = gimple_build_assign (t, temp_addr);
gsi_insert_before (gsi, g, GSI_SAME_STMT);
temp_addr = t;
}
gimple *g;
g = gimple_build_assign (build2 (MEM_REF, align_stype, temp_addr,
build_int_cst (arg2_type, 0)), arg0);
2019-01-22 Jakub Jelinek <jakub@redhat.com>
PR target/88965
* gcc.target/powerpc/pr88965.c: New test.
PR middle-end/88968
* c-c++-common/gomp/atomic-23.c: New test.
......
/* PR target/88965 */
/* { dg-do compile } */
/* { dg-require-effective-target powerpc_vsx_ok } */
/* { dg-options "-O2 -mvsx" } */
unsigned int a[16];
unsigned int __attribute__ ((vector_size (16))) b;
void
foo (void)
{
b = __builtin_vec_vsx_ld (0, &a[0]);
}
void
bar (void)
{
__builtin_vec_vsx_st (b, 0, &a[0]);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment