Mercurial > hg > aboriginal
comparison sources/patches/gcc-core-weakbugs.patch @ 1823:1d233a893085 draft
Switch sh4 to musl.
author | Rob Landley <rob@landley.net> |
---|---|
date | Tue, 01 Dec 2015 20:50:53 -0600 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
1822:4927c8b8de1b | 1823:1d233a893085 |
---|---|
1 Another musl patch, it's unhappy with how weak signals are handled. | |
2 No actual explanation about what or test case, but since it's a clear bugfix... | |
3 | |
4 diff --git a/gcc/cgraph.c b/gcc/cgraph.c | |
5 index fcdc02e..db04afd 100644 | |
6 --- a/gcc/cgraph.c | |
7 +++ b/gcc/cgraph.c | |
8 @@ -1169,7 +1169,7 @@ cgraph_function_body_availability (struct cgraph_node *node) | |
9 inline and offline) having same side effect characteristics as | |
10 good optimization is what this optimization is about. */ | |
11 | |
12 - else if (!(*targetm.binds_local_p) (node->decl) | |
13 + else if ((DECL_WEAK (node->decl) || !(*targetm.binds_local_p) (node->decl)) | |
14 && !DECL_COMDAT (node->decl) && !DECL_EXTERNAL (node->decl)) | |
15 avail = AVAIL_OVERWRITABLE; | |
16 else avail = AVAIL_AVAILABLE; | |
17 @@ -1190,7 +1190,8 @@ cgraph_variable_initializer_availability (struct cgraph_varpool_node *node) | |
18 /* If the variable can be overwritten, return OVERWRITABLE. Takes | |
19 care of at least two notable extensions - the COMDAT variables | |
20 used to share template instantiations in C++. */ | |
21 - if (!(*targetm.binds_local_p) (node->decl) && !DECL_COMDAT (node->decl)) | |
22 + if ((DECL_WEAK (node->decl) || !(*targetm.binds_local_p) (node->decl)) | |
23 + && !DECL_COMDAT (node->decl)) | |
24 return AVAIL_OVERWRITABLE; | |
25 return AVAIL_AVAILABLE; | |
26 } | |
27 diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c | |
28 index 84ef830..73d9fcc 100644 | |
29 --- a/gcc/ipa-inline.c | |
30 +++ b/gcc/ipa-inline.c | |
31 @@ -300,7 +300,7 @@ cgraph_default_inline_p (struct cgraph_node *n, const char **reason) | |
32 | |
33 if (n->inline_decl) | |
34 decl = n->inline_decl; | |
35 - if (!DECL_INLINE (decl)) | |
36 + if (!DECL_INLINE (decl) || DECL_WEAK (decl)) | |
37 { | |
38 if (reason) | |
39 *reason = N_("function not inlinable"); | |
40 diff --git a/gcc/ipa-pure-const.c b/gcc/ipa-pure-const.c | |
41 index fdaff50..1bfd577 100644 | |
42 --- a/gcc/ipa-pure-const.c | |
43 +++ b/gcc/ipa-pure-const.c | |
44 @@ -512,7 +512,7 @@ analyze_function (struct cgraph_node *fn) | |
45 /* If this function does not return normally or does not bind local, | |
46 do not touch this unless it has been marked as const or pure by the | |
47 front end. */ | |
48 - if (TREE_THIS_VOLATILE (decl) | |
49 + if (TREE_THIS_VOLATILE (decl) || DECL_WEAK (decl) | |
50 || !targetm.binds_local_p (decl)) | |
51 { | |
52 l->pure_const_state = IPA_NEITHER; | |
53 diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c | |
54 index 1c0b79b..5a3ba7e 100644 | |
55 --- a/gcc/tree-inline.c | |
56 +++ b/gcc/tree-inline.c | |
57 @@ -1522,6 +1522,8 @@ inlinable_function_p (tree fn) | |
58 else if (!DECL_INLINE (fn) && !flag_unit_at_a_time) | |
59 inlinable = false; | |
60 | |
61 + else if (DECL_WEAK (fn)) | |
62 + inlinable = false; | |
63 else if (inline_forbidden_p (fn)) | |
64 { | |
65 /* See if we should warn about uninlinable functions. Previously, |