1 |
vapier 09/04/05 19:15:59 |
2 |
|
3 |
Added: 69_all_gcc43-pr39013.patch |
4 |
Log: |
5 |
add pie fixup patch to 4.3.2 too #254355 |
6 |
|
7 |
Revision Changes Path |
8 |
1.1 src/patchsets/gcc/4.3.2/gentoo/69_all_gcc43-pr39013.patch |
9 |
|
10 |
file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gcc/4.3.2/gentoo/69_all_gcc43-pr39013.patch?rev=1.1&view=markup |
11 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gcc/4.3.2/gentoo/69_all_gcc43-pr39013.patch?rev=1.1&content-type=text/plain |
12 |
|
13 |
Index: 69_all_gcc43-pr39013.patch |
14 |
=================================================================== |
15 |
http://bugs.gentoo.org/254355 |
16 |
|
17 |
2009-01-30 Jakub Jelinek <jakub@××××××.com> |
18 |
|
19 |
PR target/39013 |
20 |
* c-decl.c (pop_scope): Set DECL_EXTERNAL for functions declared |
21 |
inline but never defined. |
22 |
|
23 |
* gcc.target/i386/pr39013-1.c: New test. |
24 |
* gcc.target/i386/pr39013-2.c: New test. |
25 |
|
26 |
--- gcc/c-decl.c.jj 2009-01-26 15:24:44.000000000 +0100 |
27 |
+++ gcc/c-decl.c 2009-01-30 15:59:22.000000000 +0100 |
28 |
@@ -781,14 +781,18 @@ pop_scope (void) |
29 |
error ("nested function %q+D declared but never defined", p); |
30 |
undef_nested_function = true; |
31 |
} |
32 |
- /* C99 6.7.4p6: "a function with external linkage... declared |
33 |
- with an inline function specifier ... shall also be defined in the |
34 |
- same translation unit." */ |
35 |
else if (DECL_DECLARED_INLINE_P (p) |
36 |
&& TREE_PUBLIC (p) |
37 |
- && !DECL_INITIAL (p) |
38 |
- && !flag_gnu89_inline) |
39 |
- pedwarn ("inline function %q+D declared but never defined", p); |
40 |
+ && !DECL_INITIAL (p)) |
41 |
+ { |
42 |
+ /* C99 6.7.4p6: "a function with external linkage... declared |
43 |
+ with an inline function specifier ... shall also be defined |
44 |
+ in the same translation unit." */ |
45 |
+ if (!flag_gnu89_inline) |
46 |
+ pedwarn ("inline function %q+D declared but never defined", p); |
47 |
+ if (!DECL_EXTERNAL (p)) |
48 |
+ DECL_EXTERNAL (p) = 1; |
49 |
+ } |
50 |
|
51 |
goto common_symbol; |
52 |
|
53 |
--- gcc/testsuite/gcc.target/i386/pr39013-1.c.jj 2009-01-30 16:15:06.000000000 +0100 |
54 |
+++ gcc/testsuite/gcc.target/i386/pr39013-1.c 2009-01-30 16:17:05.000000000 +0100 |
55 |
@@ -0,0 +1,15 @@ |
56 |
+/* PR target/39013 */ |
57 |
+/* { dg-do compile { target *-*-linux* } } */ |
58 |
+/* { dg-options "-O2 -fpie -std=gnu89" } */ |
59 |
+ |
60 |
+inline int foo (void); |
61 |
+extern inline int bar (void); |
62 |
+ |
63 |
+int |
64 |
+main (void) |
65 |
+{ |
66 |
+ return foo () + bar (); |
67 |
+} |
68 |
+ |
69 |
+/* { dg-final { scan-assembler "foo@PLT" } } */ |
70 |
+/* { dg-final { scan-assembler "bar@PLT" } } */ |
71 |
--- gcc/testsuite/gcc.target/i386/pr39013-2.c.jj 2009-01-30 16:15:06.000000000 +0100 |
72 |
+++ gcc/testsuite/gcc.target/i386/pr39013-2.c 2009-01-30 16:17:15.000000000 +0100 |
73 |
@@ -0,0 +1,15 @@ |
74 |
+/* PR target/39013 */ |
75 |
+/* { dg-do compile { target *-*-linux* } } */ |
76 |
+/* { dg-options "-O2 -fpie -std=gnu99" } */ |
77 |
+ |
78 |
+inline int foo (void); /* { dg-warning "declared but never defined" } */ |
79 |
+extern inline int bar (void); /* { dg-warning "declared but never defined" } */ |
80 |
+ |
81 |
+int |
82 |
+main (void) |
83 |
+{ |
84 |
+ return foo () + bar (); |
85 |
+} |
86 |
+ |
87 |
+/* { dg-final { scan-assembler "foo@PLT" } } */ |
88 |
+/* { dg-final { scan-assembler "bar@PLT" } } */ |