This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: PR middle-end/36450: ICE in insert_restore/insert_save with GET_MODE_ALIGNMENT


After revision 138335, we won't see ICE since x86 can align stack
properly. If we really want, we can check MAX_SUPPORTED_STACK_ALIGNMENT.


H.J.
---
2008-07-30  Vladimir Makarov  <vmakarov@redhat.com>
	    H.J. Lu  <hongjiu.lu@intel.com>

	PR middle-end/36450
	* caller-save.c (insert_restore): Don't require alignment more
	than MAX_SUPPORTED_STACK_ALIGNMENT in asserts.
	(insert_save): Likewise.

--- gcc/caller-save.c.min	2008-07-30 12:29:42.000000000 -0700
+++ gcc/caller-save.c	2008-07-30 14:52:08.000000000 -0700
@@ -713,7 +713,8 @@ insert_restore (struct insn_chain *chain
 
   /* Verify that the alignment of spill space is equal to or greater
      than required.  */
-  gcc_assert (GET_MODE_ALIGNMENT (GET_MODE (mem)) <= MEM_ALIGN (mem));
+  gcc_assert (MIN (MAX_SUPPORTED_STACK_ALIGNMENT,
+		   GET_MODE_ALIGNMENT (GET_MODE (mem))) <= MEM_ALIGN (mem));
 
   pat = gen_rtx_SET (VOIDmode,
 		     gen_rtx_REG (GET_MODE (mem),
@@ -790,7 +791,8 @@ insert_save (struct insn_chain *chain, i
 
   /* Verify that the alignment of spill space is equal to or greater
      than required.  */
-  gcc_assert (GET_MODE_ALIGNMENT (GET_MODE (mem)) <= MEM_ALIGN (mem));
+  gcc_assert (MIN (MAX_SUPPORTED_STACK_ALIGNMENT,
+		   GET_MODE_ALIGNMENT (GET_MODE (mem))) <= MEM_ALIGN (mem));
 
   pat = gen_rtx_SET (VOIDmode, mem,
 		     gen_rtx_REG (GET_MODE (mem),


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]