summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0364-2011-05-29-Richard-Guenther-rguenther-suse.de.patch
blob: 251260accf6911d5acab377aad159908cbfce0a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
From d5ea0b26fccb8359f0edce472053beca74f50f93 Mon Sep 17 00:00:00 2001
From: rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Sun, 29 May 2011 17:00:13 +0000
Subject: [PATCH] 2011-05-29  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/49217
	* ipa-pure-const.c (propagate_pure_const): Fix typos.

	* gcc.dg/torture/pr49217.c: New testcase.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@174399 138bc75d-0d04-0410-961f-82ee72b054a4

index 3b4cc02..b9476e6 100644
--- a/gcc/ipa-pure-const.c
+++ b/gcc/ipa-pure-const.c
@@ -1223,7 +1223,7 @@ propagate_pure_const (void)
 	    break;
 
 	  /* Now process the indirect call.  */
-          for (ie = node->indirect_calls; ie; ie = ie->next_callee)
+          for (ie = w->indirect_calls; ie; ie = ie->next_callee)
 	    {
 	      enum pure_const_state_e edge_state = IPA_CONST;
 	      bool edge_looping = false;
@@ -1246,7 +1246,7 @@ propagate_pure_const (void)
 	    break;
 
 	  /* And finally all loads and stores.  */
-	  for (i = 0; ipa_ref_list_reference_iterate (&node->ref_list, i, ref); i++)
+	  for (i = 0; ipa_ref_list_reference_iterate (&w->ref_list, i, ref); i++)
 	    {
 	      enum pure_const_state_e ref_state = IPA_CONST;
 	      bool ref_looping = false;
new file mode 100644
index 0000000..e8a89de
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr49217.c
@@ -0,0 +1,26 @@
+/* { dg-do run } */
+/* { dg-options "-fno-early-inlining" } */
+
+extern void abort (void);
+int i;
+static void foo(void);
+void __attribute__((noinline))
+bar (void)
+{
+  if (!i)
+    foo ();
+}
+static void
+foo(void)
+{
+  i = 1;
+  bar ();
+}
+int main()
+{
+  i = 0;
+  bar();
+  if (i != 1)
+    abort ();
+  return 0;
+}
-- 
1.7.0.4