[llvm-commits] [llvm-gcc-4.2] r64116 - in /llvm-gcc-4.2/trunk: configure.in driverdriver.c gcc/ChangeLog.apple gcc/c-common.c gcc/config/darwin.h gcc/config/darwin10.h gcc/config/i386/darwin.h gcc/ifcvt.c gcc/testsuite/ChangeLog.apple gcc/testsuite/g++.apple/weak-2.C gcc/testsuite/gcc.apple/6515001.c gcc/version.c
Bill Wendling
isanbard at gmail.com
Sun Feb 8 20:14:03 PST 2009
Author: void
Date: Sun Feb 8 22:14:03 2009
New Revision: 64116
URL: http://llvm.org/viewvc/llvm-project?rev=64116&view=rev
Log:
Another un-asked-for sync up with Apple GCC. This one is less major than the
others. It has some important fixes in it, though.
Added:
llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/weak-2.C
llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/6515001.c
Modified:
llvm-gcc-4.2/trunk/configure.in
llvm-gcc-4.2/trunk/driverdriver.c
llvm-gcc-4.2/trunk/gcc/ChangeLog.apple
llvm-gcc-4.2/trunk/gcc/c-common.c
llvm-gcc-4.2/trunk/gcc/config/darwin.h
llvm-gcc-4.2/trunk/gcc/config/darwin10.h
llvm-gcc-4.2/trunk/gcc/config/i386/darwin.h
llvm-gcc-4.2/trunk/gcc/ifcvt.c
llvm-gcc-4.2/trunk/gcc/testsuite/ChangeLog.apple
llvm-gcc-4.2/trunk/gcc/version.c
Modified: llvm-gcc-4.2/trunk/configure.in
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/configure.in?rev=64116&r1=64115&r2=64116&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/configure.in (original)
+++ llvm-gcc-4.2/trunk/configure.in Sun Feb 8 22:14:03 2009
@@ -989,8 +989,10 @@
i[[3456789]]86-*-darwin*)
host_makefile_frag="config/mh-x86-darwin"
# gcc can default to x86_64 code generation, avoid that
- CC="${CC-gcc} -m32"
- CXX="${CXX-g++} -m32"
+ if test "${build}" = "${host}"; then
+ CC="${CC-gcc} -m32"
+ CXX="${CXX-g++} -m32"
+ fi
;;
# APPLE LOCAL end dynamic-no-pic
powerpc-*-aix*)
Modified: llvm-gcc-4.2/trunk/driverdriver.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/driverdriver.c?rev=64116&r1=64115&r2=64116&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/driverdriver.c (original)
+++ llvm-gcc-4.2/trunk/driverdriver.c Sun Feb 8 22:14:03 2009
@@ -1,4 +1,5 @@
/* APPLE LOCAL file driver driver */
+
/* Darwin driver program that handles -arch commands and invokes
appropriate compiler driver.
Copyright (C) 2004, 2005 Free Software Foundation, Inc.
@@ -76,6 +77,8 @@
int dash_dynamiclib_seen = 0;
int verbose_flag = 0;
int save_temps_seen = 0;
+int dash_m32_seen = 0;
+int dash_m64_seen = 0;
/* Support at the max 10 arch. at a time. This is historical limit. */
#define MAX_ARCHES 10
@@ -190,27 +193,35 @@
static const char *
get_arch_name (const char *name)
{
- const NXArchInfo * a_info;
+ NXArchInfo * a_info;
const NXArchInfo * all_info;
cpu_type_t cputype;
struct arch_config_guess_map *map;
const char *aname;
- if (name)
- {
- /* Find config name based on arch name. */
- aname = NULL;
- map = arch_config_map;
- while (map->arch_name)
- {
- if (!strcmp (map->arch_name, name))
- return name;
- else map++;
- }
- a_info = NXGetArchInfoFromName (name);
+ if (name) {
+ /* Find config name based on arch name. */
+ aname = NULL;
+ map = arch_config_map;
+ while (map->arch_name) {
+ if (!strcmp (map->arch_name, name))
+ return name;
+ else map++;
}
- else
- a_info = NXGetLocalArchInfo ();
+ a_info = (NXArchInfo *) NXGetArchInfoFromName (name);
+ } else {
+ a_info = (NXArchInfo *) NXGetLocalArchInfo();
+ if (a_info) {
+ if (dash_m32_seen) {
+ /* If -m32 is seen then do not change cpu type. */
+ } else if (dash_m64_seen) {
+ /* If -m64 is seen then enable CPU_ARCH_ABI64. */
+ a_info->cputype |= CPU_ARCH_ABI64;
+ } else if (sizeof (long) == 8)
+ /* On x86, by default (name is NULL here) enable 64 bit code. */
+ a_info->cputype |= CPU_ARCH_ABI64;
+ }
+ }
if (!a_info)
fatal ("Invalid arch name : %s", name);
@@ -639,7 +650,6 @@
for (i = 1; i < new_argc; i++)
{
-
if (ifn && ifn->name && !strcmp (new_argv[i], ifn->name))
{
/* This argument is one of the input file. */
@@ -1371,6 +1381,16 @@
new_argv[new_argc++] = argv[i];
dash_capital_m_seen = 1;
}
+ else if (!strcmp (argv[i], "-m32"))
+ {
+ new_argv[new_argc++] = argv[i];
+ dash_m32_seen = 1;
+ }
+ else if (!strcmp (argv[i], "-m64"))
+ {
+ new_argv[new_argc++] = argv[i];
+ dash_m64_seen = 1;
+ }
else if (!strcmp (argv[i], "-dynamiclib"))
{
new_argv[new_argc++] = argv[i];
@@ -1505,6 +1525,9 @@
fatal ("no input files");
#endif
+ if (num_arches == 0)
+ add_arch(get_arch_name(NULL));
+
if (num_arches > 1)
{
if (preprocessed_output_request
@@ -1517,22 +1540,15 @@
Invoke appropriate compiler driver. FAT build is not required in this
case. */
- if (num_arches == 0 || num_arches == 1)
+ if (num_arches == 1)
{
int arch_specific_argc;
const char **arch_specific_argv;
- /* If no -arch is specified than use host compiler driver. */
- if (num_arches == 0)
- new_argv[0] = get_driver_name (get_arch_name (NULL));
- else if (num_arches == 1)
- {
- /* Find compiler driver based on -arch <foo> and add approriate
- -m* argument. */
- new_argv[0] = get_driver_name (get_arch_name (arches[0]));
- new_argc = new_argc + add_arch_options (0, new_argv, new_argc);
- }
-
+ /* Find compiler driver based on -arch <foo> and add approriate
+ -m* argument. */
+ new_argv[0] = get_driver_name (get_arch_name (arches[0]));
+ new_argc = new_argc + add_arch_options (0, new_argv, new_argc);
#ifdef DEBUG
printf ("%s: invoking single driver name = %s\n", progname, new_argv[0]);
Modified: llvm-gcc-4.2/trunk/gcc/ChangeLog.apple
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/ChangeLog.apple?rev=64116&r1=64115&r2=64116&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/ChangeLog.apple (original)
+++ llvm-gcc-4.2/trunk/gcc/ChangeLog.apple Sun Feb 8 22:14:03 2009
@@ -1,3 +1,9 @@
+2009-01-22 Stuart Hastings <stuart at apple.com>
+
+ Radar 6515001
+ * ifcvt.c(noce_try_cmove_arith): Use a more conservative trap
+ check.
+
2009-01-12 Caroline Tice <ctice at apple.com>
Radar 6476836
Modified: llvm-gcc-4.2/trunk/gcc/c-common.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-common.c?rev=64116&r1=64115&r2=64116&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/c-common.c (original)
+++ llvm-gcc-4.2/trunk/gcc/c-common.c Sun Feb 8 22:14:03 2009
@@ -5169,6 +5169,16 @@
|| TREE_CODE (*node) == VAR_DECL)
declare_weak (*node);
/* APPLE LOCAL begin weak types 5954418 */
+ else if (!DECL_P (*node)
+ /* If the weak flag can be associated with something else,
+ prefer that. */
+ && (flags & (ATTR_FLAG_FUNCTION_NEXT
+ |ATTR_FLAG_DECL_NEXT
+ |ATTR_FLAG_ARRAY_NEXT)))
+ {
+ *no_add_attrs = true;
+ return tree_cons (name, args, NULL_TREE);
+ }
else if (! targetm.cxx.class_data_always_comdat ()
&& TREE_CODE (*node) == RECORD_TYPE)
{
Modified: llvm-gcc-4.2/trunk/gcc/config/darwin.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/darwin.h?rev=64116&r1=64115&r2=64116&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/darwin.h (original)
+++ llvm-gcc-4.2/trunk/gcc/config/darwin.h Sun Feb 8 22:14:03 2009
@@ -516,10 +516,12 @@
miphoneos-version-min=*: %(darwin_iphoneos_libgcc); \
shared-libgcc|fexceptions|fgnu-runtime: \
%:version-compare(!> 10.5 mmacosx-version-min= -lgcc_s.10.4) \
- %:version-compare(>= 10.5 mmacosx-version-min= -lgcc_s.10.5) \
+ "/* APPLE LOCAL link optimizations 6499452 */" \
+ %:version-compare(>< 10.5 10.6 mmacosx-version-min= -lgcc_s.10.5) \
-lgcc; \
:%:version-compare(>< 10.3.9 10.5 mmacosx-version-min= -lgcc_s.10.4) \
- %:version-compare(>= 10.5 mmacosx-version-min= -lgcc_s.10.5) \
+ "/* APPLE LOCAL link optimizations 6499452 */" \
+ %:version-compare(>< 10.5 10.6 mmacosx-version-min= -lgcc_s.10.5) \
-lgcc}"
/* We specify crt0.o as -lcrt0.o so that ld will search the library path.
@@ -533,7 +535,8 @@
#undef STARTFILE_SPEC
#define STARTFILE_SPEC \
"%{Zdynamiclib: %(darwin_dylib1) } \
- %{!Zdynamiclib:%{Zbundle:%{!static:-lbundle1.o}} \
+ "/* APPLE LOCAL link optimizations 6499452 */" \
+ %{!Zdynamiclib:%{Zbundle:%{!static: %(darwin_bundle1)}} \
%{!Zbundle:%{pg:%{static:-lgcrt0.o} \
%{!static:%{object:-lgcrt0.o} \
%{!object:%{preload:-lgcrt0.o} \
@@ -557,6 +560,8 @@
#define DARWIN_EXTRA_SPECS \
{ "darwin_crt1", DARWIN_CRT1_SPEC }, \
{ "darwin_dylib1", DARWIN_DYLIB1_SPEC }, \
+ /* APPLE LOCAL link optimizations 6499452 */ \
+ { "darwin_bundle1", DARWIN_BUNDLE1_SPEC }, \
{ "darwin_minversion", DARWIN_MINVERSION_SPEC }, \
/* APPLE LOCAL end mainline */ \
/* APPLE LOCAL begin ARM 5683689 */ \
@@ -573,6 +578,11 @@
%:version-compare(!> 10.5 mmacosx-version-min= -ldylib1.o) \
%:version-compare(>= 10.5 mmacosx-version-min= -ldylib1.10.5.o)}"
+/* APPLE LOCAL begin link optimizations 6499452 */
+#define DARWIN_BUNDLE1_SPEC \
+ "-lbundle1.o"
+/* APPLE LOCAL end link optimizations 6499452 */
+
#define DARWIN_CRT1_SPEC \
/* APPLE LOCAL ARM 5823776 iphoneos should use crt1.o */ \
"%{miphoneos-version-min=*: -lcrt1.o} \
Modified: llvm-gcc-4.2/trunk/gcc/config/darwin10.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/darwin10.h?rev=64116&r1=64115&r2=64116&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/darwin10.h (original)
+++ llvm-gcc-4.2/trunk/gcc/config/darwin10.h Sun Feb 8 22:14:03 2009
@@ -1,2 +1,2 @@
/* APPLE LOCAL .file/.loc 6349436 */
-/* #define DWARF2_ASM_LINE_DEBUG_INFO 1 */
+#define DWARF2_ASM_LINE_DEBUG_INFO 1
Modified: llvm-gcc-4.2/trunk/gcc/config/i386/darwin.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/darwin.h?rev=64116&r1=64115&r2=64116&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/i386/darwin.h (original)
+++ llvm-gcc-4.2/trunk/gcc/config/i386/darwin.h Sun Feb 8 22:14:03 2009
@@ -141,6 +141,23 @@
/* APPLE LOCAL ARM 5681645 */
#define DARWIN_IPHONEOS_LIBGCC_SPEC "-lgcc_s.10.5 -lgcc"
+/* APPLE LOCAL begin link optimizations 6499452 */
+#undef DARWIN_CRT1_SPEC
+#define DARWIN_CRT1_SPEC \
+ "%:version-compare(!> 10.5 mmacosx-version-min= -lcrt1.o) \
+ %:version-compare(>< 10.5 10.6 mmacosx-version-min= -lcrt1.10.5.o) \
+ %:version-compare(>= 10.6 mmacosx-version-min= -lcrt1.10.6.o)"
+
+#undef DARWIN_DYLIB1_SPEC
+#define DARWIN_DYLIB1_SPEC \
+ "%:version-compare(!> 10.5 mmacosx-version-min= -ldylib1.o) \
+ %:version-compare(>< 10.5 10.6 mmacosx-version-min= -ldylib1.10.5.o)"
+
+#undef DARWIN_BUNDLE1_SPEC
+#define DARWIN_BUNDLE1_SPEC \
+ "%:version-compare(!> 10.6 mmacosx-version-min= -lbundle1.o)"
+/* APPLE LOCAL end link optimizations 6499452 */
+
#undef SUBTARGET_EXTRA_SPECS
#define SUBTARGET_EXTRA_SPECS \
DARWIN_EXTRA_SPECS \
Modified: llvm-gcc-4.2/trunk/gcc/ifcvt.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/ifcvt.c?rev=64116&r1=64115&r2=64116&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/ifcvt.c (original)
+++ llvm-gcc-4.2/trunk/gcc/ifcvt.c Sun Feb 8 22:14:03 2009
@@ -1409,7 +1409,8 @@
/* ??? We could handle this if we knew that a load from A or B could
not fault. This is also true if we've already loaded
from the address along the path from ENTRY. */
- else if (may_trap_p (a) || may_trap_p (b))
+ /* APPLE LOCAL 6515001 */
+ else if (may_trap_after_code_motion_p (a) || may_trap_after_code_motion_p (b))
return FALSE;
/* if (test) x = a + b; else x = c - d;
Modified: llvm-gcc-4.2/trunk/gcc/testsuite/ChangeLog.apple
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/ChangeLog.apple?rev=64116&r1=64115&r2=64116&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/testsuite/ChangeLog.apple (original)
+++ llvm-gcc-4.2/trunk/gcc/testsuite/ChangeLog.apple Sun Feb 8 22:14:03 2009
@@ -1,3 +1,8 @@
+2009-01-22 Stuart Hastings <stuart at apple.com>
+
+ Radar 6515001
+ * gcc.apple/6515001.c: New.
+
2009-01-12 Caroline Tice <ctice at apple.com>
Radar 6476836
Added: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/weak-2.C
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/weak-2.C?rev=64116&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/weak-2.C (added)
+++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/weak-2.C Sun Feb 8 22:14:03 2009
@@ -0,0 +1,7 @@
+/* APPLE LOCAL file weak types 6524730 */
+/* { dg-do compile } */
+/* Radar 6524730 */
+
+int * __attribute__((weak)) foo(int * x) {
+ return x;
+}
Added: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/6515001.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/6515001.c?rev=64116&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/6515001.c (added)
+++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/6515001.c Sun Feb 8 22:14:03 2009
@@ -0,0 +1,20 @@
+/* APPLE LOCAL file 6515001 */
+/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
+/* { scan-assembler-not "cmove" } */
+typedef struct __NSSymbol* NSSymbol;
+
+static struct {
+ unsigned pad[2];
+ unsigned n_value;
+ NSSymbol realSymbol;
+} sLastLookup;
+
+void foo(void *);
+void* NSAddressOfSymbol(NSSymbol symbol)
+{
+ if ( (void*)symbol == (void*)(&sLastLookup) )
+ symbol = sLastLookup.realSymbol;
+
+ foo(symbol);
+ return symbol;
+}
Modified: llvm-gcc-4.2/trunk/gcc/version.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/version.c?rev=64116&r1=64115&r2=64116&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/version.c (original)
+++ llvm-gcc-4.2/trunk/gcc/version.c Sun Feb 8 22:14:03 2009
@@ -11,12 +11,12 @@
/* APPLE LOCAL begin Apple version */
#ifdef ENABLE_LLVM
#ifdef LLVM_VERSION_INFO
-#define VERSUFFIX " (Based on Apple Inc. build 5636) (LLVM build " LLVM_VERSION_INFO ")"
+#define VERSUFFIX " (Based on Apple Inc. build 5639) (LLVM build " LLVM_VERSION_INFO ")"
#else
-#define VERSUFFIX " (Based on Apple Inc. build 5636) (LLVM build)"
+#define VERSUFFIX " (Based on Apple Inc. build 5639) (LLVM build)"
#endif
#else
-#define VERSUFFIX " (Based on Apple Inc. build 5636)"
+#define VERSUFFIX " (Based on Apple Inc. build 5639)"
#endif
/* APPLE LOCAL end Apple version */
More information about the llvm-commits
mailing list