Commit 8498c16b by Tom de Vries Committed by Tom de Vries

Clear restrict in install_var_field

2015-12-08  Tom de Vries  <tom@codesourcery.com>

	PR tree-optimization/68640
	* omp-low.c (install_var_field): Clear the restrict qualifier on the var
	type.

From-SVN: r231411
parent 9b340934
2015-12-08 Tom de Vries <tom@codesourcery.com>
PR tree-optimization/68640
* omp-low.c (install_var_field): Clear the restrict qualifier on the var
type.
2015-12-08 Kirill Yukhin <kirill.yukhin@intel.com> 2015-12-08 Kirill Yukhin <kirill.yukhin@intel.com>
* config/i386/sse.md (define_insn "<avx512>_vec_dup<mode>_1"): Fix * config/i386/sse.md (define_insn "<avx512>_vec_dup<mode>_1"): Fix
...@@ -1389,6 +1389,13 @@ install_var_field (tree var, bool by_ref, int mask, omp_context *ctx, ...@@ -1389,6 +1389,13 @@ install_var_field (tree var, bool by_ref, int mask, omp_context *ctx,
|| !is_gimple_omp_oacc (ctx->stmt)); || !is_gimple_omp_oacc (ctx->stmt));
type = TREE_TYPE (var); type = TREE_TYPE (var);
/* Prevent redeclaring the var in the split-off function with a restrict
pointer type. Note that we only clear type itself, restrict qualifiers in
the pointed-to type will be ignored by points-to analysis. */
if (POINTER_TYPE_P (type)
&& TYPE_RESTRICT (type))
type = build_qualified_type (type, TYPE_QUALS (type) & ~TYPE_QUAL_RESTRICT);
if (mask & 4) if (mask & 4)
{ {
gcc_assert (TREE_CODE (type) == ARRAY_TYPE); gcc_assert (TREE_CODE (type) == ARRAY_TYPE);
......
/* { dg-do compile } */
/* { dg-options "-O2 -fopenmp -fdump-tree-ealias-all" } */
#define N 1024
int
foo (int *__restrict__ ap)
{
int *bp = ap;
#pragma omp parallel for
for (unsigned int idx = 0; idx < N; idx++)
ap[idx] = bp[idx];
}
/* { dg-final { scan-tree-dump-times "clique 1 base 1" 2 "ealias" } } */
/* { dg-final { scan-tree-dump-times "(?n)clique .* base .*" 2 "ealias" } } */
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