summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0274-PR-tree-optimization-49000.patch
blob: dfc7a3cd54722de4fc959041884e3542eac7dfbc (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
From 2d5c4b99176636cc96004730fb540a66ee5c209b Mon Sep 17 00:00:00 2001
From: jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Wed, 18 May 2011 09:31:25 +0000
Subject: [PATCH] 	PR tree-optimization/49000
 	* tree-ssa.c (execute_update_addresses_taken): Call
 	maybe_rewrite_mem_ref_base on debug stmt value.  If it couldn't
 	be rewritten and decl has been marked for renaming, reset
 	the debug stmt.

	* gcc.dg/pr49000.c: New test.


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

diff --git a/gcc/testsuite/gcc.dg/pr49000.c b/gcc/testsuite/gcc.dg/pr49000.c
new file mode 100644
index 0000000..32a1cdb
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr49000.c
@@ -0,0 +1,29 @@
+/* PR tree-optimization/49000 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -g" } */
+
+static
+foo (int x, int y)
+{
+  return x * y;
+}
+
+static int
+bar (int *z)
+{
+  return *z;
+}
+
+void
+baz (void)
+{
+  int a = 42;
+  int *b = &a;
+  foo (bar (&a), 3);
+}
+
+void
+test (void)
+{
+  baz ();
+}
-- 
1.7.0.4