This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: POWERPC64_TOC_POINTER_ALIGNMENT
- From: Alan Modra <amodra at gmail dot com>
- To: Michael Meissner <meissner at linux dot vnet dot ibm dot com>, gcc-patches at gcc dot gnu dot org, David Edelsohn <dje dot gcc at gmail dot com>
- Date: Wed, 18 Nov 2015 13:02:17 +1030
- Subject: Re: POWERPC64_TOC_POINTER_ALIGNMENT
- Authentication-results: sourceware.org; auth=none
- References: <20151117232241 dot GF8120 at bubble dot grove dot modra dot org> <20151118005317 dot GA7374 at ibm-tiger dot the-meissners dot org>
On Tue, Nov 17, 2015 at 07:53:18PM -0500, Michael Meissner wrote:
> Here is the temporary patch I'm using to get past rs6000.c. But I suspect the
> TOC alignment should never be 256.
Yes, it should be. Recent GNU ld aligns .TOC. to a 256 byte boundary.
I have this patch in my tree.
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index abc8eaa..e3ec042 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -8059,12 +8059,17 @@ rs6000_cannot_force_const_mem (machine_mode mode ATTRIBUTE_UNUSED, rtx x)
static bool
use_toc_relative_ref (rtx sym, machine_mode mode)
{
+ /* Silence complaint that the POWERPC64_TOC_POINTER_ALIGNMENT test
+ is always true. */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wtype-limits"
return ((constant_pool_expr_p (sym)
&& ASM_OUTPUT_SPECIAL_POOL_ENTRY_P (get_pool_constant (sym),
get_pool_mode (sym)))
|| (TARGET_CMODEL == CMODEL_MEDIUM
&& SYMBOL_REF_LOCAL_P (sym)
&& GET_MODE_SIZE (mode) <= POWERPC64_TOC_POINTER_ALIGNMENT));
+#pragma GCC diagnostic pop
}
/* Our implementation of LEGITIMIZE_RELOAD_ADDRESS. Returns a value to
--
Alan Modra
Australia Development Lab, IBM