aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/ldist-14.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2009-06-29 12:23:21 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2009-06-29 12:23:21 +0000
commit74d27244ecfc02a14355efc26855034a684daeb9 (patch)
tree9628cef93c202d8f6bd22c558673343fbd31f01a /gcc/testsuite/gcc.dg/tree-ssa/ldist-14.c
parent5b21f0f37dd072967e60c5e413dbabec1eb1c837 (diff)
downloadgcc-74d27244ecfc02a14355efc26855034a684daeb9.zip
gcc-74d27244ecfc02a14355efc26855034a684daeb9.tar.gz
gcc-74d27244ecfc02a14355efc26855034a684daeb9.tar.bz2
re PR middle-end/14187 ([tree-ssa] C restricted pointers are not properly implemented)
2009-06-29 Richard Guenther <rguenther@suse.de> PR middle-end/14187 * tree-ssa-alias.h (struct pt_solution): Add vars_contains_restrict flag. (pt_solutions_same_restrict_base): Declare. * tree-ssa-structalias.c (struct variable_info): Add is_restrict_var flag. (new_var_info): Initialize is_global_var properly for SSA_NAMEs. (make_constraint_from, make_copy_constraint): Move earlier. (make_constraint_from_heapvar): New function. (make_constraint_from_restrict): Likewise. (handle_lhs_call): Use it. (find_func_aliases): Use it to track conversions to restrict qualified pointers. (struct fieldoff): Add only_restrict_pointers flag. (push_fields_onto_fieldstack): Initialize it. (create_variable_info_for): Track global restrict qualified pointers. (intra_create_variable_infos): Use make_constraint_from_heapvar. Track restrict qualified pointer arguments. (set_uids_in_ptset): Use varinfo is_global_var flag. (find_what_var_points_to): Set the vars_contains_restrict flag. Always create the points-to solution for sets including restrict tags. (pt_solutions_same_restrict_base): New function. * tree-ssa-alias.c (ptr_derefs_may_alias_p): For two restrict qualified pointers use pt_solutions_same_restrict_base as additional source for disambiguation. * gcc.dg/tree-ssa/restrict-1.c: New testcase. * gcc.dg/tree-ssa/restrict-2.c: Likewise. * gcc.dg/tree-ssa/restrict-3.c: Likewise. * gcc.c-torture/execute/20090623-1.c: Likewise. * gcc.dg/tree-ssa/ldist-13.c: Likewise. * gcc.dg/tree-ssa/ldist-14.c: Likewise. From-SVN: r149048
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-ssa/ldist-14.c')
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ldist-14.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ldist-14.c b/gcc/testsuite/gcc.dg/tree-ssa/ldist-14.c
new file mode 100644
index 0000000..700599f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ldist-14.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-strict-aliasing -ftree-loop-distribution -fdump-tree-ldist-details" } */
+
+struct desc {
+ int i;
+ void * __restrict__ data;
+ int j;
+} a, b;
+
+float foo (int n)
+{
+ int i;
+ float * __restrict__ x, * __restrict__ y, tmp = 0.0;
+ x = (float * __restrict__)a.data;
+ y = (float * __restrict__)b.data;
+ for (i = 0; i < n; ++i)
+ {
+ x[i] = 0.0;
+ tmp += y[i];
+ }
+ return tmp;
+}
+
+/* We should apply loop distribution. */
+
+/* { dg-final { scan-tree-dump "Loop 1 distributed: split to 2 loops" "ldist" } } */
+/* { dg-final { cleanup-tree-dump "ldist" } } */