aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hongjiu.lu@intel.com>2015-02-18 17:24:20 +0000
committerH.J. Lu <hjl@gcc.gnu.org>2015-02-18 09:24:20 -0800
commitb0ddb385f0fa0ae6b4b9a360d3dd42060e6b0e63 (patch)
treee2d1353fd39cf4d43ed385621fd795bfd95a3d15
parent2d64d38c98955b4a1e68a1c0c8af28e40407ec69 (diff)
downloadgcc-b0ddb385f0fa0ae6b4b9a360d3dd42060e6b0e63.zip
gcc-b0ddb385f0fa0ae6b4b9a360d3dd42060e6b0e63.tar.gz
gcc-b0ddb385f0fa0ae6b4b9a360d3dd42060e6b0e63.tar.bz2
Return false for common symbols in sdata_symbolic_operand
Although common symbols are defined in executables, they aren't in small data section. But a definition in small data section overrides a common symbol, which still binds lcoally, and turns a reference to common symbol to reference to small data section. Even if ia64_in_small_data_p returns true on common symbols, sdata_symbolic_operand must return false on common symbols. Common symbols are assumed to be placed in small data section, but are accessed as if they are in normal data section so that they won't cause any relocation overflow. PR target/65064 * config/ia64/predicates.md (sdata_symbolic_operand): Return false for common symbols. From-SVN: r220792
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/ia64/predicates.md7
2 files changed, 12 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 86831bf..35bcf40 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2015-02-18 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR target/65064
+ * config/ia64/predicates.md (sdata_symbolic_operand): Return false
+ for common symbols.
+
2015-02-18 Jakub Jelinek <jakub@redhat.com>
* config/i386/t-intelmic (mkoffload.o): Remove dependency on
diff --git a/gcc/config/ia64/predicates.md b/gcc/config/ia64/predicates.md
index cba0efe..2aa7a78 100644
--- a/gcc/config/ia64/predicates.md
+++ b/gcc/config/ia64/predicates.md
@@ -69,7 +69,12 @@
of constants here. */
t = SYMBOL_REF_DECL (op);
if (DECL_P (t))
- t = DECL_SIZE_UNIT (t);
+ {
+ /* Common symbol isn't placed in small data section. */
+ if (DECL_COMMON (t))
+ return false;
+ t = DECL_SIZE_UNIT (t);
+ }
else
t = TYPE_SIZE_UNIT (TREE_TYPE (t));
if (t && tree_fits_shwi_p (t))