diff options
author | vries <vries@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-11-30 16:34:26 +0000 |
---|---|---|
committer | vries <vries@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-11-30 16:34:26 +0000 |
commit | 32f0f54b754e69d96937c3268fb520d30b70ddb3 (patch) | |
tree | fe36cf7c64756119ed297892e4582c3f0d2973bc /libgomp/testsuite/libgomp.c | |
parent | 851c1b0cf306bd436efb3daefc3bc6d8d13b97cb (diff) | |
download | gcc-32f0f54b754e69d96937c3268fb520d30b70ddb3.tar.gz |
Handle BUILT_IN_GOMP_PARALLEL in ipa-pta
2015-11-30 Tom de Vries <tom@codesourcery.com>
PR tree-optimization/46032
* tree-ssa-structalias.c (find_func_aliases_for_call_arg): New function,
factored out of ...
(find_func_aliases_for_call): ... here.
(find_func_aliases_for_builtin_call, find_func_clobbers): Handle
BUILT_IN_GOMP_PARALLEL.
(ipa_pta_execute): Same. Handle node->parallelized_function as a local
function.
* gcc.dg/pr46032.c: New test.
* testsuite/libgomp.c/pr46032.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231076 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgomp/testsuite/libgomp.c')
-rw-r--r-- | libgomp/testsuite/libgomp.c/pr46032.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/libgomp/testsuite/libgomp.c/pr46032.c b/libgomp/testsuite/libgomp.c/pr46032.c new file mode 100644 index 00000000000..2178aa7c9bb --- /dev/null +++ b/libgomp/testsuite/libgomp.c/pr46032.c @@ -0,0 +1,44 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -ftree-vectorize -std=c99 -fipa-pta" } */ + + +extern void abort (void); + +#define nEvents 1000 + +static void __attribute__((noinline, noclone, optimize("-fno-tree-vectorize"))) +init (unsigned *results, unsigned *pData) +{ + unsigned int i; + for (i = 0; i < nEvents; ++i) + pData[i] = i % 3; +} + +static void __attribute__((noinline, noclone, optimize("-fno-tree-vectorize"))) +check (unsigned *results) +{ + unsigned sum = 0; + for (int idx = 0; idx < (int)nEvents; idx++) + sum += results[idx]; + + if (sum != 1998) + abort (); +} + +int +main (void) +{ + unsigned results[nEvents]; + unsigned pData[nEvents]; + unsigned coeff = 2; + + init (&results[0], &pData[0]); + +#pragma omp parallel for + for (int idx = 0; idx < (int)nEvents; idx++) + results[idx] = coeff * pData[idx]; + + check (&results[0]); + + return 0; +} |