This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Add Darwin support to ix86_delegitimize_address
- From: gkeating at apple dot com (Geoffrey Keating)
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 7 Feb 2006 12:05:57 -0800 (PST)
- Subject: Add Darwin support to ix86_delegitimize_address
This patch was motivated by a DWARF failure on x86-darwin on the local
Apple compiler. Unfortunately the DWARF failure doesn't reproduce in
mainline due to reload changes; before it was treating an inline
procedure's parameter as the constant address of a global variable,
now it considers it to be in a register for a very short region of
code.
However, this patch does appear to fix:
gcc.c-torture/execute/stdarg-1.c execution, -O3 -fomit-frame-pointer
gcc.target/i386/387-3.c scan-assembler fldpi
gcc.target/i386/387-4.c scan-assembler fldpi
gcc.target/i386/pr23098.c scan-assembler-not .LC[0-9]
which is no bad thing.
Bootstrapped & tested on x86-darwin.
--
- Geoffrey Keating <geoffk@apple.com>
===File ~/patches/gcc-darwin-4430041.patch==================
Index: ChangeLog
2006-02-07 Geoffrey Keating <geoffk@apple.com>
* config/i386/i386.c (ix86_delegitimize_address): Support Darwin
PIC addresses.
Index: config/i386/i386.c
===================================================================
--- config/i386/i386.c (revision 110539)
+++ config/i386/i386.c (working copy)
@@ -7130,6 +7130,14 @@
return x;
}
+ if (TARGET_MACHO && darwin_local_data_pic (x)
+ && GET_CODE (orig_x) != MEM)
+ {
+ x = XEXP (x, 0);
+ if (y)
+ return gen_rtx_PLUS (Pmode, y, x);
+ return x;
+ }
return orig_x;
}
============================================================