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: explow.c Enable allocate_stack64 and correct if clauses for i386


Hello,

This patch enables the i386-x86_64 to use allocate_stack64 for stack 
probing. It is a replacement for an earlier patch that had problems in the 
#if clauses.

Regards,
 i.A. Kai Tietz

ChangeLog:

2007-03-15  Kai Tietz   <kai.tietz@onevision.com>

        * gcc/explow.c: Enable allocate_stack64 and correct if clauses.

Patch:

diff -ubNr -X ../../excl.txt gcc/explow.c ../../gcc/gcc/explow.c
--- gcc/explow.c        2007-03-13 17:16:26.086209000 +0100
+++ ../../gcc/gcc/explow.c      2007-02-28 14:34:11.717512200 +0100
@@ -1240,13 +1240,25 @@
         be valid for the operand.  For operand 1, convert to the
         proper mode and validate.  */
       if (mode == VOIDmode)
+        {
+#if defined(HAVE_allocate_stack64) && defined(TARGET_64BIT)
+             mode = insn_data[((!HAVE_allocate_stack64 || !TARGET_64BIT) 
? (int) CODE_FOR_allocate_stack : (int) 
CODE_FOR_allocate_stack64)].operand[1].mode;
+#else
        mode = insn_data[(int) CODE_FOR_allocate_stack].operand[1].mode;
+#endif
+        }
 
+#if defined(HAVE_allocate_stack64) && defined(TARGET_64BIT)
+      pred = insn_data[((!HAVE_allocate_stack64 || !TARGET_64BIT) ? (int) 
CODE_FOR_allocate_stack : (int) 
CODE_FOR_allocate_stack64)].operand[1].predicate;
+#else
       pred = insn_data[(int) 
CODE_FOR_allocate_stack].operand[1].predicate;
+#endif
       if (pred && ! ((*pred) (size, mode)))
        size = copy_to_mode_reg (mode, convert_to_mode (mode, size, 1));
 
-      emit_insn (gen_allocate_stack (target, size));
+      if(mode == DImode)
+       emit_insn (gen_allocate_stack64(target,size));
+      else emit_insn (gen_allocate_stack (target, size));
     }
   else
 #endif

Attachment: explow_c.diff.txt
Description: Text document


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