diff options
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0379-PR-tree-optimization-49093.patch')
-rw-r--r-- | meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0379-PR-tree-optimization-49093.patch | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0379-PR-tree-optimization-49093.patch b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0379-PR-tree-optimization-49093.patch new file mode 100644 index 0000000000..d4dbe83486 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0379-PR-tree-optimization-49093.patch | |||
@@ -0,0 +1,61 @@ | |||
1 | From 3fb16a9ff349672beb2818d1139bb689ee424da4 Mon Sep 17 00:00:00 2001 | ||
2 | From: irar <irar@138bc75d-0d04-0410-961f-82ee72b054a4> | ||
3 | Date: Thu, 2 Jun 2011 07:02:57 +0000 | ||
4 | Subject: [PATCH] PR tree-optimization/49093 | ||
5 | * tree-vect-data-refs.c (vect_analyze_data_refs): Fail for | ||
6 | volatile data references. | ||
7 | |||
8 | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@174559 138bc75d-0d04-0410-961f-82ee72b054a4 | ||
9 | |||
10 | index 5ae1848..20fdeec 100644 | ||
11 | new file mode 100644 | ||
12 | index 0000000..b8bded6 | ||
13 | --- /dev/null | ||
14 | +++ b/gcc/testsuite/gcc.dg/vect/pr49093.c | ||
15 | @@ -0,0 +1,22 @@ | ||
16 | +/* { dg-do compile } */ | ||
17 | +/* { dg-options "-O1 -ftree-vectorize -fdump-tree-vect-details -fno-tree-fre" } */ | ||
18 | + | ||
19 | +volatile unsigned char g_324[4] = {0, 1, 0, 1}; | ||
20 | +void foo (int); | ||
21 | +int x, y; | ||
22 | +void func_81(void) | ||
23 | +{ | ||
24 | + int l_466, l_439[7] = {0}, g_97; | ||
25 | +lbl_473: | ||
26 | + if (x) { | ||
27 | + for (g_97 = 0; (g_97 < 4); ++g_97) { | ||
28 | + if (y) | ||
29 | + goto lbl_473; | ||
30 | + g_324[g_97]; | ||
31 | + l_466 = l_439[g_97]; | ||
32 | + } | ||
33 | + foo(l_466); | ||
34 | + } | ||
35 | +} | ||
36 | + | ||
37 | +/* { dg-final { cleanup-tree-dump "vect" } } */ | ||
38 | diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c | ||
39 | index a1437b5..db5098c 100644 | ||
40 | --- a/gcc/tree-vect-data-refs.c | ||
41 | +++ b/gcc/tree-vect-data-refs.c | ||
42 | @@ -2577,6 +2577,16 @@ vect_analyze_data_refs (loop_vec_info loop_vinfo, | ||
43 | return false; | ||
44 | } | ||
45 | |||
46 | + if (TREE_THIS_VOLATILE (DR_REF (dr))) | ||
47 | + { | ||
48 | + if (vect_print_dump_info (REPORT_UNVECTORIZED_LOCATIONS)) | ||
49 | + { | ||
50 | + fprintf (vect_dump, "not vectorized: volatile type "); | ||
51 | + print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM); | ||
52 | + } | ||
53 | + return false; | ||
54 | + } | ||
55 | + | ||
56 | base = unshare_expr (DR_BASE_ADDRESS (dr)); | ||
57 | offset = unshare_expr (DR_OFFSET (dr)); | ||
58 | init = unshare_expr (DR_INIT (dr)); | ||
59 | -- | ||
60 | 1.7.0.4 | ||
61 | |||