aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeoffrey Keating <geoffk@apple.com>2006-03-23 22:17:37 +0000
committerGeoffrey Keating <geoffk@apple.com>2006-03-23 22:17:37 +0000
commit6c4f058e99b79279ff0b3db675b0605de93035cd (patch)
tree8a70b4e5718c092dc8dce30c23c75ee3cd9f2a61
parent178975cbf6ddc84f806f32a401b8376fa314f373 (diff)
Back out fix for 4255172.apple/gcc-5332
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/apple-local-200502-branch@112333 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog.apple-ppc12
-rw-r--r--gcc/config/darwin.h13
-rw-r--r--gcc/config/rs6000/darwin.h8
-rw-r--r--gcc/config/rs6000/rs6000-c.c22
-rw-r--r--gcc/config/rs6000/rs6000.c2
-rw-r--r--gcc/testsuite/ChangeLog.apple-ppc18
-rw-r--r--gcc/testsuite/g++.dg/align-test-1.C2
-rw-r--r--gcc/testsuite/g++.dg/apple-altivec-2.C4
-rw-r--r--gcc/testsuite/g++.dg/apple-altivec-6.C2
-rw-r--r--gcc/testsuite/g++.dg/apple-altivec-test.C4
-rw-r--r--gcc/testsuite/g++.dg/ext/altivec-apple-11.C2
-rw-r--r--gcc/testsuite/gcc.apple/align-test-1.c4
-rw-r--r--gcc/testsuite/gcc.apple/altivec-19.c2
-rw-r--r--gcc/testsuite/gcc.apple/altivec-20.c2
-rw-r--r--gcc/testsuite/gcc.apple/altivec-maltivec-1.c3
-rw-r--r--gcc/testsuite/gcc.apple/altivec-maltivec-2.c13
-rw-r--r--gcc/testsuite/gcc.apple/altivec-maltivec-3.c14
-rw-r--r--gcc/testsuite/gcc.apple/apple-altivec-5.c4
-rw-r--r--gcc/testsuite/gcc.apple/apple-altivec-6.c4
-rw-r--r--gcc/testsuite/gcc.apple/apple-altivec-7.c4
-rw-r--r--gcc/testsuite/gcc.apple/apple-altivec-8.c4
21 files changed, 51 insertions, 92 deletions
diff --git a/gcc/ChangeLog.apple-ppc b/gcc/ChangeLog.apple-ppc
index 32e6293b2a5..9e595453c3e 100644
--- a/gcc/ChangeLog.apple-ppc
+++ b/gcc/ChangeLog.apple-ppc
@@ -11,18 +11,6 @@
* config/darwin.h (STARTFILE_SPEC): Don't use -l for crt3.o.
* config/darwin-crt3.c: Rewrite entire file.
-2006-03-22 Geoffrey Keating <geoffk@apple.com>
-
- Radar 4255172
- * config/rs6000/darwin.h (PEG_ALIGN_FOR_MAC68K): Move to here from
- config/darwin.h. Don't test TARGET_ALTIVEC.
- * config/darwin.h [RS6000_VECTOR_ALIGNMENT] (PEG_ALIGN_FOR_MAC68K):
- Move this definition to config/rs6000/darwin.h.
- * config/rs6000/rs6000-c.c (rs6000_cpu_cpp_builtins): Don't define
- Altivec PIM macros unless -faltivec.
- * config/rs6000/rs6000.c (rs6000_override_options): Don't allow
- special Altivec vector initialisation unless -faltivec.
-
2006-03-15 Geoffrey Keating <geoffk@apple.com>
Radar 3992198
diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h
index 101f02cdada..bed6e1194e1 100644
--- a/gcc/config/darwin.h
+++ b/gcc/config/darwin.h
@@ -1362,8 +1362,19 @@ enum machopic_addr_class {
extern void abort_assembly_and_exit (int status) ATTRIBUTE_NORETURN;
/* APPLE LOCAL end insert assembly ".abort" directive on fatal error */
-/* APPLE LOCAL Macintosh alignment 2002-2-13 --ff */
+/* APPLE LOCAL begin Macintosh alignment 2002-2-13 --ff */
+#ifdef RS6000_VECTOR_ALIGNMENT
+/* When adjusting (lowering) the alignment of fields when in the
+ mac68k alignment mode, the 128-bit alignment of vectors *MUST*
+ be preserved. */
+#define PEG_ALIGN_FOR_MAC68K(DESIRED) \
+ ((TARGET_ALTIVEC && (DESIRED) == RS6000_VECTOR_ALIGNMENT) \
+ ? RS6000_VECTOR_ALIGNMENT \
+ : MIN ((DESIRED), 16))
+#else
#define PEG_ALIGN_FOR_MAC68K(DESIRED) MIN ((DESIRED), 16)
+#endif
+/* APPLE LOCAL end Macintosh alignment 2002-2-13 --ff */
/* APPLE LOCAL begin KEXT double destructor */
/* Need a mechanism to tell whether a C++ operator delete is empty so
diff --git a/gcc/config/rs6000/darwin.h b/gcc/config/rs6000/darwin.h
index a9e2e8111f8..7ca99c45e7a 100644
--- a/gcc/config/rs6000/darwin.h
+++ b/gcc/config/rs6000/darwin.h
@@ -468,14 +468,6 @@ do { \
: ((FIRST_FIELD_P) ? (COMPUTED) \
: 32))))))
-/* When adjusting (lowering) the alignment of fields when in the
- mac68k alignment mode, the 128-bit alignment of vectors *MUST*
- be preserved. */
-#undef PEG_ALIGN_FOR_MAC68K
-#define PEG_ALIGN_FOR_MAC68K(DESIRED) \
- ((DESIRED) == RS6000_VECTOR_ALIGNMENT ? RS6000_VECTOR_ALIGNMENT \
- : MIN ((DESIRED), 16))
-
#undef ROUND_TYPE_ALIGN
/* Macintosh alignment modes require more complicated handling
of alignment, so we replace the macro with a call to a
diff --git a/gcc/config/rs6000/rs6000-c.c b/gcc/config/rs6000/rs6000-c.c
index aaa93c7168f..dc6f5bf8e64 100644
--- a/gcc/config/rs6000/rs6000-c.c
+++ b/gcc/config/rs6000/rs6000-c.c
@@ -245,22 +245,22 @@ rs6000_cpu_cpp_builtins (cpp_reader *pfile)
builtin_define ("__bool=__attribute__((altivec(bool__))) unsigned");
/* APPLE LOCAL begin AltiVec */
+ builtin_define ("vector=vector");
+ builtin_define ("pixel=pixel");
+ builtin_define ("_Bool=_Bool");
+ builtin_define ("bool=bool");
+ init_vector_keywords (pfile);
+
+ /* Indicate that the compiler supports Apple AltiVec syntax,
+ including context-sensitive keywords. */
if (rs6000_altivec_pim)
{
- builtin_define ("vector=vector");
- builtin_define ("pixel=pixel");
- builtin_define ("_Bool=_Bool");
- builtin_define ("bool=bool");
- init_vector_keywords (pfile);
-
- /* Indicate that the compiler supports Apple AltiVec syntax,
- including context-sensitive keywords. */
builtin_define ("__APPLE_ALTIVEC__");
builtin_define ("vec_step(T)=(sizeof (__typeof__(T)) / sizeof (__typeof__(T) __attribute__((altivec(element__)))))");
-
- /* Enable context-sensitive macros. */
- cpp_get_callbacks (pfile)->macro_to_expand = rs6000_macro_to_expand;
}
+
+ /* Enable context-sensitive macros. */
+ cpp_get_callbacks (pfile)->macro_to_expand = rs6000_macro_to_expand;
/* APPLE LOCAL end AltiVec */
}
if (TARGET_SPE)
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 37f0a42d210..4f2cfae461b 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -1729,7 +1729,7 @@ rs6000_override_options (const char *default_cpu)
/* APPLE LOCAL begin AltiVec */
/* Enable '(vector signed int)(a, b, c, d)' vector literal notation. */
- if (rs6000_altivec_pim)
+ if (TARGET_ALTIVEC)
targetm.cast_expr_as_vector_init = true;
/* APPLE LOCAL end AltiVec */
diff --git a/gcc/testsuite/ChangeLog.apple-ppc b/gcc/testsuite/ChangeLog.apple-ppc
index b1c4e52cc91..469b5fcd680 100644
--- a/gcc/testsuite/ChangeLog.apple-ppc
+++ b/gcc/testsuite/ChangeLog.apple-ppc
@@ -3,24 +3,6 @@
Radar 4484188
* g++.old-deja/g++.other/init19.C: New.
-2006-03-22 Geoffrey Keating <geoffk@apple.com>
-
- Radar 4255172
- * gcc.apple/altivec-maltivec-2.c: New.
- * gcc.apple/altivec-maltivec-3.c: New.
- * gcc.apple/altivec-maltivec-1.c: Pass -faltivec, don't include
- <altivec.h>.
- * gcc.apple/apple-altivec-5.c: Likewise.
- * gcc.apple/apple-altivec-6.c: Likewise.
- * gcc.apple/apple-altivec-7.c: Likewise.
- * gcc.apple/apple-altivec-8.c: Likewise.
- * gcc.apple/altivec-19.c: Likewise.
- * gcc.apple/altivec-20.c: Likewise.
- * gcc.apple/apple-altivec-test.c: Likewise.
- * g++.dg/apple-altivec-2.c: Likewise.
- * g++.dg/apple-altivec-6.c: Likewise.
- * g++.dg/apple-altivec-11.c: Likewise.
-
2006-03-17 Stuart Hastings <stuart@apple.com>
Radar 4474655
diff --git a/gcc/testsuite/g++.dg/align-test-1.C b/gcc/testsuite/g++.dg/align-test-1.C
index e0cdb68c851..75f1563184a 100644
--- a/gcc/testsuite/g++.dg/align-test-1.C
+++ b/gcc/testsuite/g++.dg/align-test-1.C
@@ -152,7 +152,7 @@ class C20 {
/* === vectors === */
-#ifdef __VEC__
+#ifdef __APPLE_ALTIVEC__
class VC1 {
public:
vector signed short f1;
diff --git a/gcc/testsuite/g++.dg/apple-altivec-2.C b/gcc/testsuite/g++.dg/apple-altivec-2.C
index cf73ac64499..4e6d70b483b 100644
--- a/gcc/testsuite/g++.dg/apple-altivec-2.C
+++ b/gcc/testsuite/g++.dg/apple-altivec-2.C
@@ -1,6 +1,8 @@
/* APPLE LOCAL file */
/* { dg-do run { target powerpc*-*-* } } */
-/* { dg-options "-maltivec -faltivec" } */
+/* { dg-options "-maltivec" } */
+
+#include <altivec.h>
extern "C" void abort (void);
diff --git a/gcc/testsuite/g++.dg/apple-altivec-6.C b/gcc/testsuite/g++.dg/apple-altivec-6.C
index 935eb7f89ce..90c2d48abe1 100644
--- a/gcc/testsuite/g++.dg/apple-altivec-6.C
+++ b/gcc/testsuite/g++.dg/apple-altivec-6.C
@@ -1,6 +1,6 @@
/* APPLE LOCAL file */
/* { dg-do run { target powerpc*-*-* } } */
-/* { dg-options "-maltivec -pedantic -faltivec" } */
+/* { dg-options "-maltivec -pedantic" } */
int main()
{
diff --git a/gcc/testsuite/g++.dg/apple-altivec-test.C b/gcc/testsuite/g++.dg/apple-altivec-test.C
index f752b97dced..723ed86006d 100644
--- a/gcc/testsuite/g++.dg/apple-altivec-test.C
+++ b/gcc/testsuite/g++.dg/apple-altivec-test.C
@@ -1,6 +1,8 @@
/* APPLE LOCAL file */
/* { dg-do run { target powerpc*-*-* } } */
-/* { dg-options "-maltivec -faltivec" } */
+/* { dg-options "-maltivec" } */
+
+#include <altivec.h>
extern "C" void abort();
diff --git a/gcc/testsuite/g++.dg/ext/altivec-apple-11.C b/gcc/testsuite/g++.dg/ext/altivec-apple-11.C
index fa459a5c8be..c5104b2635b 100644
--- a/gcc/testsuite/g++.dg/ext/altivec-apple-11.C
+++ b/gcc/testsuite/g++.dg/ext/altivec-apple-11.C
@@ -2,7 +2,7 @@
/* This is a compile-only test for interaction of "-maltivec" and "-save-temps". */
/* Author: Ziemowit Laski <zlaski@apple.com>. */
/* { dg-do compile { target powerpc*-*-* } } */
-/* { dg-options "-save-temps -faltivec" } */
+/* { dg-options "-save-temps -maltivec" } */
#define vector_float vector float
#define vector_float_foo vector float foo
diff --git a/gcc/testsuite/gcc.apple/align-test-1.c b/gcc/testsuite/gcc.apple/align-test-1.c
index e8493c0e260..7180d2a5e5e 100644
--- a/gcc/testsuite/gcc.apple/align-test-1.c
+++ b/gcc/testsuite/gcc.apple/align-test-1.c
@@ -99,7 +99,7 @@ typedef struct P5 {
UINT8 f2;
} P5;
-#ifdef __VEC__
+#ifdef __APPLE_ALTIVEC__
typedef struct P61 {
vector signed short * f1;
UINT8 f2;
@@ -108,7 +108,7 @@ typedef struct P61 {
/* === vectors === */
-#ifdef __VEC__
+#ifdef __APPLE_ALTIVEC__
typedef struct V1 {
vector signed short f1;
UINT8 f2;
diff --git a/gcc/testsuite/gcc.apple/altivec-19.c b/gcc/testsuite/gcc.apple/altivec-19.c
index 232f31a12ce..857962f9f2e 100644
--- a/gcc/testsuite/gcc.apple/altivec-19.c
+++ b/gcc/testsuite/gcc.apple/altivec-19.c
@@ -1,6 +1,6 @@
/* APPLE LOCAL entire file */
/* { dg-do run { target powerpc*-*-* } } */
-/* { dg-options "-maltivec -faltivec -pedantic" } */
+/* { dg-options "-maltivec -pedantic" } */
int main()
{
diff --git a/gcc/testsuite/gcc.apple/altivec-20.c b/gcc/testsuite/gcc.apple/altivec-20.c
index 782ee9a4afb..63cc2dba6d8 100644
--- a/gcc/testsuite/gcc.apple/altivec-20.c
+++ b/gcc/testsuite/gcc.apple/altivec-20.c
@@ -1,5 +1,5 @@
/* { dg-do compile { target powerpc*-*-* } } */
-/* { dg-options "-maltivec -faltivec" } */
+/* { dg-options "-maltivec" } */
#define vector __attribute__((vector_size(16)))
diff --git a/gcc/testsuite/gcc.apple/altivec-maltivec-1.c b/gcc/testsuite/gcc.apple/altivec-maltivec-1.c
index fdf212e308d..c23542ce6ce 100644
--- a/gcc/testsuite/gcc.apple/altivec-maltivec-1.c
+++ b/gcc/testsuite/gcc.apple/altivec-maltivec-1.c
@@ -2,13 +2,14 @@
/* { dg-do compile { target powerpc*-*-* } } */
/* For 64-bit we need 64-bit headers. */
/* { dg-xfail-if "" { powerpc*-*-darwin* } { "-m64" } { "" } } */
-/* { dg-options "-O3 -finline-limit=9999 -maltivec -Wa,-force_cpusubtype_ALL -fdump-ipa-cgraph -S -faltivec" } */
+/* { dg-options "-O3 -finline-limit=9999 -maltivec -Wa,-force_cpusubtype_ALL -fdump-ipa-cgraph -S" } */
/* Inliner should inline AltiVec(tm) functions normally when -maltivec is on. */
/* <rdar://problem/3837835> Selective inlining of functions that use Altivec */
#include <Carbon/Carbon.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <altivec.h>
#define N 400
#define N4 ((N+3)/4)
diff --git a/gcc/testsuite/gcc.apple/altivec-maltivec-2.c b/gcc/testsuite/gcc.apple/altivec-maltivec-2.c
deleted file mode 100644
index b8bdcab3adf..00000000000
--- a/gcc/testsuite/gcc.apple/altivec-maltivec-2.c
+++ /dev/null
@@ -1,13 +0,0 @@
-/* APPLE LOCAL file AltiVec */
-/* { dg-do preprocess { target powerpc*-*-* } } */
-/* { dg-options "-maltivec" } */
-
-/* -maltivec should not define macros. */
-#ifdef vector
-#error vector should not be defined
-#endif
-#ifdef bool
-#error bool should not be defined
-#endif
-
-
diff --git a/gcc/testsuite/gcc.apple/altivec-maltivec-3.c b/gcc/testsuite/gcc.apple/altivec-maltivec-3.c
deleted file mode 100644
index 0fa7a0724ae..00000000000
--- a/gcc/testsuite/gcc.apple/altivec-maltivec-3.c
+++ /dev/null
@@ -1,14 +0,0 @@
-/* APPLE LOCAL file AltiVec */
-/* { dg-do compile { target powerpc*-*-* } } */
-/* { dg-options "-maltivec" } */
-
-/* Check that -faltivec language changes don't leak into -maltivec. */
-
-static int v1 = (1, 2); /* { dg-error "not constant" } */
-
-typedef int vt __attribute__((vector_size (16)));
-
-void f(void)
-{
- vt v2 = (vt)(1,2,3,4); /* { dg-error "can't convert" } */
-}
diff --git a/gcc/testsuite/gcc.apple/apple-altivec-5.c b/gcc/testsuite/gcc.apple/apple-altivec-5.c
index 8f8ffb64726..0c7dd9bcb60 100644
--- a/gcc/testsuite/gcc.apple/apple-altivec-5.c
+++ b/gcc/testsuite/gcc.apple/apple-altivec-5.c
@@ -1,5 +1,7 @@
/* { dg-do run { target powerpc*-*-* } } */
-/* { dg-options "-maltivec -faltivec" } */
+/* { dg-options "-maltivec" } */
+
+#include <altivec.h>
extern void abort();
diff --git a/gcc/testsuite/gcc.apple/apple-altivec-6.c b/gcc/testsuite/gcc.apple/apple-altivec-6.c
index b16e469d530..09e1f6861bf 100644
--- a/gcc/testsuite/gcc.apple/apple-altivec-6.c
+++ b/gcc/testsuite/gcc.apple/apple-altivec-6.c
@@ -1,5 +1,7 @@
/* { dg-do run { target powerpc*-*-* } } */
-/* { dg-options "-maltivec -faltivec" } */
+/* { dg-options "-maltivec" } */
+
+#include <altivec.h>
extern void abort();
diff --git a/gcc/testsuite/gcc.apple/apple-altivec-7.c b/gcc/testsuite/gcc.apple/apple-altivec-7.c
index 60146f1bfc9..ffbb408aadd 100644
--- a/gcc/testsuite/gcc.apple/apple-altivec-7.c
+++ b/gcc/testsuite/gcc.apple/apple-altivec-7.c
@@ -1,5 +1,7 @@
/* { dg-do run { target powerpc*-*-* } } */
-/* { dg-options "-maltivec -faltivec" } */
+/* { dg-options "-maltivec" } */
+
+#include <altivec.h>
extern void abort();
diff --git a/gcc/testsuite/gcc.apple/apple-altivec-8.c b/gcc/testsuite/gcc.apple/apple-altivec-8.c
index 3357ccbe00c..fb2389526d2 100644
--- a/gcc/testsuite/gcc.apple/apple-altivec-8.c
+++ b/gcc/testsuite/gcc.apple/apple-altivec-8.c
@@ -1,8 +1,10 @@
/* { dg-do run { target powerpc*-*-* } } */
-/* { dg-options "-maltivec -O2 -faltivec" } */
+/* { dg-options "-maltivec -O2" } */
/* ICEs at -O1 or more */
+#include <altivec.h>
+
extern void abort();
int main()