~ubuntu-branches/debian/sid/gnat-4.4/sid

« back to all changes in this revision

Viewing changes to debian/patches/pr40718.diff

  • Committer: Bazaar Package Importer
  • Author(s): Ludovic Brenta, Matthias Klose
  • Date: 2009-09-13 15:47:23 UTC
  • Revision ID: james.westby@ubuntu.com-20090913154723-3ihafoq6mqbrlr4i
Tags: 4.4.1-5
Merge from gcc-4.4 (4.4.1-4) unstable; urgency=low

* Update to SVN 20090911 from the gcc-4_4-branch (r151649).
  - Fixes PR target/34412, PR middle-end/41094, PR target/40718,
    PR fortran/41062, PR libstdc++/41005, PR target/41184,
    PR bootstrap/41180, PR c++/41127, PR fortran/41258,
    PR rtl-optimization/40861, PR target/41315, PR fortran/39876.

[ Matthias Klose ]
* Avoid underscores in doc-base document id's to workaround a
  dh_installdocs bug.
* Update file names for the Ada user's guide.
* Set Homepage attribute for packages.
* Update the patch for gnat on armel.
* gcj-4.4-jdk: Depend on libantlr-java. Addresses: #546062.
* Backport patch for PR tree-optimization/41101 from the trunk.
  Fixes: #541816.
* Update libstdc++6.symbols for symbols introduced with the fix
  for PR libstdc++/41005.
* Apply proposed patches for PR libstdc++/40133 and PR target/40134.
  Add symbols exception propagation support in libstdc++ on armel
  to the libstdc++6 symbols.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# DP: Proposed patch for PR target/40718
2
 
 
3
 
2009-08-23  Uros Bizjak  <ubizjak@gmail.com>
4
 
 
5
 
        PR target/40718
6
 
        * config/i386/i386.c (*call_pop_1): Disable for sibling calls.
7
 
        (*call_value_pop_1): Ditto.
8
 
        (*sibcall_pop_1): New insn pattern.
9
 
        (*sibcall_value_pop_1): Ditto.
10
 
 
11
 
2009-08-23  Uros Bizjak  <ubizjak@gmail.com>
12
 
 
13
 
        PR target/40718
14
 
        * gcc.target/i386/pr40718.c: New test.
15
 
 
16
 
Index: gcc/testsuite/gcc.target/i386/pr40718.c
17
 
===================================================================
18
 
--- a/src/gcc/testsuite/gcc.target/i386/pr40718.c       (revision 0)
19
 
+++ b/src/gcc/testsuite/gcc.target/i386/pr40718.c       (revision 151031)
20
 
@@ -0,0 +1,36 @@
21
 
+/* { dg-do run } */
22
 
+/* { dg-require-effective-target ilp32 } */
23
 
+/* { dg-options "-O1 -foptimize-sibling-calls" } */
24
 
+
25
 
+void abort (void);
26
 
+
27
 
+struct S
28
 
+{
29
 
+  void (__attribute__((__stdcall__)) *f) (struct S *);
30
 
+  int i;
31
 
+};
32
 
+
33
 
+void __attribute__((__stdcall__))
34
 
+foo (struct S *s)
35
 
+{
36
 
+  s->i++;
37
 
+}
38
 
+
39
 
+void __attribute__((__stdcall__))
40
 
+bar (struct S *s)
41
 
+{
42
 
+  foo(s);
43
 
+  s->f(s);
44
 
+}
45
 
+
46
 
+int main (void)
47
 
+{
48
 
+  struct S s = { foo, 0 };
49
 
+
50
 
+  bar (&s);
51
 
+  if (s.i != 2)
52
 
+    abort ();
53
 
+
54
 
+  return 0;
55
 
+}
56
 
+
57
 
Index: gcc/config/i386/i386.md
58
 
===================================================================
59
 
--- a/src/gcc/config/i386/i386.md       (revision 151027)
60
 
+++ b/src/gcc/config/i386/i386.md       (revision 151031)
61
 
@@ -15476,22 +15476,25 @@
62
 
         (match_operand:SI 1 "" ""))
63
 
    (set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG)
64
 
                            (match_operand:SI 2 "immediate_operand" "i")))]
65
 
-  "!TARGET_64BIT"
66
 
+  "!SIBLING_CALL_P (insn) && !TARGET_64BIT"
67
 
 {
68
 
   if (constant_call_address_operand (operands[0], Pmode))
69
 
-    {
70
 
-      if (SIBLING_CALL_P (insn))
71
 
-       return "jmp\t%P0";
72
 
-      else
73
 
-       return "call\t%P0";
74
 
-    }
75
 
-  if (SIBLING_CALL_P (insn))
76
 
-    return "jmp\t%A0";
77
 
-  else
78
 
-    return "call\t%A0";
79
 
+    return "call\t%P0";
80
 
+  return "call\t%A0";
81
 
 }
82
 
   [(set_attr "type" "call")])
83
 
 
84
 
+(define_insn "*sibcall_pop_1"
85
 
+  [(call (mem:QI (match_operand:SI 0 "sibcall_insn_operand" "s,U"))
86
 
+        (match_operand:SI 1 "" ""))
87
 
+   (set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG)
88
 
+                           (match_operand:SI 2 "immediate_operand" "i,i")))]
89
 
+  "SIBLING_CALL_P (insn) && !TARGET_64BIT"
90
 
+  "@
91
 
+   jmp\t%P0
92
 
+   jmp\t%A0"
93
 
+  [(set_attr "type" "call")])
94
 
+
95
 
 (define_expand "call"
96
 
   [(call (match_operand:QI 0 "" "")
97
 
         (match_operand 1 "" ""))
98
 
@@ -22092,22 +22095,26 @@
99
 
              (match_operand:SI 2 "" "")))
100
 
    (set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG)
101
 
                            (match_operand:SI 3 "immediate_operand" "i")))]
102
 
-  "!TARGET_64BIT"
103
 
+  "!SIBLING_CALL_P (insn) && !TARGET_64BIT"
104
 
 {
105
 
   if (constant_call_address_operand (operands[1], Pmode))
106
 
-    {
107
 
-      if (SIBLING_CALL_P (insn))
108
 
-       return "jmp\t%P1";
109
 
-      else
110
 
-       return "call\t%P1";
111
 
-    }
112
 
-  if (SIBLING_CALL_P (insn))
113
 
-    return "jmp\t%A1";
114
 
-  else
115
 
-    return "call\t%A1";
116
 
+    return "call\t%P1";
117
 
+  return "call\t%A1";
118
 
 }
119
 
   [(set_attr "type" "callv")])
120
 
 
121
 
+(define_insn "*sibcall_value_pop_1"
122
 
+  [(set (match_operand 0 "" "")
123
 
+       (call (mem:QI (match_operand:SI 1 "sibcall_insn_operand" "s,U"))
124
 
+             (match_operand:SI 2 "" "")))
125
 
+   (set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG)
126
 
+                           (match_operand:SI 3 "immediate_operand" "i,i")))]
127
 
+  "SIBLING_CALL_P (insn) && !TARGET_64BIT"
128
 
+  "@
129
 
+   jmp\t%P1
130
 
+   jmp\t%A1"
131
 
+  [(set_attr "type" "callv")])
132
 
+
133
 
 (define_insn "*call_value_0"
134
 
   [(set (match_operand 0 "" "")
135
 
        (call (mem:QI (match_operand:SI 1 "constant_call_address_operand" ""))