From e0ca27c53103d532b51a61679b5d4c13d35a09d0 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Mon, 30 Nov 2015 16:34:26 +0000 Subject: Handle BUILT_IN_GOMP_PARALLEL in ipa-pta 2015-11-30 Tom de Vries 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. From-SVN: r231076 --- libgomp/ChangeLog | 5 ++++ libgomp/testsuite/libgomp.c/pr46032.c | 44 +++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 libgomp/testsuite/libgomp.c/pr46032.c (limited to 'libgomp') diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index a2ff98c..ce2828a 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,8 @@ +2015-11-30 Tom de Vries + + PR tree-optimization/46032 + * testsuite/libgomp.c/pr46032.c: New test. + 2015-11-27 Jakub Jelinek PR libgomp/68579 diff --git a/libgomp/testsuite/libgomp.c/pr46032.c b/libgomp/testsuite/libgomp.c/pr46032.c new file mode 100644 index 0000000..2178aa7 --- /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; +} -- cgit v1.1