+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.
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. */
--- /dev/null
+/* { 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);
+}