summaryrefslogtreecommitdiffstats
path: root/contrib/gcc
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2013-12-30 03:39:46 +0000
committerpfg <pfg@FreeBSD.org>2013-12-30 03:39:46 +0000
commit63558da0f9110285f93152cec05f2b2deb11d6b1 (patch)
treeb22ed76aba1e0f646b7ae4bfef96049bf7cc95c9 /contrib/gcc
parent890135ba9f0c849625a36e678b4c38e5fe2eeece (diff)
downloadFreeBSD-src-63558da0f9110285f93152cec05f2b2deb11d6b1.zip
FreeBSD-src-63558da0f9110285f93152cec05f2b2deb11d6b1.tar.gz
MFC r259005, r259092:
gcc: Add -flax-vector-conversions gcc: new fvisibility-ms-compat option These are useful for compatibility with newwer gcc and clang. Obtained from: gcc 4.3 (rev. 120572, 120688, 126088; GPLv2)
Diffstat (limited to 'contrib/gcc')
-rw-r--r--contrib/gcc/ChangeLog.gcc4338
-rw-r--r--contrib/gcc/c-common.c55
-rw-r--r--contrib/gcc/c-common.h6
-rw-r--r--contrib/gcc/c-opts.c4
-rw-r--r--contrib/gcc/c-typeck.c4
-rw-r--r--contrib/gcc/c.opt8
-rw-r--r--contrib/gcc/config/i386/i386.c4
-rw-r--r--contrib/gcc/config/rs6000/altivec.h4
-rw-r--r--contrib/gcc/config/rs6000/rs6000-c.c48
-rw-r--r--contrib/gcc/cp/ChangeLog.gcc4320
-rw-r--r--contrib/gcc/cp/call.c2
-rw-r--r--contrib/gcc/cp/decl.c3
-rw-r--r--contrib/gcc/cp/decl2.c13
-rw-r--r--contrib/gcc/cp/typeck.c4
-rw-r--r--contrib/gcc/doc/invoke.texi43
15 files changed, 202 insertions, 54 deletions
diff --git a/contrib/gcc/ChangeLog.gcc43 b/contrib/gcc/ChangeLog.gcc43
index 8a1c1d0..b18207e 100644
--- a/contrib/gcc/ChangeLog.gcc43
+++ b/contrib/gcc/ChangeLog.gcc43
@@ -45,6 +45,12 @@
* flags.h (force_align_functions_log): Delete.
* toplev.c (force_align_functions_log): Delete.
+2007-06-28 Geoffrey Keating <geoffk@apple.com> (r126088)
+
+ * doc/invoke.texi (C++ Dialect Options): Document
+ fvisibility-ms-compat.
+ * c.opt (fvisibility-ms-compat): New.
+
2007-06-05 Joerg Wunsch <j.gnu@uriah.heep.sax.de> (r125346)
PR preprocessor/23479
@@ -405,14 +411,44 @@
* config.gcc: Support core2 processor.
-2007-01-08 Geoffrey Keating <geoffk@apple.com> (r120611)
+2007-01-11 Joseph Myers <joseph@codesourcery.com> (r120688)
+
+ * c-common.c (vector_types_convertible_p): Treat opaque types as
+ always convertible if they have the same size, but not otherwise.
+2007-01-08 Geoffrey Keating <geoffk@apple.com> (r120611)
+
* target.h (struct gcc_target): New field library_rtti_comdat.
* target-def.h (TARGET_CXX_LIBRARY_RTTI_COMDAT): New.
(TARGET_CXX): Add TARGET_CXX_LIBRARY_RTTI_COMDAT.
* doc/tm.texi (C++ ABI): Document TARGET_CXX_LIBRARY_RTTI_COMDAT.
* config/darwin.h (TARGET_CXX_LIBRARY_RTTI_COMDAT): Define.
+2007-01-08 Mark Shinwell <shinwell@codesourcery.com> (r120572)
+
+ * c.opt: Add -flax-vector-conversions.
+ * c-typeck.c (convert_for_assignment): Pass flag to
+ vector_types_convertible_p to allow emission of note.
+ (digest_init): Likewise.
+ * c-opts.c: Handle -flax-vector-conversions.
+ * c-common.c (flag_lax_vector_conversions): New.
+ (vector_types_convertible_p): Unless -flax-vector conversions
+ has been passed, disallow conversions between vectors with
+ differing numbers of subparts and/or element types. If such
+ a conversion is disallowed, possibly emit a note on the first
+ occasion only to inform the user of -flax-vector-conversions.
+ The new last argument specifies this.
+ * c-common.h (flag_lax_vector_conversions): New.
+ (vector_types_convertible_p): Add extra argument.
+ * config/i386/i386.c (ix86_init_mmx_sse_builtins): Use
+ char_type_node for V*QI type vectors.
+ * config/rs6000/rs6000-c.c (altivec_overloaded_builtins):
+ Update to satisfy new typechecking rules.
+ * config/rs6000/altivec.h (vec_cmple): Use vec_cmpge, for both
+ C and C++ variants.
+ * doc/invoke.texi (C Dialect Options): Document
+ -flax-vector-conversions.
+
2007-01-05 Manuel Lopez-Ibanez <manu@gcc.gnu.org> (r120505)
PR c/19978
diff --git a/contrib/gcc/c-common.c b/contrib/gcc/c-common.c
index f4edb52..b1fa91d 100644
--- a/contrib/gcc/c-common.c
+++ b/contrib/gcc/c-common.c
@@ -254,6 +254,10 @@ int flag_short_double;
int flag_short_wchar;
+/* Nonzero means allow implicit conversions between vectors with
+ differing numbers of subparts and/or differing element types. */
+int flag_lax_vector_conversions;
+
/* Nonzero means allow Microsoft extensions without warnings or errors. */
int flag_ms_extensions;
@@ -1095,18 +1099,45 @@ constant_fits_type_p (tree c, tree type)
return !TREE_OVERFLOW (c);
}
-/* Nonzero if vector types T1 and T2 can be converted to each other
- without an explicit cast. */
-int
-vector_types_convertible_p (tree t1, tree t2)
-{
- return targetm.vector_opaque_p (t1)
- || targetm.vector_opaque_p (t2)
- || (tree_int_cst_equal (TYPE_SIZE (t1), TYPE_SIZE (t2))
- && (TREE_CODE (TREE_TYPE (t1)) != REAL_TYPE ||
- TYPE_PRECISION (t1) == TYPE_PRECISION (t2))
- && INTEGRAL_TYPE_P (TREE_TYPE (t1))
- == INTEGRAL_TYPE_P (TREE_TYPE (t2)));
+
+/* True if vector types T1 and T2 can be converted to each other
+ without an explicit cast. If EMIT_LAX_NOTE is true, and T1 and T2
+ can only be converted with -flax-vector-conversions yet that is not
+ in effect, emit a note telling the user about that option if such
+ a note has not previously been emitted. */
+bool
+vector_types_convertible_p (tree t1, tree t2, bool emit_lax_note)
+{
+ static bool emitted_lax_note = false;
+ bool convertible_lax;
+
+ if ((targetm.vector_opaque_p (t1) || targetm.vector_opaque_p (t2))
+ && tree_int_cst_equal (TYPE_SIZE (t1), TYPE_SIZE (t2)))
+ return true;
+
+ convertible_lax =
+ (tree_int_cst_equal (TYPE_SIZE (t1), TYPE_SIZE (t2))
+ && (TREE_CODE (TREE_TYPE (t1)) != REAL_TYPE ||
+ TYPE_PRECISION (t1) == TYPE_PRECISION (t2))
+ && (INTEGRAL_TYPE_P (TREE_TYPE (t1))
+ == INTEGRAL_TYPE_P (TREE_TYPE (t2))));
+
+ if (!convertible_lax || flag_lax_vector_conversions)
+ return convertible_lax;
+
+ if (TYPE_VECTOR_SUBPARTS (t1) == TYPE_VECTOR_SUBPARTS (t2)
+ && comptypes (TREE_TYPE (t1), TREE_TYPE (t2)))
+ return true;
+
+ if (emit_lax_note && !emitted_lax_note)
+ {
+ emitted_lax_note = true;
+ inform ("use -flax-vector-conversions to permit "
+ "conversions between vectors with differing "
+ "element types or numbers of subparts");
+ }
+
+ return false;
}
/* Convert EXPR to TYPE, warning about conversion problems with constants.
diff --git a/contrib/gcc/c-common.h b/contrib/gcc/c-common.h
index 00c58e3..8848ea5 100644
--- a/contrib/gcc/c-common.h
+++ b/contrib/gcc/c-common.h
@@ -389,6 +389,10 @@ extern int flag_short_double;
extern int flag_short_wchar;
+/* Nonzero means allow implicit conversions between vectors with
+ differing numbers of subparts and/or differing element types. */
+extern int flag_lax_vector_conversions;
+
/* Nonzero means allow Microsoft extensions without warnings or errors. */
extern int flag_ms_extensions;
@@ -791,7 +795,7 @@ extern tree finish_label_address_expr (tree);
extern tree lookup_label (tree);
extern tree lookup_name (tree);
-extern int vector_types_convertible_p (tree t1, tree t2);
+extern bool vector_types_convertible_p (tree t1, tree t2, bool emit_lax_note);
extern rtx c_expand_expr (tree, rtx, enum machine_mode, int, rtx *);
diff --git a/contrib/gcc/c-opts.c b/contrib/gcc/c-opts.c
index a1ec3e3..6b29068 100644
--- a/contrib/gcc/c-opts.c
+++ b/contrib/gcc/c-opts.c
@@ -716,6 +716,10 @@ c_common_handle_option (size_t scode, const char *arg, int value)
flag_implicit_templates = value;
break;
+ case OPT_flax_vector_conversions:
+ flag_lax_vector_conversions = value;
+ break;
+
case OPT_fms_extensions:
flag_ms_extensions = value;
break;
diff --git a/contrib/gcc/c-typeck.c b/contrib/gcc/c-typeck.c
index 8941611..cd30cd1 100644
--- a/contrib/gcc/c-typeck.c
+++ b/contrib/gcc/c-typeck.c
@@ -3893,7 +3893,7 @@ convert_for_assignment (tree type, tree rhs, enum impl_conv errtype,
}
/* Some types can interconvert without explicit casts. */
else if (codel == VECTOR_TYPE && coder == VECTOR_TYPE
- && vector_types_convertible_p (type, TREE_TYPE (rhs)))
+ && vector_types_convertible_p (type, TREE_TYPE (rhs), true))
return convert (type, rhs);
/* Arithmetic types all interconvert, and enum is treated like int. */
else if ((codel == INTEGER_TYPE || codel == REAL_TYPE
@@ -4629,7 +4629,7 @@ digest_init (tree type, tree init, bool strict_string, int require_constant)
below and handle as a constructor. */
if (code == VECTOR_TYPE
&& TREE_CODE (TREE_TYPE (inside_init)) == VECTOR_TYPE
- && vector_types_convertible_p (TREE_TYPE (inside_init), type)
+ && vector_types_convertible_p (TREE_TYPE (inside_init), type, true)
&& TREE_CONSTANT (inside_init))
{
if (TREE_CODE (inside_init) == VECTOR_CST
diff --git a/contrib/gcc/c.opt b/contrib/gcc/c.opt
index be3a80f..58d13e8 100644
--- a/contrib/gcc/c.opt
+++ b/contrib/gcc/c.opt
@@ -590,6 +590,10 @@ Inject friend functions into enclosing namespace
flabels-ok
C++ ObjC++
+flax-vector-conversions
+C ObjC C++ ObjC++
+Allow implicit conversions between vectors with differing numbers of subparts and/or differing element types.
+
fms-extensions
C ObjC C++ ObjC++
Don't warn about uses of Microsoft extensions
@@ -743,6 +747,10 @@ fvisibility-inlines-hidden
C++ ObjC++
Marks all inlined methods as having hidden visibility
+fvisibility-ms-compat
+C++ ObjC++ Var(flag_visibility_ms_compat)
+Changes visibility to match Microsoft Visual Studio by default
+
fvtable-gc
C++ ObjC++
Discard unused virtual functions
diff --git a/contrib/gcc/config/i386/i386.c b/contrib/gcc/config/i386/i386.c
index 51bd93c..88f2836 100644
--- a/contrib/gcc/config/i386/i386.c
+++ b/contrib/gcc/config/i386/i386.c
@@ -15408,7 +15408,7 @@ ix86_init_mmx_sse_builtins (void)
const struct builtin_description * d;
size_t i;
- tree V16QI_type_node = build_vector_type_for_mode (intQI_type_node, V16QImode);
+ tree V16QI_type_node = build_vector_type_for_mode (char_type_node, V16QImode);
tree V2SI_type_node = build_vector_type_for_mode (intSI_type_node, V2SImode);
tree V2SF_type_node = build_vector_type_for_mode (float_type_node, V2SFmode);
tree V2DI_type_node
@@ -15417,7 +15417,7 @@ ix86_init_mmx_sse_builtins (void)
tree V4SF_type_node = build_vector_type_for_mode (float_type_node, V4SFmode);
tree V4SI_type_node = build_vector_type_for_mode (intSI_type_node, V4SImode);
tree V4HI_type_node = build_vector_type_for_mode (intHI_type_node, V4HImode);
- tree V8QI_type_node = build_vector_type_for_mode (intQI_type_node, V8QImode);
+ tree V8QI_type_node = build_vector_type_for_mode (char_type_node, V8QImode);
tree V8HI_type_node = build_vector_type_for_mode (intHI_type_node, V8HImode);
tree pchar_type_node = build_pointer_type (char_type_node);
diff --git a/contrib/gcc/config/rs6000/altivec.h b/contrib/gcc/config/rs6000/altivec.h
index dacb6d0..dc9cb83 100644
--- a/contrib/gcc/config/rs6000/altivec.h
+++ b/contrib/gcc/config/rs6000/altivec.h
@@ -332,7 +332,7 @@ NAME (T a1, U a2) \
__altivec_binary_pred(vec_cmplt,
__builtin_vec_cmpgt (a2, a1))
__altivec_binary_pred(vec_cmple,
- __builtin_altivec_cmpge (a2, a1))
+ __builtin_vec_cmpge (a2, a1))
__altivec_scalar_pred(vec_all_in,
__builtin_altivec_vcmpbfp_p (__CR6_EQ, a1, a2))
@@ -402,7 +402,7 @@ __altivec_scalar_pred(vec_any_nle,
#undef __altivec_binary_pred
#else
#define vec_cmplt(a1, a2) __builtin_vec_cmpgt ((a2), (a1))
-#define vec_cmple(a1, a2) __builtin_altivec_vcmpgefp ((a2), (a1))
+#define vec_cmple(a1, a2) __builtin_vec_cmpge ((a2), (a1))
#define vec_all_in(a1, a2) __builtin_altivec_vcmpbfp_p (__CR6_EQ, (a1), (a2))
#define vec_any_out(a1, a2) __builtin_altivec_vcmpbfp_p (__CR6_EQ_REV, (a1), (a2))
diff --git a/contrib/gcc/config/rs6000/rs6000-c.c b/contrib/gcc/config/rs6000/rs6000-c.c
index 5c6abd10..5be9cf3 100644
--- a/contrib/gcc/config/rs6000/rs6000-c.c
+++ b/contrib/gcc/config/rs6000/rs6000-c.c
@@ -222,17 +222,17 @@ const struct altivec_builtin_types altivec_overloaded_builtins[] = {
{ ALTIVEC_BUILTIN_VEC_UNPACKH, ALTIVEC_BUILTIN_VUPKHSB,
RS6000_BTI_V8HI, RS6000_BTI_V16QI, 0, 0 },
{ ALTIVEC_BUILTIN_VEC_UNPACKH, ALTIVEC_BUILTIN_VUPKHSB,
- RS6000_BTI_V8HI, RS6000_BTI_bool_V16QI, 0, 0 },
+ RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V16QI, 0, 0 },
{ ALTIVEC_BUILTIN_VEC_UNPACKH, ALTIVEC_BUILTIN_VUPKHSH,
RS6000_BTI_V4SI, RS6000_BTI_V8HI, 0, 0 },
{ ALTIVEC_BUILTIN_VEC_UNPACKH, ALTIVEC_BUILTIN_VUPKHSH,
- RS6000_BTI_V4SI, RS6000_BTI_bool_V8HI, 0, 0 },
+ RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V8HI, 0, 0 },
{ ALTIVEC_BUILTIN_VEC_UNPACKH, ALTIVEC_BUILTIN_VUPKHPX,
RS6000_BTI_unsigned_V4SI, RS6000_BTI_pixel_V8HI, 0, 0 },
{ ALTIVEC_BUILTIN_VEC_VUPKHSH, ALTIVEC_BUILTIN_VUPKHSH,
RS6000_BTI_V4SI, RS6000_BTI_V8HI, 0, 0 },
{ ALTIVEC_BUILTIN_VEC_VUPKHSH, ALTIVEC_BUILTIN_VUPKHSH,
- RS6000_BTI_V4SI, RS6000_BTI_bool_V8HI, 0, 0 },
+ RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V8HI, 0, 0 },
{ ALTIVEC_BUILTIN_VEC_VUPKHPX, ALTIVEC_BUILTIN_VUPKHPX,
RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V8HI, 0, 0 },
{ ALTIVEC_BUILTIN_VEC_VUPKHPX, ALTIVEC_BUILTIN_VUPKHPX,
@@ -240,17 +240,17 @@ const struct altivec_builtin_types altivec_overloaded_builtins[] = {
{ ALTIVEC_BUILTIN_VEC_VUPKHSB, ALTIVEC_BUILTIN_VUPKHSB,
RS6000_BTI_V8HI, RS6000_BTI_V16QI, 0, 0 },
{ ALTIVEC_BUILTIN_VEC_VUPKHSB, ALTIVEC_BUILTIN_VUPKHSB,
- RS6000_BTI_V8HI, RS6000_BTI_bool_V16QI, 0, 0 },
+ RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V16QI, 0, 0 },
{ ALTIVEC_BUILTIN_VEC_UNPACKL, ALTIVEC_BUILTIN_VUPKLSB,
RS6000_BTI_V8HI, RS6000_BTI_V16QI, 0, 0 },
{ ALTIVEC_BUILTIN_VEC_UNPACKL, ALTIVEC_BUILTIN_VUPKLSB,
- RS6000_BTI_V8HI, RS6000_BTI_bool_V16QI, 0, 0 },
+ RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V16QI, 0, 0 },
{ ALTIVEC_BUILTIN_VEC_UNPACKL, ALTIVEC_BUILTIN_VUPKLPX,
RS6000_BTI_unsigned_V4SI, RS6000_BTI_pixel_V8HI, 0, 0 },
{ ALTIVEC_BUILTIN_VEC_UNPACKL, ALTIVEC_BUILTIN_VUPKLSH,
RS6000_BTI_V4SI, RS6000_BTI_V8HI, 0, 0 },
{ ALTIVEC_BUILTIN_VEC_UNPACKL, ALTIVEC_BUILTIN_VUPKLSH,
- RS6000_BTI_V4SI, RS6000_BTI_bool_V8HI, 0, 0 },
+ RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V8HI, 0, 0 },
{ ALTIVEC_BUILTIN_VEC_VUPKLPX, ALTIVEC_BUILTIN_VUPKLPX,
RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V8HI, 0, 0 },
{ ALTIVEC_BUILTIN_VEC_VUPKLPX, ALTIVEC_BUILTIN_VUPKLPX,
@@ -258,11 +258,11 @@ const struct altivec_builtin_types altivec_overloaded_builtins[] = {
{ ALTIVEC_BUILTIN_VEC_VUPKLSH, ALTIVEC_BUILTIN_VUPKLSH,
RS6000_BTI_V4SI, RS6000_BTI_V8HI, 0, 0 },
{ ALTIVEC_BUILTIN_VEC_VUPKLSH, ALTIVEC_BUILTIN_VUPKLSH,
- RS6000_BTI_V4SI, RS6000_BTI_bool_V8HI, 0, 0 },
+ RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V8HI, 0, 0 },
{ ALTIVEC_BUILTIN_VEC_VUPKLSB, ALTIVEC_BUILTIN_VUPKLSB,
RS6000_BTI_V8HI, RS6000_BTI_V16QI, 0, 0 },
{ ALTIVEC_BUILTIN_VEC_VUPKLSB, ALTIVEC_BUILTIN_VUPKLSB,
- RS6000_BTI_V8HI, RS6000_BTI_bool_V16QI, 0, 0 },
+ RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V16QI, 0, 0 },
/* Binary AltiVec builtins. */
{ ALTIVEC_BUILTIN_VEC_ADD, ALTIVEC_BUILTIN_VADDUBM,
@@ -576,31 +576,23 @@ const struct altivec_builtin_types altivec_overloaded_builtins[] = {
{ ALTIVEC_BUILTIN_VEC_CMPEQ, ALTIVEC_BUILTIN_VCMPEQFP,
RS6000_BTI_bool_V4SI, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 },
{ ALTIVEC_BUILTIN_VEC_VCMPEQFP, ALTIVEC_BUILTIN_VCMPEQFP,
- RS6000_BTI_V4SI, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 },
- { ALTIVEC_BUILTIN_VEC_VCMPEQUW, ALTIVEC_BUILTIN_VCMPEQUW,
- RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 },
- { ALTIVEC_BUILTIN_VEC_VCMPEQUW, ALTIVEC_BUILTIN_VCMPEQUW,
- RS6000_BTI_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 },
+ RS6000_BTI_bool_V4SI, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 },
+
{ ALTIVEC_BUILTIN_VEC_VCMPEQUW, ALTIVEC_BUILTIN_VCMPEQUW,
RS6000_BTI_bool_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 },
{ ALTIVEC_BUILTIN_VEC_VCMPEQUW, ALTIVEC_BUILTIN_VCMPEQUW,
RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 },
- { ALTIVEC_BUILTIN_VEC_VCMPEQUH, ALTIVEC_BUILTIN_VCMPEQUH,
- RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 },
- { ALTIVEC_BUILTIN_VEC_VCMPEQUH, ALTIVEC_BUILTIN_VCMPEQUH,
- RS6000_BTI_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 },
+
{ ALTIVEC_BUILTIN_VEC_VCMPEQUH, ALTIVEC_BUILTIN_VCMPEQUH,
RS6000_BTI_bool_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 },
{ ALTIVEC_BUILTIN_VEC_VCMPEQUH, ALTIVEC_BUILTIN_VCMPEQUH,
RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 },
- { ALTIVEC_BUILTIN_VEC_VCMPEQUB, ALTIVEC_BUILTIN_VCMPEQUB,
- RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 },
- { ALTIVEC_BUILTIN_VEC_VCMPEQUB, ALTIVEC_BUILTIN_VCMPEQUB,
- RS6000_BTI_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 },
+
{ ALTIVEC_BUILTIN_VEC_VCMPEQUB, ALTIVEC_BUILTIN_VCMPEQUB,
RS6000_BTI_bool_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 },
{ ALTIVEC_BUILTIN_VEC_VCMPEQUB, ALTIVEC_BUILTIN_VCMPEQUB,
RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 },
+
{ ALTIVEC_BUILTIN_VEC_CMPGE, ALTIVEC_BUILTIN_VCMPGEFP,
RS6000_BTI_bool_V4SI, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 },
{ ALTIVEC_BUILTIN_VEC_CMPGT, ALTIVEC_BUILTIN_VCMPGTUB,
@@ -618,29 +610,29 @@ const struct altivec_builtin_types altivec_overloaded_builtins[] = {
{ ALTIVEC_BUILTIN_VEC_CMPGT, ALTIVEC_BUILTIN_VCMPGTFP,
RS6000_BTI_bool_V4SI, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 },
{ ALTIVEC_BUILTIN_VEC_VCMPGTFP, ALTIVEC_BUILTIN_VCMPGTFP,
- RS6000_BTI_V4SI, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 },
+ RS6000_BTI_bool_V4SI, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 },
{ ALTIVEC_BUILTIN_VEC_VCMPGTSW, ALTIVEC_BUILTIN_VCMPGTSW,
- RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 },
+ RS6000_BTI_bool_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 },
{ ALTIVEC_BUILTIN_VEC_VCMPGTSW, ALTIVEC_BUILTIN_VCMPGTSW,
RS6000_BTI_bool_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 },
{ ALTIVEC_BUILTIN_VEC_VCMPGTUW, ALTIVEC_BUILTIN_VCMPGTUW,
- RS6000_BTI_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 },
+ RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 },
{ ALTIVEC_BUILTIN_VEC_VCMPGTUW, ALTIVEC_BUILTIN_VCMPGTUW,
RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 },
{ ALTIVEC_BUILTIN_VEC_VCMPGTSH, ALTIVEC_BUILTIN_VCMPGTSH,
- RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 },
+ RS6000_BTI_bool_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 },
{ ALTIVEC_BUILTIN_VEC_VCMPGTSH, ALTIVEC_BUILTIN_VCMPGTSH,
RS6000_BTI_bool_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 },
{ ALTIVEC_BUILTIN_VEC_VCMPGTUH, ALTIVEC_BUILTIN_VCMPGTUH,
- RS6000_BTI_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 },
+ RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 },
{ ALTIVEC_BUILTIN_VEC_VCMPGTUH, ALTIVEC_BUILTIN_VCMPGTUH,
RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 },
{ ALTIVEC_BUILTIN_VEC_VCMPGTSB, ALTIVEC_BUILTIN_VCMPGTSB,
- RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 },
+ RS6000_BTI_bool_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 },
{ ALTIVEC_BUILTIN_VEC_VCMPGTSB, ALTIVEC_BUILTIN_VCMPGTSB,
RS6000_BTI_bool_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 },
{ ALTIVEC_BUILTIN_VEC_VCMPGTUB, ALTIVEC_BUILTIN_VCMPGTUB,
- RS6000_BTI_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 },
+ RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 },
{ ALTIVEC_BUILTIN_VEC_VCMPGTUB, ALTIVEC_BUILTIN_VCMPGTUB,
RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 },
{ ALTIVEC_BUILTIN_VEC_CMPLE, ALTIVEC_BUILTIN_VCMPGEFP,
diff --git a/contrib/gcc/cp/ChangeLog.gcc43 b/contrib/gcc/cp/ChangeLog.gcc43
index f542192..d91a4e0 100644
--- a/contrib/gcc/cp/ChangeLog.gcc43
+++ b/contrib/gcc/cp/ChangeLog.gcc43
@@ -7,6 +7,13 @@
* typeck.c (cxx_alignof_expr): When alignof is used on a plain
FUNCTION_DECL, return its alignment.
+2007-06-28 Geoffrey Keating <geoffk@apple.com> (r126088)
+
+ * decl2.c (determine_visibility): Implement
+ flag_visibility_ms_compat effect on type info.
+ * decl.c (cxx_init_decl_processing): Implement
+ global effect of flag_visibility_ms_compat.
+
2007-06-28 Geoffrey Keating <geoffk@apple.com> (r126080)
* decl2.c (start_objects): Mark constructor-runnning function
@@ -37,14 +44,23 @@
* decl.c (compute_array_index_type): New warning flag warn_vla.
-2007-01-07 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+2007-01-08 Mark Shinwell <shinwell@codesourcery.com> (r120572)
+
+ * call.c (standard_conversion): Pass flag to
+ vector_types_convertible_p to disallow emission of note.
+ * typeck.c (convert_for_assignment): Pass flag to
+ vector_types_convertible_p to allow emission of note.
+ (ptr_reasonably_similar): Pass flag to vector_types_convertible_p
+ to disallow emission of note.
+
+2007-01-07 Manuel Lopez-Ibanez <manu@gcc.gnu.org> (r120558)
PR c++/28986
* typeck.c (build_binary_op): Call overflow_warning if
TREE_OVERFLOW_P is true for the result and not for any of the
operands.
-2007-01-05 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+2007-01-05 Manuel Lopez-Ibanez <manu@gcc.gnu.org> (r120505)
PR c/19978
* semantics.c (finish_unary_op_expr): Warn only if result
diff --git a/contrib/gcc/cp/call.c b/contrib/gcc/cp/call.c
index 848f3c8..24b5d1f 100644
--- a/contrib/gcc/cp/call.c
+++ b/contrib/gcc/cp/call.c
@@ -838,7 +838,7 @@ standard_conversion (tree to, tree from, tree expr, bool c_cast_p,
conv->rank = cr_promotion;
}
else if (fcode == VECTOR_TYPE && tcode == VECTOR_TYPE
- && vector_types_convertible_p (from, to))
+ && vector_types_convertible_p (from, to, false))
return build_conv (ck_std, to, conv);
else if (!(flags & LOOKUP_CONSTRUCTOR_CALLABLE)
&& IS_AGGR_TYPE (to) && IS_AGGR_TYPE (from)
diff --git a/contrib/gcc/cp/decl.c b/contrib/gcc/cp/decl.c
index c6f6b07..1bf9e84 100644
--- a/contrib/gcc/cp/decl.c
+++ b/contrib/gcc/cp/decl.c
@@ -3157,6 +3157,9 @@ cxx_init_decl_processing (void)
}
if (flag_inline_functions)
flag_inline_trees = 2;
+
+ if (flag_visibility_ms_compat)
+ default_visibility = VISIBILITY_HIDDEN;
/* Initially, C. */
current_lang_name = lang_name_c;
diff --git a/contrib/gcc/cp/decl2.c b/contrib/gcc/cp/decl2.c
index f0b46c9..69cdb99 100644
--- a/contrib/gcc/cp/decl2.c
+++ b/contrib/gcc/cp/decl2.c
@@ -1726,6 +1726,19 @@ determine_visibility (tree decl)
but have no TEMPLATE_INFO, so don't try to check it. */
use_template = 0;
}
+ else if (TREE_CODE (decl) == VAR_DECL && DECL_TINFO_P (decl)
+ && flag_visibility_ms_compat)
+ {
+ /* Under -fvisibility-ms-compat, types are visible by default,
+ even though their contents aren't. */
+ tree underlying_type = TREE_TYPE (DECL_NAME (decl));
+ int underlying_vis = type_visibility (underlying_type);
+ if (underlying_vis == VISIBILITY_ANON
+ || CLASSTYPE_VISIBILITY_SPECIFIED (underlying_type))
+ constrain_visibility (decl, underlying_vis);
+ else
+ DECL_VISIBILITY (decl) = VISIBILITY_DEFAULT;
+ }
else if (TREE_CODE (decl) == VAR_DECL && DECL_TINFO_P (decl))
{
/* tinfo visibility is based on the type it's for. */
diff --git a/contrib/gcc/cp/typeck.c b/contrib/gcc/cp/typeck.c
index adba2e1..925511b 100644
--- a/contrib/gcc/cp/typeck.c
+++ b/contrib/gcc/cp/typeck.c
@@ -6229,7 +6229,7 @@ convert_for_assignment (tree type, tree rhs,
coder = TREE_CODE (rhstype);
if (TREE_CODE (type) == VECTOR_TYPE && coder == VECTOR_TYPE
- && vector_types_convertible_p (type, rhstype))
+ && vector_types_convertible_p (type, rhstype, true))
return convert (type, rhs);
if (rhs == error_mark_node || rhstype == error_mark_node)
@@ -6799,7 +6799,7 @@ ptr_reasonably_similar (tree to, tree from)
continue;
if (TREE_CODE (to) == VECTOR_TYPE
- && vector_types_convertible_p (to, from))
+ && vector_types_convertible_p (to, from, false))
return 1;
if (TREE_CODE (to) == INTEGER_TYPE
diff --git a/contrib/gcc/doc/invoke.texi b/contrib/gcc/doc/invoke.texi
index 37a668a..ae7af30 100644
--- a/contrib/gcc/doc/invoke.texi
+++ b/contrib/gcc/doc/invoke.texi
@@ -167,7 +167,7 @@ in the following sections.
-fno-asm -fno-builtin -fno-builtin-@var{function} @gol
-fhosted -ffreestanding -fopenmp -fms-extensions @gol
-trigraphs -no-integrated-cpp -traditional -traditional-cpp @gol
--fallow-single-precision -fcond-mismatch @gol
+-fallow-single-precision -fcond-mismatch -flax-vector-conversions @gol
-fsigned-bitfields -fsigned-char @gol
@c APPLE LOCAL -Wnewline-eof 2001-08-23 --sts **
-Wnewline-eof (Apple compatible) @gol
@@ -188,6 +188,7 @@ in the following sections.
-frepo -fno-rtti -fstats -ftemplate-depth-@var{n} @gol
-fno-threadsafe-statics -fuse-cxa-atexit -fno-weak -nostdinc++ @gol
-fno-default-inline -fvisibility-inlines-hidden @gol
+-fvisibility-ms-compat @gol
-Wabi -Wctor-dtor-privacy @gol
-Wnon-virtual-dtor -Wreorder @gol
-Weffc++ -Wno-deprecated -Wstrict-null-sentinel @gol
@@ -1339,6 +1340,12 @@ Allow conditional expressions with mismatched types in the second and
third arguments. The value of such an expression is void. This option
is not supported for C++.
+@item -flax-vector-conversions
+@opindex flax-vector-conversions
+Allow implicit conversions between vectors with differing numbers of
+elements and/or incompatible element types. This option should not be
+used for new code.
+
@item -funsigned-char
@opindex funsigned-char
Let the type @code{char} be unsigned, like @code{unsigned char}.
@@ -1622,6 +1629,40 @@ Explicitly instantiated inline methods are unaffected by this option
as their linkage might otherwise cross a shared library boundary.
@xref{Template Instantiation}.
+@item -fvisibility-ms-compat
+@opindex fvisibility-ms-compat
+This flag attempts to use visibility settings to make GCC's C++
+linkage model compatible with that of Microsoft Visual Studio.
+
+The flag makes these changes to GCC's linkage model:
+
+@enumerate
+@item
+It sets the default visibility to @code{hidden}, like
+@option{-fvisibility=hidden}.
+
+@item
+Types, but not their members, are not hidden by default.
+
+@item
+The One Definition Rule is relaxed for types without explicit
+visibility specifications which are defined in more than one different
+shared object: those declarations are permitted if they would have
+been permitted when this option was not used.
+@end enumerate
+
+In new code it is better to use @option{-fvisibility=hidden} and
+export those classes which are intended to be externally visible.
+Unfortunately it is possible for code to rely, perhaps accidentally,
+on the Visual Studio behaviour.
+
+Among the consequences of these changes are that static data members
+of the same type with the same name but defined in different shared
+objects will be different, so changing one will not change the other;
+and that pointers to function members defined in different shared
+objects may not compare equal. When this flag is given, it is a
+violation of the ODR to define types with the same name differently.
+
@item -fno-weak
@opindex fno-weak
Do not use weak symbol support, even if it is provided by the linker.
OpenPOWER on IntegriCloud