Commit 37e373c2 by Jakub Jelinek Committed by Jakub Jelinek

re PR tree-optimization/71647 (aligned(x:32) in #pragma omp simd does not work)

	PR tree-optimization/71647
	* omp-low.c (lower_rec_input_clauses): Convert
	omp_clause_aligned_alignment (c) to size_type_node for the
	last argument of __builtin_assume_aligned.

	* gcc.target/i386/pr71647.c: New test.

From-SVN: r237769
parent de86ff8f
2016-06-24 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/71647
* omp-low.c (lower_rec_input_clauses): Convert
omp_clause_aligned_alignment (c) to size_type_node for the
last argument of __builtin_assume_aligned.
2016-06-24 Martin Liska <mliska@suse.cz>
* cfgloop.c (flow_loop_dump): Dump average number of loop iterations.
......
......@@ -4475,8 +4475,9 @@ lower_rec_input_clauses (tree clauses, gimple_seq *ilist, gimple_seq *dlist,
if (new_var == NULL_TREE)
new_var = maybe_lookup_decl_in_outer_ctx (var, ctx);
x = builtin_decl_explicit (BUILT_IN_ASSUME_ALIGNED);
x = build_call_expr_loc (clause_loc, x, 2, new_var,
omp_clause_aligned_alignment (c));
tree alarg = omp_clause_aligned_alignment (c);
alarg = fold_convert_loc (clause_loc, size_type_node, alarg);
x = build_call_expr_loc (clause_loc, x, 2, new_var, alarg);
x = fold_convert_loc (clause_loc, TREE_TYPE (new_var), x);
x = build2 (MODIFY_EXPR, TREE_TYPE (new_var), new_var, x);
gimplify_and_add (x, ilist);
......@@ -4489,8 +4490,9 @@ lower_rec_input_clauses (tree clauses, gimple_seq *ilist, gimple_seq *dlist,
t = maybe_lookup_decl_in_outer_ctx (var, ctx);
t = build_fold_addr_expr_loc (clause_loc, t);
t2 = builtin_decl_explicit (BUILT_IN_ASSUME_ALIGNED);
t = build_call_expr_loc (clause_loc, t2, 2, t,
omp_clause_aligned_alignment (c));
tree alarg = omp_clause_aligned_alignment (c);
alarg = fold_convert_loc (clause_loc, size_type_node, alarg);
t = build_call_expr_loc (clause_loc, t2, 2, t, alarg);
t = fold_convert_loc (clause_loc, ptype, t);
x = create_tmp_var (ptype);
t = build2 (MODIFY_EXPR, ptype, x, t);
......
2016-06-24 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/71647
* gcc.target/i386/pr71647.c: New test.
2016-06-24 Uros Bizjak <ubizjak@gmail.com>
* gcc.dg/vect/vect-nb-iter-ub-1.c: Remove default vector
......
/* PR tree-optimization/71647 */
/* { dg-do compile } */
/* { dg-options "-O3 -fopenmp-simd -mavx -mno-avx512f -fdump-tree-vect-details" } */
void
foo (double *a, double *b)
{
int i;
#pragma omp simd aligned(a,b:4*sizeof(double))
for (i = 0; i < 32768; i++)
a[i] += b[i];
}
void
bar (double *a, double *b)
{
int i;
#pragma omp simd aligned(a,b:32)
for (i = 0; i < 32768; i++)
a[i] += b[i];
}
void
baz (double *a, double *b)
{
int i;
#pragma omp simd aligned(a,b:32L)
for (i = 0; i < 32768; i++)
a[i] += b[i];
}
/* { dg-final { scan-tree-dump-not "Alignment of access forced using peeling" "vect" } } */
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