This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] PR target/65064: Return false for COMMON symbols
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Richard Henderson <rth at redhat dot com>
- Date: Sun, 15 Feb 2015 06:19:21 -0800
- Subject: [PATCH] PR target/65064: Return false for COMMON symbols
- Authentication-results: sourceware.org; auth=none
Hi,
r220674 exposed a bug in ia64_in_small_data_p. After r220674, COMMON
symbols binds locally for executables. But ia64_in_small_data_p returns
true for COMMON symbols which are never in small data section. This patch
fixes it. OK for trunk?
H.J.
----
Since COMMON symbols are never in small data section, ia64_in_small_data_p
should return false for COMMON symbols.
PR target/65064
* config/ia64/ia64.c (ia64_in_small_data_p): Return false for
COMMON symbols.
---
gcc/config/ia64/ia64.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index 6ef22d9..3687289 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -9941,6 +9941,10 @@ ia64_in_small_data_p (const_tree exp)
if (TARGET_NO_SDATA)
return false;
+ /* COMMON symbols are never small data. */
+ if (DECL_COMMON (exp))
+ return false;
+
/* We want to merge strings, so we never consider them small data. */
if (TREE_CODE (exp) == STRING_CST)
return false;
--
2.1.0