summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0183-PR-debug-48768.patch
blob: 609f11043013a08fb15c892808b748d9e70722bc (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
69
70
71
72
73
74
75
76
77
78
79
80
81
From 8a0e77485c3d9d34c6f65cec908829dcc4cd5fee Mon Sep 17 00:00:00 2001
From: jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Tue, 26 Apr 2011 13:47:13 +0000
Subject: [PATCH 183/200] 	PR debug/48768
 	* tree-ssa.c (insert_debug_temp_for_var_def): If degenerate_phi_result
 	is error_mark_node, set value to NULL.

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


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

index 566f02e..a4e5470 100644
new file mode 100644
index 0000000..7d0383e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr48768.c
@@ -0,0 +1,38 @@
+/* PR debug/48768 */
+/* { dg-do compile } */
+/* { dg-options "-O -fcompare-debug" } */
+
+int a, b;
+
+int
+bar (void)
+{
+  int i, j = 1;
+  for (i = 0; i != 10; i++)
+    {
+    lab:
+      if (i)
+	{
+	  int *k = &j;
+	}
+      else if (j)
+	goto lab;
+    }
+  return 1;
+}
+
+inline int
+foo (int x)
+{
+  unsigned int c = x;
+  int d = x;
+  if (bar ())
+    for (; c; c++)
+      while (x >= 0)
+	if (foo (d) >= 0)
+	  {
+	    d = bar ();
+	    a = b ? b : 1;
+	  }
+  return 0;
+}
diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c
index eaf3ef9..da6cc9b 100644
--- a/gcc/tree-ssa.c
+++ b/gcc/tree-ssa.c
@@ -1,5 +1,5 @@
 /* Miscellaneous SSA utility functions.
-   Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010
+   Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011
    Free Software Foundation, Inc.
 
 This file is part of GCC.
@@ -352,6 +352,10 @@ insert_debug_temp_for_var_def (gimple_stmt_iterator *gsi, tree var)
       value = degenerate_phi_result (def_stmt);
       if (value && walk_tree (&value, find_released_ssa_name, NULL, NULL))
 	value = NULL;
+      /* error_mark_node is what fixup_noreturn_call changes PHI arguments
+	 to.  */
+      else if (value == error_mark_node)
+	value = NULL;
     }
   else if (is_gimple_assign (def_stmt))
     {
-- 
1.7.0.4

OpenPOWER on IntegriCloud