OSDN Git Service

* explow.c (allocate_dynamic_stack_space): Check
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 6 Nov 2010 03:44:58 +0000 (03:44 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 6 Nov 2010 03:44:58 +0000 (03:44 +0000)
MALLOC_ABI_ALIGNMENT.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@166393 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/explow.c

index 1e55c84..75d23de 100644 (file)
@@ -1,3 +1,8 @@
+2010-11-05  Ian Lance Taylor  <iant@google.com>
+
+       * explow.c (allocate_dynamic_stack_space): Check
+       MALLOC_ABI_ALIGNMENT.
+
 2010-11-05  Jakub Jelinek  <jakub@redhat.com>
 
        PR c/44772
index 1d809bc..85e9344 100644 (file)
@@ -1356,13 +1356,18 @@ allocate_dynamic_stack_space (rtx size, unsigned size_align,
 #endif
 
       /* The __morestack_allocate_stack_space function will allocate
-        memory using malloc.  We don't know that the alignment of the
-        memory returned by malloc will meet REQUIRED_ALIGN.  Increase
-        SIZE to make sure we allocate enough space.  */
-      ask = expand_binop (Pmode, add_optab, size,
-                         GEN_INT (required_align / BITS_PER_UNIT - 1),
-                         NULL_RTX, 1, OPTAB_LIB_WIDEN);
-      must_align = true;
+        memory using malloc.  If the alignment of the memory returned
+        by malloc does not meet REQUIRED_ALIGN, we increase SIZE to
+        make sure we allocate enough space.  */
+      if (MALLOC_ABI_ALIGNMENT >= required_align)
+       ask = size;
+      else
+       {
+         ask = expand_binop (Pmode, add_optab, size,
+                             GEN_INT (required_align / BITS_PER_UNIT - 1),
+                             NULL_RTX, 1, OPTAB_LIB_WIDEN);
+         must_align = true;
+       }
 
       func = init_one_libfunc ("__morestack_allocate_stack_space");