* config/i386/i386.h (ASM_OUTPUT_REG_PUSH, ASM_OUTPUT_REG_POP):
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 14 Oct 2002 10:07:58 +0000 (10:07 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 14 Oct 2002 10:07:58 +0000 (10:07 +0000)
Handle TARGET_64BIT.

* gcc.dg/20021014-1.c: New test.

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

gcc/ChangeLog
gcc/config/i386/i386.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/20021014-1.c [new file with mode: 0644]

index c19a7b0..dee8908 100644 (file)
@@ -1,3 +1,8 @@
+2002-10-14  Jakub Jelinek  <jakub@redhat.com>
+
+       * config/i386/i386.h (ASM_OUTPUT_REG_PUSH, ASM_OUTPUT_REG_POP):
+       Handle TARGET_64BIT.
+
 2002-10-14  Richard Sandiford  <rsandifo@redhat.com>
 
        * config/mips/vr.h (DRIVER_SELF_SPECS): Define.
index a2f1cc2..13f900c 100644 (file)
@@ -3017,13 +3017,25 @@ extern int const svr4_dbx_register_map[FIRST_PSEUDO_REGISTER];
    It need not be very fast code.  */
 
 #define ASM_OUTPUT_REG_PUSH(FILE, REGNO)  \
-  asm_fprintf ((FILE), "\tpush{l}\t%%e%s\n", reg_names[(REGNO)])
+do {                                                                   \
+  if (TARGET_64BIT)                                                    \
+    asm_fprintf ((FILE), "\tpush{q}\t%%r%s\n",                         \
+                reg_names[(REGNO)] + (REX_INT_REGNO_P (REGNO) != 0));  \
+  else                                                                 \
+    asm_fprintf ((FILE), "\tpush{l}\t%%e%s\n", reg_names[(REGNO)]);    \
+} while (0)
 
 /* This is how to output an insn to pop a register from the stack.
    It need not be very fast code.  */
 
 #define ASM_OUTPUT_REG_POP(FILE, REGNO)  \
-  asm_fprintf ((FILE), "\tpop{l}\t%%e%s\n", reg_names[(REGNO)])
+do {                                                                   \
+  if (TARGET_64BIT)                                                    \
+    asm_fprintf ((FILE), "\tpop{q}\t%%r%s\n",                          \
+                reg_names[(REGNO)] + (REX_INT_REGNO_P (REGNO) != 0));  \
+  else                                                                 \
+    asm_fprintf ((FILE), "\tpop{l}\t%%e%s\n", reg_names[(REGNO)]);     \
+} while (0)
 
 /* This is how to output an element of a case-vector that is absolute.  */
 
index f04daad..76df36f 100644 (file)
@@ -1,3 +1,7 @@
+2002-10-14  Jakub Jelinek  <jakub@redhat.com>
+
+       * gcc.dg/20021014-1.c: New test.
+
 2002-10-11  Mark Mitchell  <mark@codesourcery.com>
 
        PR c++/5661
diff --git a/gcc/testsuite/gcc.dg/20021014-1.c b/gcc/testsuite/gcc.dg/20021014-1.c
new file mode 100644 (file)
index 0000000..9194aab
--- /dev/null
@@ -0,0 +1,21 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -p" } */
+
+extern void abort (void);
+extern void exit (int);
+
+int foo (void)
+{
+  static int bar (int x)
+  {
+    return x + 3;
+  }
+  return bar (1) + bar (2);
+}
+
+int main (void)
+{
+  if (foo () != 9)
+    abort ();
+  exit (0);
+}