aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2002-10-14 12:07:58 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2002-10-14 12:07:58 +0200
commit0d1c5774b2ffdb0ad7a646184e38249a80d8da97 (patch)
tree8e651a2dc43f8ffc24354ddcdf8b41b8772c3539 /gcc
parentadadd183285d7f12a0c71853b10bb3a49a87d66a (diff)
downloadgcc-0d1c5774b2ffdb0ad7a646184e38249a80d8da97.zip
gcc-0d1c5774b2ffdb0ad7a646184e38249a80d8da97.tar.gz
gcc-0d1c5774b2ffdb0ad7a646184e38249a80d8da97.tar.bz2
i386.h (ASM_OUTPUT_REG_PUSH, [...]): Handle TARGET_64BIT.
* config/i386/i386.h (ASM_OUTPUT_REG_PUSH, ASM_OUTPUT_REG_POP): Handle TARGET_64BIT. * gcc.dg/20021014-1.c: New test. From-SVN: r58120
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/i386/i386.h16
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.dg/20021014-1.c21
4 files changed, 44 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c19a7b0..dee8908 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index a2f1cc2..13f900c 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -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. */
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index f04daad..76df36f 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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
index 0000000..9194aab
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/20021014-1.c
@@ -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);
+}