summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog.MELT4
-rw-r--r--gcc/ChangeLog143
-rw-r--r--gcc/DATESTAMP2
-rw-r--r--gcc/c-convert.c26
-rw-r--r--gcc/c-family/ChangeLog6
-rw-r--r--gcc/c-family/c-common.c17
-rw-r--r--gcc/c-family/c-common.h4
-rw-r--r--gcc/c-parser.c5
-rw-r--r--gcc/c-typeck.c26
-rw-r--r--gcc/collect2.c2
-rw-r--r--gcc/config.gcc25
-rw-r--r--gcc/config/i386/driver-i386.c5
-rw-r--r--gcc/config/i386/i386-c.c7
-rw-r--r--gcc/config/i386/i386.c124
-rw-r--r--gcc/config/i386/i386.h3
-rw-r--r--gcc/config/i386/i386.md15
-rw-r--r--gcc/config/i386/sol2-10.h3
-rw-r--r--gcc/config/linux-android.opt9
-rw-r--r--gcc/config/rtems.opt33
-rw-r--r--gcc/config/sol2.h5
-rw-r--r--gcc/config/sol2.opt26
-rw-r--r--gcc/config/spu/spu.c27
-rwxr-xr-xgcc/configure1
-rw-r--r--gcc/configure.ac3
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/typeck.c6
-rw-r--r--gcc/doc/invoke.texi11
-rw-r--r--gcc/dwarf2out.c2
-rw-r--r--gcc/fortran/ChangeLog20
-rw-r--r--gcc/fortran/interface.c44
-rw-r--r--gcc/fortran/parse.c32
-rw-r--r--gcc/fortran/trans-expr.c27
-rw-r--r--gcc/go/gofrontend/types.cc94
-rw-r--r--gcc/go/gofrontend/types.h24
-rw-r--r--gcc/lto-cgraph.c53
-rw-r--r--gcc/lto-wrapper.c8
-rw-r--r--gcc/testsuite/ChangeLog38
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr47150.c11
-rw-r--r--gcc/testsuite/gcc.dg/lto/pr47188_0.c7
-rw-r--r--gcc/testsuite/gcc.dg/lto/pr47188_1.c8
-rw-r--r--gcc/testsuite/gcc.dg/stack-usage-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/pr47139.c18
-rw-r--r--gcc/testsuite/gfortran.dg/defined_operators_1.f9011
-rw-r--r--gcc/testsuite/gfortran.dg/extends_type_of_2.f0336
-rw-r--r--gcc/testsuite/gfortran.dg/interface_33.f9036
-rw-r--r--gcc/tree-vect-loop.c17
-rw-r--r--libgo/Makefile.am3
-rw-r--r--libgo/Makefile.in3
-rw-r--r--libjava/ChangeLog6
-rw-r--r--libjava/testsuite/libjava.jni/jni.exp4
-rw-r--r--libquadmath/ChangeLog9
-rw-r--r--libquadmath/Makefile.am8
-rw-r--r--libquadmath/Makefile.in24
-rw-r--r--libquadmath/configure.ac2
-rw-r--r--libstdc++-v3/ChangeLog19
-rw-r--r--libstdc++-v3/aclocal.m42
-rw-r--r--libstdc++-v3/config/abi/pre/gnu.ver3
-rw-r--r--libstdc++-v3/include/debug/forward_list72
-rw-r--r--libstdc++-v3/include/debug/safe_base.h10
-rw-r--r--libstdc++-v3/include/std/functional63
-rw-r--r--libstdc++-v3/src/Makefile.am6
-rw-r--r--libstdc++-v3/src/Makefile.in15
-rw-r--r--libstdc++-v3/src/debug.cc6
-rw-r--r--libstdc++-v3/src/placeholders.cc65
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/debug/swap.cc6
65 files changed, 1112 insertions, 245 deletions
diff --git a/ChangeLog.MELT b/ChangeLog.MELT
index a045f55e9ea..5a9b7529034 100644
--- a/ChangeLog.MELT
+++ b/ChangeLog.MELT
@@ -1,3 +1,7 @@
+2011-01-07 Basile Starynkevitch <basile@starynkevitch.net>
+
+ MELT branch merged with trunk rev 168562
+
2011-01-05 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 168508
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d25e30c1bd1..77aca5c317a 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,146 @@
+2011-01-06 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR debug/46704
+ * dwarf2out.c (dwarf2out_finish): Output the debug_aranges section
+ only when it is not empty.
+
+2011-01-06 Changpeng Fang <changpeng.fang@amd.com>
+
+ Bobcat Enablement
+ * config.gcc (i[34567]86-*-linux* | ...): Add btver1.
+ (case ${target}): Add btver1.
+ * config/i386/driver-i386.c (host_detect_local_cpu): Let
+ -march=native recognize btver1 processors.
+ * config/i386/i386-c.c (ix86_target_macros_internal): Add
+ btver1 def_and_undef
+ * config/i386/i386.c (struct processor_costs btver1_cost): New
+ btver1 cost table.
+ (m_BTVER1): New definition.
+ (m_AMD_MULTIPLE): Includes m_BTVER1.
+ (initial_ix86_tune_features): Add btver1 tune.
+ (processor_target_table): Add btver1 entry.
+ (static const char *const cpu_names): Add btver1 entry.
+ (software_prefetching_beneficial_p): Add btver1.
+ (ix86_option_override_internal): Add btver1 instruction sets.
+ (ix86_issue_rate): Add btver1.
+ (ix86_adjust_cost): Add btver1.
+ * config/i386/i386.h (TARGET_BTVER1): New definition.
+ (enum target_cpu_default): Add TARGET_CPU_DEFAULT_btver1.
+ (enum processor_type): Add PROCESSOR_BTVER1.
+ * config/i386/i386.md (define_attr "cpu"): Add btver1.
+
+2011-01-06 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ PR target/43309
+ * config/i386/i386.c (legitimize_tls_address)
+ <TLS_MODEL_INITIAL_EXEC>: Handle TARGET_64BIT && TARGET_SUN_TLS.
+ * config/i386/i386.md (UNSPEC_TLS_IE_SUN): Declare.
+ (tls_initial_exec_64_sun): New pattern.
+
+2011-01-06 Gerald Pfeifer <gerald@pfeifer.com>
+
+ * doc/invoke.texi (Overall Options): Improve wording and markup
+ of the description of -wrapper.
+
+2011-01-06 Joseph Myers <joseph@codesourcery.com>
+
+ * config/sol2.opt (G, YP,, Ym,, compat-bsd, pthread, pthreads,
+ rdynamic, threads): New Driver options.
+
+2011-01-06 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ PR target/38118
+ * config/sol2.h (ASM_OUTPUT_ALIGNED_COMMON): Also switch to .bss
+ if coming from .tdata.
+ * config/i386/sol2-10.h (ASM_OUTPUT_ALIGNED_COMMON): Likewise.
+
+2011-01-06 Jan Hubicka <jh@suse.cz>
+
+ PR lto/47188
+ * collect2.c (main): Do not enable LTOmode when plugin is active.
+
+2011-01-06 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ PR other/45915
+ * configure.ac (gcc_cv_as_gnu_unique_object): Only use ldd
+ --version output if supported.
+ * configure: Regenerate.
+
+2011-01-06 Joseph Myers <joseph@codesourcery.com>
+
+ * config/linux-android.opt (tno-android-cc, tno-android-ld): New
+ Driver options.
+
+2011-01-06 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/47150
+ * c-convert.c (convert): When converting a complex expression
+ other than COMPLEX_EXPR to a different complex type, ensure
+ c_save_expr is called instead of save_expr, unless in_late_binary_op.
+ * c-typeck.c (convert_for_assignment): Set in_late_binary_op also
+ when converting COMPLEX_TYPE.
+
+2011-01-06 Ira Rosen <irar@il.ibm.com>
+
+ PR tree-optimization/47139
+ * tree-vect-loop.c (vect_is_simple_reduction_1): Check that
+ only the last reduction value is used outside the loop. Update
+ documentation.
+
+2011-01-05 Joseph Myers <joseph@codesourcery.com>
+
+ * config/rtems.opt: New.
+ * config.gcc (*-*-rtems*): Use rtems.opt.
+
+2011-01-05 Changpeng Fang <changpeng.fang@amd.com>
+
+ * config/i386/i386.c (ix86_option_override_internal): Bulldozer
+ processors do not support 3DNow instructions.
+
+2011-01-05 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ * config/spu/spu.c (spu_option_override): Set parameter
+ PARAM_MAX_COMPLETELY_PEEL_TIMES to 4 instead of 1.
+
+2011-01-05 Jan Hubicka <jh@suse.cz>
+
+ * lto-wrapper.c (run_gcc): Default to WHOPR mode when none is specified
+ at the command line.
+
+2011-01-05 Martin Jambor <mjambor@suse.cz>
+
+ PR lto/47162
+ * lto-cgraph.c (output_cgraph_opt_summary_p): Also check for thunk
+ deltas on streamed outgoing edges.
+ (output_node_opt_summary): Output info for outgoing edges only when
+ the node is in new parameter set.
+ (output_cgraph_opt_summary): New parameter set, passed to the two
+ aforementioned functions. Update its forward declaration and its
+ callee too.
+
+2011-01-05 Tom Tromey <tromey@redhat.com>
+
+ * c-parser.c (c_parser_omp_atomic): Pass location of assignment
+ operator to c_finish_omp_atomic.
+ * c-typeck.c (lvalue_or_else): Add 'loc' argument.
+ (build_unary_op): Update.
+ (build_modify_expr): Update.
+ (build_asm_expr): Update.
+
+2011-01-05 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ * config/spu/spu.c (emit_nop_for_insn): Set INSN_LOCATOR for
+ newly inserted insns.
+ (pad_bb): Likewise.
+ (spu_emit_branch_hint): Likewise.
+ (insert_hbrp_for_ilb_runout): Likewise.
+ (spu_machine_dependent_reorg): Call df_finish_pass after
+ schedule_insns returns.
+
+2011-01-05 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ * config/spu/spu.c (spu_expand_prologue): Support -fstack-usage.
+
2011-01-05 Eric Botcazou <ebotcazou@adacore.com>
PR tree-optimization/47005
diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP
index 8f215714cab..b9c5d9900d3 100644
--- a/gcc/DATESTAMP
+++ b/gcc/DATESTAMP
@@ -1 +1 @@
-20110105
+20110107
diff --git a/gcc/c-convert.c b/gcc/c-convert.c
index f67aecf64ba..f4583c549c9 100644
--- a/gcc/c-convert.c
+++ b/gcc/c-convert.c
@@ -130,6 +130,32 @@ convert (tree type, tree expr)
goto maybe_fold;
case COMPLEX_TYPE:
+ /* If converting from COMPLEX_TYPE to a different COMPLEX_TYPE
+ and e is not COMPLEX_EXPR, convert_to_complex uses save_expr,
+ but for the C FE c_save_expr needs to be called instead. */
+ if (TREE_CODE (TREE_TYPE (e)) == COMPLEX_TYPE)
+ {
+ tree subtype = TREE_TYPE (type);
+ tree elt_type = TREE_TYPE (TREE_TYPE (e));
+
+ if (TYPE_MAIN_VARIANT (elt_type) != TYPE_MAIN_VARIANT (subtype)
+ && TREE_CODE (e) != COMPLEX_EXPR)
+ {
+ if (in_late_binary_op)
+ e = save_expr (e);
+ else
+ e = c_save_expr (e);
+ ret
+ = fold_build2 (COMPLEX_EXPR, type,
+ convert (subtype,
+ fold_build1 (REALPART_EXPR,
+ elt_type, e)),
+ convert (subtype,
+ fold_build1 (IMAGPART_EXPR,
+ elt_type, e)));
+ goto maybe_fold;
+ }
+ }
ret = convert_to_complex (type, e);
goto maybe_fold;
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index bf0bc7689f7..668524415b9 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,9 @@
+2011-01-05 Tom Tromey <tromey@redhat.com>
+
+ * c-common.h (lvalue_error): Update.
+ * c-common.c (lvalue_error): Add 'loc' argument. Call error_at,
+ not error.
+
2010-12-29 Nicola Pero <nicola@nicola.brainstorm.co.uk>
PR objc/47075
diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c
index 8eb849aa174..4af7ef4ee4e 100644
--- a/gcc/c-family/c-common.c
+++ b/gcc/c-family/c-common.c
@@ -1,6 +1,6 @@
/* Subroutines shared by all languages that are variants of C.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+ 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
This file is part of GCC.
@@ -8631,27 +8631,28 @@ readonly_error (tree arg, enum lvalue_use use)
}
/* Print an error message for an invalid lvalue. USE says
- how the lvalue is being used and so selects the error message. */
+ how the lvalue is being used and so selects the error message. LOC
+ is the location for the error. */
void
-lvalue_error (enum lvalue_use use)
+lvalue_error (location_t loc, enum lvalue_use use)
{
switch (use)
{
case lv_assign:
- error ("lvalue required as left operand of assignment");
+ error_at (loc, "lvalue required as left operand of assignment");
break;
case lv_increment:
- error ("lvalue required as increment operand");
+ error_at (loc, "lvalue required as increment operand");
break;
case lv_decrement:
- error ("lvalue required as decrement operand");
+ error_at (loc, "lvalue required as decrement operand");
break;
case lv_addressof:
- error ("lvalue required as unary %<&%> operand");
+ error_at (loc, "lvalue required as unary %<&%> operand");
break;
case lv_asm:
- error ("lvalue required in asm statement");
+ error_at (loc, "lvalue required in asm statement");
break;
default:
gcc_unreachable ();
diff --git a/gcc/c-family/c-common.h b/gcc/c-family/c-common.h
index 12845757c09..05456d33abd 100644
--- a/gcc/c-family/c-common.h
+++ b/gcc/c-family/c-common.h
@@ -1,6 +1,6 @@
/* Definitions for c-common.c.
Copyright (C) 1987, 1993, 1994, 1995, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
This file is part of GCC.
@@ -929,7 +929,7 @@ enum lvalue_use {
};
extern void readonly_error (tree, enum lvalue_use);
-extern void lvalue_error (enum lvalue_use);
+extern void lvalue_error (location_t, enum lvalue_use);
extern void invalid_indirection_error (location_t, tree, ref_operator);
extern int complete_array_type (tree *, tree, bool);
diff --git a/gcc/c-parser.c b/gcc/c-parser.c
index 4eaf8680f67..1e868afddf6 100644
--- a/gcc/c-parser.c
+++ b/gcc/c-parser.c
@@ -1,6 +1,6 @@
/* Parser for C and Objective-C.
Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
Parser actions based on the old Bison parser; structure somewhat
@@ -9104,6 +9104,9 @@ c_parser_omp_atomic (location_t loc, c_parser *parser)
goto saw_error;
}
+ /* Arrange to pass the location of the assignment operator to
+ c_finish_omp_atomic. */
+ loc = c_parser_peek_token (parser)->location;
c_parser_consume_token (parser);
{
location_t rhs_loc = c_parser_peek_token (parser)->location;
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index 44223fb38da..689423ea028 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -1,6 +1,6 @@
/* Build expressions with type checking for C compiler.
Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
This file is part of GCC.
@@ -98,7 +98,7 @@ static void set_nonincremental_init (struct obstack *);
static void set_nonincremental_init_from_string (tree, struct obstack *);
static tree find_init_member (tree, struct obstack *);
static void readonly_warning (tree, enum lvalue_use);
-static int lvalue_or_else (const_tree, enum lvalue_use);
+static int lvalue_or_else (location_t, const_tree, enum lvalue_use);
static void record_maybe_used_decl (tree);
static int comptypes_internal (const_tree, const_tree, bool *, bool *);
@@ -3564,7 +3564,8 @@ build_unary_op (location_t location,
/* Complain about anything that is not a true lvalue. In
Objective-C, skip this check for property_refs. */
if (!objc_is_property_ref (arg)
- && !lvalue_or_else (arg, ((code == PREINCREMENT_EXPR
+ && !lvalue_or_else (location,
+ arg, ((code == PREINCREMENT_EXPR
|| code == POSTINCREMENT_EXPR)
? lv_increment
: lv_decrement)))
@@ -3747,7 +3748,7 @@ build_unary_op (location_t location,
/* Anything not already handled and not a true memory reference
or a non-lvalue array is an error. */
else if (typecode != FUNCTION_TYPE && !flag
- && !lvalue_or_else (arg, lv_addressof))
+ && !lvalue_or_else (location, arg, lv_addressof))
return error_mark_node;
/* Move address operations inside C_MAYBE_CONST_EXPR to simplify
@@ -3905,15 +3906,16 @@ readonly_warning (tree arg, enum lvalue_use use)
/* Return nonzero if REF is an lvalue valid for this language;
otherwise, print an error message and return zero. USE says
- how the lvalue is being used and so selects the error message. */
+ how the lvalue is being used and so selects the error message.
+ LOCATION is the location at which any error should be reported. */
static int
-lvalue_or_else (const_tree ref, enum lvalue_use use)
+lvalue_or_else (location_t loc, const_tree ref, enum lvalue_use use)
{
int win = lvalue_p (ref);
if (!win)
- lvalue_error (use);
+ lvalue_error (loc, use);
return win;
}
@@ -4801,7 +4803,7 @@ build_modify_expr (location_t location, tree lhs, tree lhs_origtype,
return error_mark_node;
/* For ObjC properties, defer this check. */
- if (!objc_is_property_ref (lhs) && !lvalue_or_else (lhs, lv_assign))
+ if (!objc_is_property_ref (lhs) && !lvalue_or_else (location, lhs, lv_assign))
return error_mark_node;
if (TREE_CODE (rhs) == EXCESS_PRECISION_EXPR)
@@ -4851,7 +4853,7 @@ build_modify_expr (location_t location, tree lhs, tree lhs_origtype,
return result;
/* Else, do the check that we postponed for Objective-C. */
- if (!lvalue_or_else (lhs, lv_assign))
+ if (!lvalue_or_else (location, lhs, lv_assign))
return error_mark_node;
}
@@ -5272,10 +5274,10 @@ convert_for_assignment (location_t location, tree type, tree rhs,
{
tree ret;
bool save = in_late_binary_op;
- if (codel == BOOLEAN_TYPE)
+ if (codel == BOOLEAN_TYPE || codel == COMPLEX_TYPE)
in_late_binary_op = true;
ret = convert_and_check (type, orig_rhs);
- if (codel == BOOLEAN_TYPE)
+ if (codel == BOOLEAN_TYPE || codel == COMPLEX_TYPE)
in_late_binary_op = save;
return ret;
}
@@ -8479,7 +8481,7 @@ build_asm_expr (location_t loc, tree string, tree outputs, tree inputs,
get an error. Gross, but ... */
STRIP_NOPS (output);
- if (!lvalue_or_else (output, lv_asm))
+ if (!lvalue_or_else (loc, output, lv_asm))
output = error_mark_node;
if (output != error_mark_node
diff --git a/gcc/collect2.c b/gcc/collect2.c
index 77f794ff49c..42e35b607ff 100644
--- a/gcc/collect2.c
+++ b/gcc/collect2.c
@@ -1236,7 +1236,7 @@ main (int argc, char **argv)
#endif
}
vflag = debug;
- if (no_partition)
+ if (no_partition && lto_mode == LTO_MODE_WHOPR)
lto_mode = LTO_MODE_LTO;
}
diff --git a/gcc/config.gcc b/gcc/config.gcc
index 81eeb840e15..198016ecc47 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -1,6 +1,6 @@
# GCC target-specific configuration file.
# Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
-# 2008, 2009, 2010 Free Software Foundation, Inc.
+# 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
#This file is part of GCC.
@@ -653,6 +653,7 @@ case ${target} in
case ${enable_threads} in
yes) thread_file='rtems' ;;
esac
+ extra_options="${extra_options} rtems.opt"
use_gcc_stdint=wrap
;;
*-*-uclinux*)
@@ -1236,7 +1237,7 @@ i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu | i
need_64bit_hwint=yes
need_64bit_isa=yes
case X"${with_cpu}" in
- Xgeneric|Xatom|Xcore2|Xcorei7|Xcorei7-avx|Xnocona|Xx86-64|Xbdver1|Xamdfam10|Xbarcelona|Xk8|Xopteron|Xathlon64|Xathlon-fx|Xathlon64-sse3|Xk8-sse3|Xopteron-sse3)
+ Xgeneric|Xatom|Xcore2|Xcorei7|Xcorei7-avx|Xnocona|Xx86-64|Xbdver1|Xbtver1|Xamdfam10|Xbarcelona|Xk8|Xopteron|Xathlon64|Xathlon-fx|Xathlon64-sse3|Xk8-sse3|Xopteron-sse3)
;;
X)
if test x$with_cpu_64 = x; then
@@ -1245,7 +1246,7 @@ i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu | i
;;
*)
echo "Unsupported CPU used in --with-cpu=$with_cpu, supported values:" 1>&2
- echo "generic atom core2 corei7 corei7-avx nocona x86-64 bdver1 amdfam10 barcelona k8 opteron athlon64 athlon-fx athlon64-sse3 k8-sse3 opteron-sse3" 1>&2
+ echo "generic atom core2 corei7 corei7-avx nocona x86-64 bdver1 btver1 amdfam10 barcelona k8 opteron athlon64 athlon-fx athlon64-sse3 k8-sse3 opteron-sse3" 1>&2
exit 1
;;
esac
@@ -1374,7 +1375,7 @@ i[34567]86-*-solaris2*)
need_64bit_isa=yes
use_gcc_stdint=wrap
case X"${with_cpu}" in
- Xgeneric|Xatom|Xcore2|Xcorei7|Xcorei7-avx|Xnocona|Xx86-64|Xbdver1|Xamdfam10|Xbarcelona|Xk8|Xopteron|Xathlon64|Xathlon-fx|Xathlon64-sse3|Xk8-sse3|Xopteron-sse3)
+ Xgeneric|Xatom|Xcore2|Xcorei7|Xcorei7-avx|Xnocona|Xx86-64|Xbdver1|Xbtver1|Xamdfam10|Xbarcelona|Xk8|Xopteron|Xathlon64|Xathlon-fx|Xathlon64-sse3|Xk8-sse3|Xopteron-sse3)
;;
X)
if test x$with_cpu_64 = x; then
@@ -1383,7 +1384,7 @@ i[34567]86-*-solaris2*)
;;
*)
echo "Unsupported CPU used in --with-cpu=$with_cpu, supported values:" 1>&2
- echo "generic atom core2 corei7 corei7-avx nocona x86-64 bdver1 amdfam10 barcelona k8 opteron athlon64 athlon-fx athlon64-sse3 k8-sse3 opteron-sse3" 1>&2
+ echo "generic atom core2 corei7 corei7-avx nocona x86-64 bdver1 btver1 amdfam10 barcelona k8 opteron athlon64 athlon-fx athlon64-sse3 k8-sse3 opteron-sse3" 1>&2
exit 1
;;
esac
@@ -1454,7 +1455,7 @@ i[34567]86-*-mingw* | x86_64-*-mingw*)
if test x$enable_targets = xall; then
tm_defines="${tm_defines} TARGET_BI_ARCH=1"
case X"${with_cpu}" in
- Xgeneric|Xatom|Xcore2|Xcorei7|Xcorei7-avx|Xnocona|Xx86-64|Xbdver1|Xamdfam10|Xbarcelona|Xk8|Xopteron|Xathlon64|Xathlon-fx|Xathlon64-sse3|Xk8-sse3|Xopteron-sse3)
+ Xgeneric|Xatom|Xcore2|Xcorei7|Xcorei7-avx|Xnocona|Xx86-64|Xbdver1|Xbtver1|Xamdfam10|Xbarcelona|Xk8|Xopteron|Xathlon64|Xathlon-fx|Xathlon64-sse3|Xk8-sse3|Xopteron-sse3)
;;
X)
if test x$with_cpu_64 = x; then
@@ -1463,7 +1464,7 @@ i[34567]86-*-mingw* | x86_64-*-mingw*)
;;
*)
echo "Unsupported CPU used in --with-cpu=$with_cpu, supported values:" 1>&2
- echo "generic atom core2 corei7 Xcorei7-avx nocona x86-64 bdver1 amdfam10 barcelona k8 opteron athlon64 athlon-fx athlon64-sse3 k8-sse3 opteron-sse3" 1>&2
+ echo "generic atom core2 corei7 Xcorei7-avx nocona x86-64 bdver1 btver1 amdfam10 barcelona k8 opteron athlon64 athlon-fx athlon64-sse3 k8-sse3 opteron-sse3" 1>&2
exit 1
;;
esac
@@ -2797,6 +2798,10 @@ case ${target} in
arch=bdver1
cpu=bdver1
;;
+ btver1-*)
+ arch=btver1
+ cpu=btver1
+ ;;
amdfam10-*|barcelona-*)
arch=amdfam10
cpu=amdfam10
@@ -2886,6 +2891,10 @@ case ${target} in
arch=bdver1
cpu=bdver1
;;
+ btver1-*)
+ arch=btver1
+ cpu=btver1
+ ;;
amdfam10-*|barcelona-*)
arch=amdfam10
cpu=amdfam10
@@ -3302,7 +3311,7 @@ case "${target}" in
;;
"" | x86-64 | generic | native \
| k8 | k8-sse3 | athlon64 | athlon64-sse3 | opteron \
- | opteron-sse3 | athlon-fx | bdver1 | amdfam10 \
+ | opteron-sse3 | athlon-fx | bdver1 | btver1 | amdfam10 \
| barcelona | nocona | core2 | corei7 | corei7-avx | atom)
# OK
;;
diff --git a/gcc/config/i386/driver-i386.c b/gcc/config/i386/driver-i386.c
index 618f875fda5..35962c802fe 100644
--- a/gcc/config/i386/driver-i386.c
+++ b/gcc/config/i386/driver-i386.c
@@ -500,6 +500,8 @@ const char *host_detect_local_cpu (int argc, const char **argv)
processor = PROCESSOR_GEODE;
else if (has_xop)
processor = PROCESSOR_BDVER1;
+ else if (has_sse4a && has_ssse3)
+ processor = PROCESSOR_BTVER1;
else if (has_sse4a)
processor = PROCESSOR_AMDFAM10;
else if (has_sse2 || has_longmode)
@@ -647,6 +649,9 @@ const char *host_detect_local_cpu (int argc, const char **argv)
case PROCESSOR_BDVER1:
cpu = "bdver1";
break;
+ case PROCESSOR_BTVER1:
+ cpu = "btver1";
+ break;
default:
/* Use something reasonable. */
diff --git a/gcc/config/i386/i386-c.c b/gcc/config/i386/i386-c.c
index 6adf6136791..14973513334 100644
--- a/gcc/config/i386/i386-c.c
+++ b/gcc/config/i386/i386-c.c
@@ -110,6 +110,10 @@ ix86_target_macros_internal (int isa_flag,
def_or_undef (parse_in, "__bdver1");
def_or_undef (parse_in, "__bdver1__");
break;
+ case PROCESSOR_BTVER1:
+ def_or_undef (parse_in, "__btver1");
+ def_or_undef (parse_in, "__btver1__");
+ break;
case PROCESSOR_PENTIUM4:
def_or_undef (parse_in, "__pentium4");
def_or_undef (parse_in, "__pentium4__");
@@ -194,6 +198,9 @@ ix86_target_macros_internal (int isa_flag,
case PROCESSOR_BDVER1:
def_or_undef (parse_in, "__tune_bdver1__");
break;
+ case PROCESSOR_BTVER1:
+ def_or_undef (parse_in, "__tune_btver1__");
+ break;
case PROCESSOR_PENTIUM4:
def_or_undef (parse_in, "__tune_pentium4__");
break;
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 50dac35b874..cf12881abf9 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -1231,6 +1231,88 @@ struct processor_costs bdver1_cost = {
1, /* cond_not_taken_branch_cost. */
};
+struct processor_costs btver1_cost = {
+ COSTS_N_INSNS (1), /* cost of an add instruction */
+ COSTS_N_INSNS (2), /* cost of a lea instruction */
+ COSTS_N_INSNS (1), /* variable shift costs */
+ COSTS_N_INSNS (1), /* constant shift costs */
+ {COSTS_N_INSNS (3), /* cost of starting multiply for QI */
+ COSTS_N_INSNS (4), /* HI */
+ COSTS_N_INSNS (3), /* SI */
+ COSTS_N_INSNS (4), /* DI */
+ COSTS_N_INSNS (5)}, /* other */
+ 0, /* cost of multiply per each bit set */
+ {COSTS_N_INSNS (19), /* cost of a divide/mod for QI */
+ COSTS_N_INSNS (35), /* HI */
+ COSTS_N_INSNS (51), /* SI */
+ COSTS_N_INSNS (83), /* DI */
+ COSTS_N_INSNS (83)}, /* other */
+ COSTS_N_INSNS (1), /* cost of movsx */
+ COSTS_N_INSNS (1), /* cost of movzx */
+ 8, /* "large" insn */
+ 9, /* MOVE_RATIO */
+ 4, /* cost for loading QImode using movzbl */
+ {3, 4, 3}, /* cost of loading integer registers
+ in QImode, HImode and SImode.
+ Relative to reg-reg move (2). */
+ {3, 4, 3}, /* cost of storing integer registers */
+ 4, /* cost of reg,reg fld/fst */
+ {4, 4, 12}, /* cost of loading fp registers
+ in SFmode, DFmode and XFmode */
+ {6, 6, 8}, /* cost of storing fp registers
+ in SFmode, DFmode and XFmode */
+ 2, /* cost of moving MMX register */
+ {3, 3}, /* cost of loading MMX registers
+ in SImode and DImode */
+ {4, 4}, /* cost of storing MMX registers
+ in SImode and DImode */
+ 2, /* cost of moving SSE register */
+ {4, 4, 3}, /* cost of loading SSE registers
+ in SImode, DImode and TImode */
+ {4, 4, 5}, /* cost of storing SSE registers
+ in SImode, DImode and TImode */
+ 3, /* MMX or SSE register to integer */
+ /* On K8:
+ MOVD reg64, xmmreg Double FSTORE 4
+ MOVD reg32, xmmreg Double FSTORE 4
+ On AMDFAM10:
+ MOVD reg64, xmmreg Double FADD 3
+ 1/1 1/1
+ MOVD reg32, xmmreg Double FADD 3
+ 1/1 1/1 */
+ 32, /* size of l1 cache. */
+ 512, /* size of l2 cache. */
+ 64, /* size of prefetch block */
+ 100, /* number of parallel prefetches */
+ 2, /* Branch cost */
+ COSTS_N_INSNS (4), /* cost of FADD and FSUB insns. */
+ COSTS_N_INSNS (4), /* cost of FMUL instruction. */
+ COSTS_N_INSNS (19), /* cost of FDIV instruction. */
+ COSTS_N_INSNS (2), /* cost of FABS instruction. */
+ COSTS_N_INSNS (2), /* cost of FCHS instruction. */
+ COSTS_N_INSNS (35), /* cost of FSQRT instruction. */
+
+ /* BTVER1 has optimized REP instruction for medium sized blocks, but for
+ very small blocks it is better to use loop. For large blocks, libcall can
+ do nontemporary accesses and beat inline considerably. */
+ {{libcall, {{6, loop}, {14, unrolled_loop}, {-1, rep_prefix_4_byte}}},
+ {libcall, {{16, loop}, {8192, rep_prefix_8_byte}, {-1, libcall}}}},
+ {{libcall, {{8, loop}, {24, unrolled_loop},
+ {2048, rep_prefix_4_byte}, {-1, libcall}}},
+ {libcall, {{48, unrolled_loop}, {8192, rep_prefix_8_byte}, {-1, libcall}}}},
+ 4, /* scalar_stmt_cost. */
+ 2, /* scalar load_cost. */
+ 2, /* scalar_store_cost. */
+ 6, /* vec_stmt_cost. */
+ 0, /* vec_to_scalar_cost. */
+ 2, /* scalar_to_vec_cost. */
+ 2, /* vec_align_load_cost. */
+ 2, /* vec_unalign_load_cost. */
+ 2, /* vec_store_cost. */
+ 2, /* cond_taken_branch_cost. */
+ 1, /* cond_not_taken_branch_cost. */
+};
+
static const
struct processor_costs pentium4_cost = {
COSTS_N_INSNS (1), /* cost of an add instruction */
@@ -1624,7 +1706,8 @@ const struct processor_costs *ix86_cost = &pentium_cost;
#define m_ATHLON_K8 (m_K8 | m_ATHLON)
#define m_AMDFAM10 (1<<PROCESSOR_AMDFAM10)
#define m_BDVER1 (1<<PROCESSOR_BDVER1)
-#define m_AMD_MULTIPLE (m_K8 | m_ATHLON | m_AMDFAM10 | m_BDVER1)
+#define m_BTVER1 (1<<PROCESSOR_BTVER1)
+#define m_AMD_MULTIPLE (m_K8 | m_ATHLON | m_AMDFAM10 | m_BDVER1 | m_BTVER1)
#define m_GENERIC32 (1<<PROCESSOR_GENERIC32)
#define m_GENERIC64 (1<<PROCESSOR_GENERIC64)
@@ -1670,8 +1753,8 @@ static unsigned int initial_ix86_tune_features[X86_TUNE_LAST] = {
~m_386,
/* X86_TUNE_USE_SAHF */
- m_ATOM | m_PPRO | m_K6_GEODE | m_K8 | m_AMDFAM10 | m_BDVER1 | m_PENT4
- | m_NOCONA | m_CORE2I7 | m_GENERIC,
+ m_ATOM | m_PPRO | m_K6_GEODE | m_K8 | m_AMDFAM10 | m_BDVER1 | m_BTVER1
+ | m_PENT4 | m_NOCONA | m_CORE2I7 | m_GENERIC,
/* X86_TUNE_MOVX: Enable to zero extend integer registers to avoid
partial dependencies. */
@@ -1777,7 +1860,7 @@ static unsigned int initial_ix86_tune_features[X86_TUNE_LAST] = {
| m_AMDFAM10 | m_BDVER1,
/* X86_TUNE_SSE_UNALIGNED_LOAD_OPTIMAL */
- m_AMDFAM10 | m_BDVER1 | m_COREI7,
+ m_AMDFAM10 | m_BDVER1 | m_BTVER1 | m_COREI7,
/* X86_TUNE_SSE_UNALIGNED_STORE_OPTIMAL */
m_BDVER1 | m_COREI7,
@@ -1855,11 +1938,11 @@ static unsigned int initial_ix86_tune_features[X86_TUNE_LAST] = {
/* X86_TUNE_SLOW_IMUL_IMM32_MEM: Imul of 32-bit constant and memory is
vector path on AMD machines. */
- m_K8 | m_CORE2I7_64 | m_GENERIC64 | m_AMDFAM10 | m_BDVER1,
+ m_K8 | m_CORE2I7_64 | m_GENERIC64 | m_AMDFAM10 | m_BDVER1 | m_BTVER1,
/* X86_TUNE_SLOW_IMUL_IMM8: Imul of 8-bit constant is vector path on AMD
machines. */
- m_K8 | m_CORE2I7_64 | m_GENERIC64 | m_AMDFAM10 | m_BDVER1,
+ m_K8 | m_CORE2I7_64 | m_GENERIC64 | m_AMDFAM10 | m_BDVER1 | m_BTVER1,
/* X86_TUNE_MOVE_M1_VIA_OR: On pentiums, it is faster to load -1 via OR
than a MOV. */
@@ -2451,6 +2534,7 @@ static const struct ptt processor_target_table[PROCESSOR_max] =
{&generic64_cost, 16, 10, 16, 10, 16},
{&amdfam10_cost, 32, 24, 32, 7, 32},
{&bdver1_cost, 32, 24, 32, 7, 32},
+ {&btver1_cost, 32, 24, 32, 7, 32},
{&atom_cost, 16, 7, 16, 7, 16}
};
@@ -2479,7 +2563,8 @@ static const char *const cpu_names[TARGET_CPU_DEFAULT_max] =
"athlon-4",
"k8",
"amdfam10",
- "bdver1"
+ "bdver1",
+ "btver1"
};
/* Return true if a red-zone is in use. */
@@ -3075,6 +3160,7 @@ software_prefetching_beneficial_p (void)
case PROCESSOR_ATHLON:
case PROCESSOR_K8:
case PROCESSOR_AMDFAM10:
+ case PROCESSOR_BTVER1:
return true;
default:
@@ -3256,10 +3342,13 @@ ix86_option_override_internal (bool main_args_p)
PTA_64BIT | PTA_MMX | PTA_3DNOW | PTA_3DNOW_A | PTA_SSE
| PTA_SSE2 | PTA_SSE3 | PTA_SSE4A | PTA_CX16 | PTA_ABM},
{"bdver1", PROCESSOR_BDVER1, CPU_BDVER1,
- PTA_64BIT | PTA_MMX | PTA_3DNOW | PTA_3DNOW_A | PTA_SSE
- | PTA_SSE2 | PTA_SSE3 | PTA_SSE4A | PTA_CX16 | PTA_ABM
- | PTA_SSSE3 | PTA_SSE4_1 | PTA_SSE4_2 | PTA_AES
- | PTA_PCLMUL | PTA_AVX | PTA_FMA4 | PTA_XOP | PTA_LWP},
+ PTA_64BIT | PTA_MMX | PTA_SSE | PTA_SSE2 | PTA_SSE3
+ | PTA_SSE4A | PTA_CX16 | PTA_ABM | PTA_SSSE3 | PTA_SSE4_1
+ | PTA_SSE4_2 | PTA_AES | PTA_PCLMUL | PTA_AVX | PTA_FMA4
+ | PTA_XOP | PTA_LWP},
+ {"btver1", PROCESSOR_BTVER1, CPU_GENERIC64,
+ PTA_64BIT | PTA_MMX | PTA_SSE | PTA_SSE2 | PTA_SSE3
+ | PTA_SSSE3 | PTA_SSE4A |PTA_ABM | PTA_CX16},
{"generic32", PROCESSOR_GENERIC32, CPU_PENTIUMPRO,
0 /* flags are only used for -march switch. */ },
{"generic64", PROCESSOR_GENERIC64, CPU_GENERIC64,
@@ -12505,6 +12594,17 @@ legitimize_tls_address (rtx x, enum tls_model model, int for_mov)
case TLS_MODEL_INITIAL_EXEC:
if (TARGET_64BIT)
{
+ if (TARGET_SUN_TLS)
+ {
+ /* The Sun linker took the AMD64 TLS spec literally
+ and can only handle %rax as destination of the
+ initial executable code sequence. */
+
+ dest = gen_reg_rtx (Pmode);
+ emit_insn (gen_tls_initial_exec_64_sun (dest, x));
+ return dest;
+ }
+
pic = NULL;
type = UNSPEC_GOTNTPOFF;
}
@@ -22166,6 +22266,7 @@ ix86_issue_rate (void)
case PROCESSOR_GENERIC32:
case PROCESSOR_GENERIC64:
case PROCESSOR_BDVER1:
+ case PROCESSOR_BTVER1:
return 3;
default:
@@ -22353,6 +22454,7 @@ ix86_adjust_cost (rtx insn, rtx link, rtx dep_insn, int cost)
case PROCESSOR_K8:
case PROCESSOR_AMDFAM10:
case PROCESSOR_BDVER1:
+ case PROCESSOR_BTVER1:
case PROCESSOR_ATOM:
case PROCESSOR_GENERIC32:
case PROCESSOR_GENERIC64:
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index 510506aa8db..0a948cc06aa 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -251,6 +251,7 @@ extern const struct processor_costs ix86_size_cost;
#define TARGET_GENERIC (TARGET_GENERIC32 || TARGET_GENERIC64)
#define TARGET_AMDFAM10 (ix86_tune == PROCESSOR_AMDFAM10)
#define TARGET_BDVER1 (ix86_tune == PROCESSOR_BDVER1)
+#define TARGET_BTVER1 (ix86_tune == PROCESSOR_BTVER1)
#define TARGET_ATOM (ix86_tune == PROCESSOR_ATOM)
/* Feature tests against the various tunings. */
@@ -600,6 +601,7 @@ enum target_cpu_default
TARGET_CPU_DEFAULT_k8,
TARGET_CPU_DEFAULT_amdfam10,
TARGET_CPU_DEFAULT_bdver1,
+ TARGET_CPU_DEFAULT_btver1,
TARGET_CPU_DEFAULT_max
};
@@ -2060,6 +2062,7 @@ enum processor_type
PROCESSOR_GENERIC64,
PROCESSOR_AMDFAM10,
PROCESSOR_BDVER1,
+ PROCESSOR_BTVER1,
PROCESSOR_ATOM,
PROCESSOR_max
};
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 05937e678df..1f14f5ce4d7 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -93,6 +93,7 @@
UNSPEC_TLS_GD
UNSPEC_TLS_LD_BASE
UNSPEC_TLSDESC
+ UNSPEC_TLS_IE_SUN
;; Other random patterns
UNSPEC_SCAS
@@ -359,7 +360,7 @@
;; Processor type.
(define_attr "cpu" "none,pentium,pentiumpro,geode,k6,athlon,k8,core2,corei7,
- atom,generic64,amdfam10,bdver1"
+ atom,generic64,amdfam10,bdver1,btver1"
(const (symbol_ref "ix86_schedule")))
;; A basic instruction type. Refinements due to arguments to be
@@ -12688,6 +12689,18 @@
(set_attr "memory" "load")
(set_attr "imm_disp" "false")])
+;; The Sun linker took the AMD64 TLS spec literally and can only handle
+;; %rax as destination of the initial executable code sequence.
+(define_insn "tls_initial_exec_64_sun"
+ [(set (match_operand:DI 0 "register_operand" "=a")
+ (unspec:DI
+ [(match_operand:DI 1 "tls_symbolic_operand" "")]
+ UNSPEC_TLS_IE_SUN))
+ (clobber (reg:CC FLAGS_REG))]
+ "TARGET_64BIT && TARGET_SUN_TLS"
+ "mov{q}\t{%%fs:0, %0|%0, QWORD PTR fs:0}\n\tadd{q}\t{%a1@gottpoff(%%rip), %0|%0, %a1@gottpoff[rip]}"
+ [(set_attr "type" "multi")])
+
;; GNU2 TLS patterns can be split.
(define_expand "tls_dynamic_gnu2_32"
diff --git a/gcc/config/i386/sol2-10.h b/gcc/config/i386/sol2-10.h
index 8f597753376..e8f9dbaab2e 100644
--- a/gcc/config/i386/sol2-10.h
+++ b/gcc/config/i386/sol2-10.h
@@ -58,8 +58,7 @@ along with GCC; see the file COPYING3. If not see
{ \
if (TARGET_SUN_TLS \
&& in_section \
- && ((in_section->common.flags & (SECTION_TLS | SECTION_BSS)) \
- == (SECTION_TLS | SECTION_BSS))) \
+ && ((in_section->common.flags & SECTION_TLS) == SECTION_TLS)) \
switch_to_section (bss_section); \
x86_elf_aligned_common (FILE, NAME, SIZE, ALIGN); \
} \
diff --git a/gcc/config/linux-android.opt b/gcc/config/linux-android.opt
index ad659caf0d1..d075bef1fe7 100644
--- a/gcc/config/linux-android.opt
+++ b/gcc/config/linux-android.opt
@@ -1,6 +1,6 @@
; Android specific options.
-; Copyright (C) 2008, 2010 Free Software Foundation, Inc.
+; Copyright (C) 2008, 2010, 2011 Free Software Foundation, Inc.
;
; This file is part of GCC.
;
@@ -21,3 +21,10 @@
mandroid
Target Report Mask(ANDROID) Var(flag_android) Init(ANDROID_DEFAULT ? OPTION_MASK_ANDROID : 0)
Generate code for the Android platform.
+
+tno-android-cc
+Driver
+
+tno-android-ld
+Driver
+
diff --git a/gcc/config/rtems.opt b/gcc/config/rtems.opt
new file mode 100644
index 00000000000..053ab8f096d
--- /dev/null
+++ b/gcc/config/rtems.opt
@@ -0,0 +1,33 @@
+; RTEMS options.
+
+; Copyright (C) 2010, 2011
+; Free Software Foundation, Inc.
+;
+; This file is part of GCC.
+;
+; GCC is free software; you can redistribute it and/or modify it under
+; the terms of the GNU General Public License as published by the Free
+; Software Foundation; either version 3, or (at your option) any later
+; version.
+;
+; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+; WARRANTY; without even the implied warranty of MERCHANTABILITY or
+; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+; for more details.
+;
+; You should have received a copy of the GNU General Public License
+; along with GCC; see the file COPYING3. If not see
+; <http://www.gnu.org/licenses/>.
+
+; See the GCC internals manual (options.texi) for a description of
+; this file's format.
+
+; Please try to keep this file in ASCII collating order.
+
+qnolinkcmds
+Driver
+
+qrtems
+Driver
+
+; This comment is to ensure we retain the blank line above.
diff --git a/gcc/config/sol2.h b/gcc/config/sol2.h
index 75f4675242b..aace5247609 100644
--- a/gcc/config/sol2.h
+++ b/gcc/config/sol2.h
@@ -277,7 +277,7 @@ __enable_execute_stack (void *addr) \
} \
while (0)
-/* Solaris 'as' has a bug: a .common directive in .tbss section
+/* Solaris 'as' has a bug: a .common directive in .tbss or .tdata section
behaves as .tls_common rather than normal non-TLS .common. */
#undef ASM_OUTPUT_ALIGNED_COMMON
#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \
@@ -285,8 +285,7 @@ __enable_execute_stack (void *addr) \
{ \
if (TARGET_SUN_TLS \
&& in_section \
- && ((in_section->common.flags & (SECTION_TLS | SECTION_BSS)) \
- == (SECTION_TLS | SECTION_BSS))) \
+ && ((in_section->common.flags & SECTION_TLS) == SECTION_TLS)) \
switch_to_section (bss_section); \
fprintf ((FILE), "%s", COMMON_ASM_OP); \
assemble_name ((FILE), (NAME)); \
diff --git a/gcc/config/sol2.opt b/gcc/config/sol2.opt
index 2da2ab5774c..c1a78cb028d 100644
--- a/gcc/config/sol2.opt
+++ b/gcc/config/sol2.opt
@@ -1,6 +1,6 @@
; Options for the Solaris 2 port of the compiler
;
-; Copyright (C) 2010 Free Software Foundation, Inc.
+; Copyright (C) 2010, 2011 Free Software Foundation, Inc.
;
; This file is part of GCC.
;
@@ -18,6 +18,30 @@
; along with GCC; see the file COPYING3. If not see
; <http://www.gnu.org/licenses/>.
+G
+Driver
+
+YP,
+Driver Joined
+
+Ym,
+Driver Joined
+
+compat-bsd
+Driver
+
mimpure-text
Target Report
Pass -z text to linker
+
+pthread
+Driver
+
+pthreads
+Driver
+
+rdynamic
+Driver
+
+threads
+Driver
diff --git a/gcc/config/spu/spu.c b/gcc/config/spu/spu.c
index 915de556ca0..e141a154691 100644
--- a/gcc/config/spu/spu.c
+++ b/gcc/config/spu/spu.c
@@ -516,7 +516,7 @@ spu_option_override (void)
/* Small loops will be unpeeled at -O3. For SPU it is more important
to keep code small by default. */
if (!flag_unroll_loops && !flag_peel_loops)
- maybe_set_param_value (PARAM_MAX_COMPLETELY_PEEL_TIMES, 1,
+ maybe_set_param_value (PARAM_MAX_COMPLETELY_PEEL_TIMES, 4,
global_options.x_param_values,
global_options_set.x_param_values);
@@ -2086,6 +2086,8 @@ spu_expand_prologue (void)
}
}
+ if (flag_stack_usage)
+ current_function_static_stack_size = total_size;
}
void
@@ -2264,6 +2266,7 @@ emit_nop_for_insn (rtx insn)
else
new_insn = emit_insn_after (gen_lnop (), insn);
recog_memoized (new_insn);
+ INSN_LOCATOR (new_insn) = INSN_LOCATOR (insn);
}
/* Insert nops in basic blocks to meet dual issue alignment
@@ -2302,6 +2305,7 @@ pad_bb(void)
prev_insn = emit_insn_before (gen_lnop (), insn);
PUT_MODE (prev_insn, GET_MODE (insn));
PUT_MODE (insn, TImode);
+ INSN_LOCATOR (prev_insn) = INSN_LOCATOR (insn);
length += 4;
}
}
@@ -2370,6 +2374,7 @@ spu_emit_branch_hint (rtx before, rtx branch, rtx target,
hint = emit_insn_before (gen_hbr (branch_label, target), before);
recog_memoized (hint);
+ INSN_LOCATOR (hint) = INSN_LOCATOR (branch);
HINTED_P (branch) = 1;
if (GET_CODE (target) == LABEL_REF)
@@ -2390,7 +2395,9 @@ spu_emit_branch_hint (rtx before, rtx branch, rtx target,
{
/* Make sure the hint isn't scheduled any earlier than this point,
which could make it too far for the branch offest to fit */
- recog_memoized (emit_insn_before (gen_blockage (), hint));
+ insn = emit_insn_before (gen_blockage (), hint);
+ recog_memoized (insn);
+ INSN_LOCATOR (insn) = INSN_LOCATOR (hint);
}
else if (distance <= 8 * 4)
{
@@ -2402,14 +2409,21 @@ spu_emit_branch_hint (rtx before, rtx branch, rtx target,
insn =
emit_insn_after (gen_nopn_nv (gen_rtx_REG (SImode, 127)), hint);
recog_memoized (insn);
+ INSN_LOCATOR (insn) = INSN_LOCATOR (hint);
}
/* Make sure any nops inserted aren't scheduled before the hint. */
- recog_memoized (emit_insn_after (gen_blockage (), hint));
+ insn = emit_insn_after (gen_blockage (), hint);
+ recog_memoized (insn);
+ INSN_LOCATOR (insn) = INSN_LOCATOR (hint);
/* Make sure any nops inserted aren't scheduled after the call. */
if (CALL_P (branch) && distance < 8 * 4)
- recog_memoized (emit_insn_before (gen_blockage (), branch));
+ {
+ insn = emit_insn_before (gen_blockage (), branch);
+ recog_memoized (insn);
+ INSN_LOCATOR (insn) = INSN_LOCATOR (branch);
+ }
}
}
@@ -2594,6 +2608,7 @@ insert_hbrp_for_ilb_runout (rtx first)
insn =
emit_insn_before (gen_iprefetch (GEN_INT (1)), before_4);
recog_memoized (insn);
+ INSN_LOCATOR (insn) = INSN_LOCATOR (before_4);
INSN_ADDRESSES_NEW (insn,
INSN_ADDRESSES (INSN_UID (before_4)));
PUT_MODE (insn, GET_MODE (before_4));
@@ -2602,6 +2617,7 @@ insert_hbrp_for_ilb_runout (rtx first)
{
insn = emit_insn_before (gen_lnop (), before_4);
recog_memoized (insn);
+ INSN_LOCATOR (insn) = INSN_LOCATOR (before_4);
INSN_ADDRESSES_NEW (insn,
INSN_ADDRESSES (INSN_UID (before_4)));
PUT_MODE (insn, TImode);
@@ -2613,6 +2629,7 @@ insert_hbrp_for_ilb_runout (rtx first)
insn =
emit_insn_before (gen_iprefetch (GEN_INT (2)), before_16);
recog_memoized (insn);
+ INSN_LOCATOR (insn) = INSN_LOCATOR (before_16);
INSN_ADDRESSES_NEW (insn,
INSN_ADDRESSES (INSN_UID (before_16)));
PUT_MODE (insn, GET_MODE (before_16));
@@ -2621,6 +2638,7 @@ insert_hbrp_for_ilb_runout (rtx first)
{
insn = emit_insn_before (gen_lnop (), before_16);
recog_memoized (insn);
+ INSN_LOCATOR (insn) = INSN_LOCATOR (before_16);
INSN_ADDRESSES_NEW (insn,
INSN_ADDRESSES (INSN_UID
(before_16)));
@@ -2863,6 +2881,7 @@ spu_machine_dependent_reorg (void)
/* The hints need to be scheduled, so call it again. */
schedule_insns ();
+ df_finish_pass (true);
insert_hbrp ();
diff --git a/gcc/configure b/gcc/configure
index f90e258e32f..1ae7a64a195 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -25207,6 +25207,7 @@ $as_echo "$gcc_cv_as_gnu_unique_object" >&6; }
if test $gcc_cv_as_gnu_unique_object = yes; then
# Also check for ld.so support, i.e. glibc 2.11 or higher.
if test x$host = x$build -a x$host = x$target &&
+ ldd --version 2>/dev/null &&
glibcver=`ldd --version 2>/dev/null | sed 's/.* //;q'`; then
glibcmajor=`expr "$glibcver" : "\([0-9]*\)"`
glibcminor=`expr "$glibcver" : "[2-9]*\.\([0-9]*\)"`
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 2b26fc98e31..1f5a98f6a89 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -2,7 +2,7 @@
# Process this file with autoconf to generate a configuration script.
# Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
-# 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
#This file is part of GCC.
@@ -3885,6 +3885,7 @@ Valid choices are 'yes' and 'no'.]) ;;
[.type foo, @gnu_unique_object],,
# Also check for ld.so support, i.e. glibc 2.11 or higher.
[[if test x$host = x$build -a x$host = x$target &&
+ ldd --version 2>/dev/null &&
glibcver=`ldd --version 2>/dev/null | sed 's/.* //;q'`; then
glibcmajor=`expr "$glibcver" : "\([0-9]*\)"`
glibcminor=`expr "$glibcver" : "[2-9]*\.\([0-9]*\)"`
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 854fff30620..67411a5fe09 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2011-01-05 Tom Tromey <tromey@redhat.com>
+
+ * typeck.c (cp_build_addr_expr_1): Update call to lvalue_error.
+ (lvalue_or_else): Likewise.
+
2011-01-01 Kai Tietz <kai.tietz@onevision.com>
PR target/38662
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index 64ca9bd79f5..c062f0fa5e4 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -1,6 +1,6 @@
/* Build expressions with type checking for C++ compiler.
Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
Hacked by Michael Tiemann (tiemann@cygnus.com)
@@ -4756,7 +4756,7 @@ cp_build_addr_expr_1 (tree arg, bool strict_lvalue, tsubst_flags_t complain)
if (kind == clk_none)
{
if (complain & tf_error)
- lvalue_error (lv_addressof);
+ lvalue_error (input_location, lv_addressof);
return error_mark_node;
}
if (strict_lvalue && (kind & (clk_rvalueref|clk_class)))
@@ -8219,7 +8219,7 @@ lvalue_or_else (tree ref, enum lvalue_use use, tsubst_flags_t complain)
if (kind == clk_none)
{
if (complain & tf_error)
- lvalue_error (use);
+ lvalue_error (input_location, use);
return 0;
}
else if (kind & (clk_rvalueref|clk_class))
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index ff5c7925491..81bfa4a50ef 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -1361,16 +1361,17 @@ Display the version number and copyrights of the invoked GCC@.
@item -wrapper
@opindex wrapper
-Invoke all subcommands under a wrapper program. It takes a single
-comma separated list as an argument, which will be used to invoke
-the wrapper:
+Invoke all subcommands under a wrapper program. The name of the
+wrapper program and its parameters are passed as a comma separated
+list.
@smallexample
gcc -c t.c -wrapper gdb,--args
@end smallexample
-This will invoke all subprograms of gcc under "gdb --args",
-thus cc1 invocation will be "gdb --args cc1 ...".
+This will invoke all subprograms of @command{gcc} under
+@samp{gdb --args}, thus the invocation of @command{cc1} will be
+@samp{gdb --args cc1 @dots{}}.
@item -fplugin=@var{name}.so
Load the plugin code in file @var{name}.so, assumed to be a
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 22ee3240a36..3fb01a86dec 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -23324,7 +23324,7 @@ dwarf2out_finish (const char *filename)
/* Output the address range information. We only put functions in the arange
table, so don't write it out if we don't have any. */
- if (fde_table_in_use)
+ if (arange_table_in_use)
{
switch_to_section (debug_aranges_section);
output_aranges ();
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 5be47c6d808..3181e5e1a35 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,23 @@
+2011-01-06 Daniel Franke <franke.daniel@gmail.com>
+
+ PR fortran/33117
+ PR fortran/46478
+ * parse.c (parse_interface): Remove check for procedure types.
+ * interface.c (check_interface0): Verify that procedures are
+ either all SUBROUTINEs or all FUNCTIONs.
+
+2011-01-05 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/47180
+ * trans-expr.c (gfc_trans_class_assign): Bugfix for r168524 (make sure
+ 'vtab' is initialized).
+
+2011-01-05 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/47180
+ * trans-expr.c (gfc_trans_class_assign): For a polymorphic NULL pointer
+ assignment, set the _vptr component to the declared type.
+
2011-01-05 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/46017
diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c
index cf83557be55..1febb5d8587 100644
--- a/gcc/fortran/interface.c
+++ b/gcc/fortran/interface.c
@@ -1092,8 +1092,9 @@ gfc_compare_interfaces (gfc_symbol *s1, gfc_symbol *s2, const char *name2,
/* Given a pointer to an interface pointer, remove duplicate
- interfaces and make sure that all symbols are either functions or
- subroutines. Returns nonzero if something goes wrong. */
+ interfaces and make sure that all symbols are either functions
+ or subroutines, and all of the same kind. Returns nonzero if
+ something goes wrong. */
static int
check_interface0 (gfc_interface *p, const char *interface_name)
@@ -1101,21 +1102,32 @@ check_interface0 (gfc_interface *p, const char *interface_name)
gfc_interface *psave, *q, *qlast;
psave = p;
- /* Make sure all symbols in the interface have been defined as
- functions or subroutines. */
for (; p; p = p->next)
- if ((!p->sym->attr.function && !p->sym->attr.subroutine)
- || !p->sym->attr.if_source)
- {
- if (p->sym->attr.external)
- gfc_error ("Procedure '%s' in %s at %L has no explicit interface",
- p->sym->name, interface_name, &p->sym->declared_at);
- else
- gfc_error ("Procedure '%s' in %s at %L is neither function nor "
- "subroutine", p->sym->name, interface_name,
- &p->sym->declared_at);
- return 1;
- }
+ {
+ /* Make sure all symbols in the interface have been defined as
+ functions or subroutines. */
+ if ((!p->sym->attr.function && !p->sym->attr.subroutine)
+ || !p->sym->attr.if_source)
+ {
+ if (p->sym->attr.external)
+ gfc_error ("Procedure '%s' in %s at %L has no explicit interface",
+ p->sym->name, interface_name, &p->sym->declared_at);
+ else
+ gfc_error ("Procedure '%s' in %s at %L is neither function nor "
+ "subroutine", p->sym->name, interface_name,
+ &p->sym->declared_at);
+ return 1;
+ }
+
+ /* Verify that procedures are either all SUBROUTINEs or all FUNCTIONs. */
+ if ((psave->sym->attr.function && !p->sym->attr.function)
+ || (psave->sym->attr.subroutine && !p->sym->attr.subroutine))
+ {
+ gfc_error ("In %s at %L procedures must be either all SUBROUTINEs"
+ " or all FUNCTIONs", interface_name, &p->sym->declared_at);
+ return 1;
+ }
+ }
p = psave;
/* Remove duplicate interfaces in this interface list. */
diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c
index ea9667d4a6b..58d8b43065e 100644
--- a/gcc/fortran/parse.c
+++ b/gcc/fortran/parse.c
@@ -2263,32 +2263,16 @@ loop:
}
- /* Make sure that a generic interface has only subroutines or
- functions and that the generic name has the right attribute. */
- if (current_interface.type == INTERFACE_GENERIC)
+ /* Make sure that the generic name has the right attribute. */
+ if (current_interface.type == INTERFACE_GENERIC
+ && current_state == COMP_NONE)
{
- if (current_state == COMP_NONE)
- {
- if (new_state == COMP_FUNCTION && sym)
- gfc_add_function (&sym->attr, sym->name, NULL);
- else if (new_state == COMP_SUBROUTINE && sym)
- gfc_add_subroutine (&sym->attr, sym->name, NULL);
-
- current_state = new_state;
- }
- else
- {
- if (new_state != current_state)
- {
- if (new_state == COMP_SUBROUTINE)
- gfc_error ("SUBROUTINE at %C does not belong in a "
- "generic function interface");
+ if (new_state == COMP_FUNCTION && sym)
+ gfc_add_function (&sym->attr, sym->name, NULL);
+ else if (new_state == COMP_SUBROUTINE && sym)
+ gfc_add_subroutine (&sym->attr, sym->name, NULL);
- if (new_state == COMP_FUNCTION)
- gfc_error ("FUNCTION at %C does not belong in a "
- "generic subroutine interface");
- }
- }
+ current_state = new_state;
}
if (current_interface.type == INTERFACE_ABSTRACT)
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index 3e994aa82c0..68eb1aaa5ef 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -6121,24 +6121,23 @@ gfc_trans_class_assign (gfc_expr *expr1, gfc_expr *expr2, gfc_exec_op op)
if (expr2->ts.type != BT_CLASS)
{
/* Insert an additional assignment which sets the '_vptr' field. */
+ gfc_symbol *vtab = NULL;
+ gfc_symtree *st;
+
lhs = gfc_copy_expr (expr1);
gfc_add_vptr_component (lhs);
+
if (expr2->ts.type == BT_DERIVED)
- {
- gfc_symbol *vtab;
- gfc_symtree *st;
- vtab = gfc_find_derived_vtab (expr2->ts.u.derived);
- gcc_assert (vtab);
- rhs = gfc_get_expr ();
- rhs->expr_type = EXPR_VARIABLE;
- gfc_find_sym_tree (vtab->name, vtab->ns, 1, &st);
- rhs->symtree = st;
- rhs->ts = vtab->ts;
- }
+ vtab = gfc_find_derived_vtab (expr2->ts.u.derived);
else if (expr2->expr_type == EXPR_NULL)
- rhs = gfc_get_int_expr (gfc_default_integer_kind, NULL, 0);
- else
- gcc_unreachable ();
+ vtab = gfc_find_derived_vtab (expr1->ts.u.derived);
+ gcc_assert (vtab);
+
+ rhs = gfc_get_expr ();
+ rhs->expr_type = EXPR_VARIABLE;
+ gfc_find_sym_tree (vtab->name, vtab->ns, 1, &st);
+ rhs->symtree = st;
+ rhs->ts = vtab->ts;
tmp = gfc_trans_pointer_assignment (lhs, rhs);
gfc_add_expr_to_block (&block, tmp);
diff --git a/gcc/go/gofrontend/types.cc b/gcc/go/gofrontend/types.cc
index a8faa35e0f6..8bb2b72a5a7 100644
--- a/gcc/go/gofrontend/types.cc
+++ b/gcc/go/gofrontend/types.cc
@@ -3768,6 +3768,19 @@ Struct_type::fill_in_tree(Gogo* gogo, tree type)
return type;
}
+// Make sure that all structs which must be converted to the backend
+// representation before this one are in fact converted.
+
+void
+Struct_type::convert_prerequisites(Gogo* gogo)
+{
+ for (std::vector<Named_type*>::const_iterator p
+ = this->prerequisites_.begin();
+ p != this->prerequisites_.end();
+ ++p)
+ (*p)->get_tree(gogo);
+}
+
// Initialize struct fields.
tree
@@ -5977,20 +5990,44 @@ Interface_type::fill_in_tree(Gogo* gogo, tree type)
{
gcc_assert(this->methods_ != NULL);
+ // Because the methods may refer to the interface type itself, we
+ // need to build the interface type first, and then update the
+ // method pointer later.
+
+ tree field_trees = NULL_TREE;
+ tree* pp = &field_trees;
+
+ tree name_tree = get_identifier("__methods");
+ tree methods_field = build_decl(this->location_, FIELD_DECL, name_tree,
+ ptr_type_node);
+ DECL_CONTEXT(methods_field) = type;
+ *pp = methods_field;
+ pp = &DECL_CHAIN(methods_field);
+
+ name_tree = get_identifier("__object");
+ tree field = build_decl(this->location_, FIELD_DECL, name_tree,
+ ptr_type_node);
+ DECL_CONTEXT(field) = type;
+ *pp = field;
+
+ TYPE_FIELDS(type) = field_trees;
+
+ layout_type(type);
+
// Build the type of the table of methods.
tree method_table = make_node(RECORD_TYPE);
// The first field is a pointer to the type descriptor.
- tree name_tree = get_identifier("__type_descriptor");
+ name_tree = get_identifier("__type_descriptor");
tree dtype = Type::make_type_descriptor_type()->get_tree(gogo);
dtype = build_pointer_type(build_qualified_type(dtype, TYPE_QUAL_CONST));
- tree field = build_decl(this->location_, FIELD_DECL, name_tree, dtype);
+ field = build_decl(this->location_, FIELD_DECL, name_tree, dtype);
DECL_CONTEXT(field) = method_table;
TYPE_FIELDS(method_table) = field;
std::string last_name = "";
- tree* pp = &DECL_CHAIN(field);
+ pp = &DECL_CHAIN(field);
for (Typed_identifier_list::const_iterator p = this->methods_->begin();
p != this->methods_->end();
++p)
@@ -6010,25 +6047,9 @@ Interface_type::fill_in_tree(Gogo* gogo, tree type)
}
layout_type(method_table);
- tree mtype = build_pointer_type(method_table);
-
- tree field_trees = NULL_TREE;
- pp = &field_trees;
-
- name_tree = get_identifier("__methods");
- field = build_decl(this->location_, FIELD_DECL, name_tree, mtype);
- DECL_CONTEXT(field) = type;
- *pp = field;
- pp = &DECL_CHAIN(field);
-
- name_tree = get_identifier("__object");
- field = build_decl(this->location_, FIELD_DECL, name_tree, ptr_type_node);
- DECL_CONTEXT(field) = type;
- *pp = field;
-
- TYPE_FIELDS(type) = field_trees;
-
- layout_type(type);
+ // Update the type of the __methods field from a generic pointer to
+ // a pointer to the method table.
+ TREE_TYPE(methods_field) = build_pointer_type(method_table);
return type;
}
@@ -6864,6 +6885,26 @@ Named_type::do_verify()
return false;
}
+ // If this is a struct, then if any of the fields of the struct
+ // themselves have struct type, then this struct must be converted
+ // to the backend representation before the field's type is
+ // converted. That may seem backward, but it works because if the
+ // field's type refers to this one, e.g., via a pointer, then the
+ // conversion process will pick up the half-built struct and do the
+ // right thing.
+ if (this->struct_type() != NULL)
+ {
+ const Struct_field_list* fields = this->struct_type()->fields();
+ for (Struct_field_list::const_iterator p = fields->begin();
+ p != fields->end();
+ ++p)
+ {
+ Struct_type* st = p->type()->struct_type();
+ if (st != NULL)
+ st->add_prerequisite(this);
+ }
+ }
+
return true;
}
@@ -6994,8 +7035,17 @@ Named_type::do_get_tree(Gogo* gogo)
break;
case TYPE_STRUCT:
+ // If there are structs which must be converted first, do them.
+ if (this->seen_ == 0)
+ {
+ ++this->seen_;
+ this->type_->struct_type()->convert_prerequisites(gogo);
+ --this->seen_;
+ }
+
if (this->named_tree_ != NULL_TREE)
return this->named_tree_;
+
t = make_node(RECORD_TYPE);
this->named_tree_ = t;
t = this->type_->struct_type()->fill_in_tree(gogo, t);
diff --git a/gcc/go/gofrontend/types.h b/gcc/go/gofrontend/types.h
index cecf106e448..a8d8a0b9ed4 100644
--- a/gcc/go/gofrontend/types.h
+++ b/gcc/go/gofrontend/types.h
@@ -1843,7 +1843,8 @@ class Struct_type : public Type
public:
Struct_type(Struct_field_list* fields, source_location location)
: Type(TYPE_STRUCT),
- fields_(fields), location_(location), all_methods_(NULL)
+ fields_(fields), location_(location), all_methods_(NULL),
+ prerequisites_()
{ }
// Return the field NAME. This only looks at local fields, not at
@@ -1938,6 +1939,17 @@ class Struct_type : public Type
tree
fill_in_tree(Gogo*, tree);
+ // Note that a struct must be converted to the backend
+ // representation before we convert this struct.
+ void
+ add_prerequisite(Named_type* nt)
+ { this->prerequisites_.push_back(nt); }
+
+ // If there are any structs which must be converted to the backend
+ // representation before this one, convert them.
+ void
+ convert_prerequisites(Gogo*);
+
protected:
int
do_traverse(Traverse*);
@@ -1983,6 +1995,16 @@ class Struct_type : public Type
source_location location_;
// If this struct is unnamed, a list of methods.
Methods* all_methods_;
+ // A list of structs which must be converted to the backend
+ // representation before this struct can be converted. This is for
+ // cases like
+ // type S1 { p *S2 }
+ // type S2 { s S1 }
+ // where we must start converting S2 before we start converting S1.
+ // That is because we can fully convert S1 before S2 is complete,
+ // but we can not fully convert S2 before S1 is complete. If we
+ // start converting S1 first, we won't be able to convert S2.
+ std::vector<Named_type*> prerequisites_;
};
// The type of an array.
diff --git a/gcc/lto-cgraph.c b/gcc/lto-cgraph.c
index b069602d2ed..6ca7abc052f 100644
--- a/gcc/lto-cgraph.c
+++ b/gcc/lto-cgraph.c
@@ -46,7 +46,7 @@ along with GCC; see the file COPYING3. If not see
#include "gcov-io.h"
static void output_varpool (cgraph_node_set, varpool_node_set);
-static void output_cgraph_opt_summary (void);
+static void output_cgraph_opt_summary (cgraph_node_set set);
static void input_cgraph_opt_summary (VEC (cgraph_node_ptr, heap) * nodes);
@@ -861,7 +861,7 @@ output_cgraph (cgraph_node_set set, varpool_node_set vset)
static bool asm_nodes_output = false;
if (flag_wpa)
- output_cgraph_opt_summary ();
+ output_cgraph_opt_summary (set);
ob = lto_create_simple_output_block (LTO_section_cgraph);
@@ -1596,13 +1596,26 @@ input_cgraph (void)
/* True when we need optimization summary for NODE. */
static int
-output_cgraph_opt_summary_p (struct cgraph_node *node)
+output_cgraph_opt_summary_p (struct cgraph_node *node, cgraph_node_set set)
{
- if (!node->clone_of)
- return false;
- return (node->clone.tree_map
- || node->clone.args_to_skip
- || node->clone.combined_args_to_skip);
+ struct cgraph_edge *e;
+
+ if (cgraph_node_in_set_p (node, set))
+ {
+ for (e = node->callees; e; e = e->next_callee)
+ if (e->indirect_info
+ && e->indirect_info->thunk_delta != 0)
+ return true;
+
+ for (e = node->indirect_calls; e; e = e->next_callee)
+ if (e->indirect_info->thunk_delta != 0)
+ return true;
+ }
+
+ return (node->clone_of
+ && (node->clone.tree_map
+ || node->clone.args_to_skip
+ || node->clone.combined_args_to_skip));
}
/* Output optimization summary for EDGE to OB. */
@@ -1621,7 +1634,8 @@ output_edge_opt_summary (struct output_block *ob,
static void
output_node_opt_summary (struct output_block *ob,
- struct cgraph_node *node)
+ struct cgraph_node *node,
+ cgraph_node_set set)
{
unsigned int index;
bitmap_iterator bi;
@@ -1659,17 +1673,21 @@ output_node_opt_summary (struct output_block *ob,
bp_pack_value (&bp, map->ref_p, 1);
lto_output_bitpack (&bp);
}
- for (e = node->callees; e; e = e->next_callee)
- output_edge_opt_summary (ob, e);
- for (e = node->indirect_calls; e; e = e->next_callee)
- output_edge_opt_summary (ob, e);
+
+ if (cgraph_node_in_set_p (node, set))
+ {
+ for (e = node->callees; e; e = e->next_callee)
+ output_edge_opt_summary (ob, e);
+ for (e = node->indirect_calls; e; e = e->next_callee)
+ output_edge_opt_summary (ob, e);
+ }
}
/* Output optimization summaries stored in callgraph.
At the moment it is the clone info structure. */
static void
-output_cgraph_opt_summary (void)
+output_cgraph_opt_summary (cgraph_node_set set)
{
struct cgraph_node *node;
int i, n_nodes;
@@ -1681,16 +1699,17 @@ output_cgraph_opt_summary (void)
encoder = ob->decl_state->cgraph_node_encoder;
n_nodes = lto_cgraph_encoder_size (encoder);
for (i = 0; i < n_nodes; i++)
- if (output_cgraph_opt_summary_p (lto_cgraph_encoder_deref (encoder, i)))
+ if (output_cgraph_opt_summary_p (lto_cgraph_encoder_deref (encoder, i),
+ set))
count++;
lto_output_uleb128_stream (ob->main_stream, count);
for (i = 0; i < n_nodes; i++)
{
node = lto_cgraph_encoder_deref (encoder, i);
- if (output_cgraph_opt_summary_p (node))
+ if (output_cgraph_opt_summary_p (node, set))
{
lto_output_uleb128_stream (ob->main_stream, i);
- output_node_opt_summary (ob, node);
+ output_node_opt_summary (ob, node, set);
}
}
produce_asm (ob, NULL);
diff --git a/gcc/lto-wrapper.c b/gcc/lto-wrapper.c
index 143e3fd1b66..6f106a31f45 100644
--- a/gcc/lto-wrapper.c
+++ b/gcc/lto-wrapper.c
@@ -422,7 +422,7 @@ run_gcc (unsigned argc, char *argv[])
argv_ptr[1] = "-o";
argv_ptr[2] = flto_out;
}
- else if (lto_mode == LTO_MODE_WHOPR)
+ else
{
const char *list_option = "-fltrans-output-list=";
size_t list_option_len = strlen (list_option);
@@ -457,8 +457,6 @@ run_gcc (unsigned argc, char *argv[])
argv_ptr[2] = "-fwpa";
}
- else
- fatal ("invalid LTO mode");
/* Append the input objects and possible preceeding arguments. */
for (i = 1; i < argc; ++i)
@@ -473,7 +471,7 @@ run_gcc (unsigned argc, char *argv[])
free (flto_out);
flto_out = NULL;
}
- else if (lto_mode == LTO_MODE_WHOPR)
+ else
{
FILE *stream = fopen (ltrans_output_file, "r");
FILE *mstream = NULL;
@@ -615,8 +613,6 @@ cont:
free (input_names);
free (list_option_full);
}
- else
- fatal ("invalid LTO mode");
obstack_free (&env_obstack, NULL);
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 867e6a09550..0a1c3d0de06 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,41 @@
+2011-01-06 Daniel Franke <franke.daniel@gmail.com>
+
+ PR fortran/47195
+ * gfortran.dg/interface_33.f90: Fixed dg-error declarations.
+ * gfortran.dg/defined_operators_1.f90: Split the subroutine
+ from the interface of functions to not hide the errors that
+ shall be tested.
+
+2011-01-06 Jan Hubicka <jh@suse.cz>
+
+ * testsuite/gcc.dg/lto/pr47188_0.c: New testcase.
+ * testsuite/gcc.dg/lto/pr47188_1.c: New testcase.
+
+2011-01-06 Daniel Franke <franke.daniel@gmail.com>
+
+ PR fortran/33117
+ PR fortran/46478
+ * gfortran.dg/interface_33.f90: New test.
+
+2011-01-06 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/47150
+ * gcc.c-torture/compile/pr47150.c: New test.
+
+2011-01-06 Ira Rosen <irar@il.ibm.com>
+
+ PR tree-optimization/47139
+ * gcc.dg/vect/pr47139.c: New test.
+
+2011-01-05 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/47180
+ * gfortran.dg/extends_type_of_2.f03: New.
+
+2011-01-05 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ * gcc.dg/stack-usage-1.c (SIZE): Provide proper value for __SPU__.
+
2011-01-05 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/opt14.adb: New test.
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr47150.c b/gcc/testsuite/gcc.c-torture/compile/pr47150.c
new file mode 100644
index 00000000000..559ddd70fdf
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr47150.c
@@ -0,0 +1,11 @@
+/* PR c/47150 */
+
+float _Complex foo (float, float);
+
+void
+bar ()
+{
+ float w = 2;
+ float _Complex b;
+ b = 0.5 * (foo (0, w) + foo (1, w) / w);
+}
diff --git a/gcc/testsuite/gcc.dg/lto/pr47188_0.c b/gcc/testsuite/gcc.dg/lto/pr47188_0.c
new file mode 100644
index 00000000000..ac9e03167fe
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/pr47188_0.c
@@ -0,0 +1,7 @@
+/* { dg-lto-do assemble } */
+/* { dg-require-linker-plugin "" } */
+/* { dg-extra-ld-options "-fuse-linker-plugin -fwhole-program" } */
+int foo(void)
+{
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/pr47188_1.c b/gcc/testsuite/gcc.dg/lto/pr47188_1.c
new file mode 100644
index 00000000000..f18f4db381a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/pr47188_1.c
@@ -0,0 +1,8 @@
+/* { dg-options "-fno-lto" } */
+
+extern int foo(void);
+
+int main(void)
+{
+ return foo();
+}
diff --git a/gcc/testsuite/gcc.dg/stack-usage-1.c b/gcc/testsuite/gcc.dg/stack-usage-1.c
index 6c9199011ca..1d03a8dc994 100644
--- a/gcc/testsuite/gcc.dg/stack-usage-1.c
+++ b/gcc/testsuite/gcc.dg/stack-usage-1.c
@@ -39,6 +39,8 @@
# define SIZE 96 /* 256 - 160 bytes for register save area */
#elif defined (__s390__)
# define SIZE 160 /* 256 - 96 bytes for register save area */
+#elif defined (__SPU__)
+# define SIZE 224
#else
# define SIZE 256
#endif
diff --git a/gcc/testsuite/gcc.dg/vect/pr47139.c b/gcc/testsuite/gcc.dg/vect/pr47139.c
new file mode 100644
index 00000000000..9e9c751e971
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/pr47139.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+
+int d;
+
+void
+foo ()
+{
+ int a = 0;
+ unsigned char b;
+ for (b = 1; b; b++)
+ {
+ d = a;
+ a |= b;
+ }
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc/testsuite/gfortran.dg/defined_operators_1.f90 b/gcc/testsuite/gfortran.dg/defined_operators_1.f90
index bd25021604b..c7868d14c6c 100644
--- a/gcc/testsuite/gfortran.dg/defined_operators_1.f90
+++ b/gcc/testsuite/gfortran.dg/defined_operators_1.f90
@@ -17,10 +17,21 @@ module mymod
character(*) :: foo_chr
character(*), intent(in) :: chr
end function foo_chr
+ end interface
+
+ !
+ ! PR fortran/33117
+ ! PR fortran/46478
+ ! Mixing FUNCTIONs and SUBROUTINEs in an INTERFACE hides the
+ ! errors that should be tested here. Hence split out subroutine
+ ! to test separately.
+ !
+ interface operator (.bar.)
subroutine bad_foo (chr) ! { dg-error "must be a FUNCTION" }
character(*), intent(in) :: chr
end subroutine bad_foo
end interface
+
contains
function foo_0 () ! { dg-error "must have at least one argument" }
integer :: foo_1
diff --git a/gcc/testsuite/gfortran.dg/extends_type_of_2.f03 b/gcc/testsuite/gfortran.dg/extends_type_of_2.f03
new file mode 100644
index 00000000000..f882cb1c6b0
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/extends_type_of_2.f03
@@ -0,0 +1,36 @@
+! { dg-do run }
+!
+! PR 47180: [OOP] EXTENDS_TYPE_OF returns the wrong result for disassociated polymorphic pointers
+!
+! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
+
+implicit none
+
+type t1
+ integer :: a
+end type t1
+
+type, extends(t1):: t11
+ integer :: b
+end type t11
+
+type(t1) , target :: a1
+type(t11) , target :: a11
+class(t1) , pointer :: b1
+class(t11), pointer :: b11
+
+b1 => NULL()
+b11 => NULL()
+
+if (.not. extends_type_of(b1 , a1)) call abort()
+if (.not. extends_type_of(b11, a1)) call abort()
+if (.not. extends_type_of(b11,a11)) call abort()
+
+b1 => a1
+b11 => a11
+
+if (.not. extends_type_of(b1 , a1)) call abort()
+if (.not. extends_type_of(b11, a1)) call abort()
+if (.not. extends_type_of(b11,a11)) call abort()
+
+end
diff --git a/gcc/testsuite/gfortran.dg/interface_33.f90 b/gcc/testsuite/gfortran.dg/interface_33.f90
new file mode 100644
index 00000000000..955d50731bc
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/interface_33.f90
@@ -0,0 +1,36 @@
+! { dg-do compile }
+!
+! PR fortran/33117, PR fortran/46478
+! Procedures of a generic interface must be either
+! all SUBROUTINEs or all FUNCTIONs.
+!
+
+!
+! PR fortran/33117
+!
+module m1
+ interface gen
+ subroutine sub() ! { dg-error "all SUBROUTINEs or all FUNCTIONs" }
+ end subroutine sub
+ function bar()
+ real :: bar
+ end function bar
+ end interface gen
+end module
+
+!
+! PR fortran/46478
+!
+MODULE m2
+ INTERFACE new_name
+ MODULE PROCEDURE func_name
+ MODULE PROCEDURE subr_name
+ END INTERFACE
+CONTAINS
+ LOGICAL FUNCTION func_name() ! { dg-error "all SUBROUTINEs or all FUNCTIONs" }
+ END FUNCTION
+ SUBROUTINE subr_name()
+ END SUBROUTINE
+END MODULE
+
+! { dg-final { cleanup-modules "m1 m2" } }
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index 1dc4ec0fde9..d474688ebec 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -1649,9 +1649,10 @@ report_vect_op (gimple stmt, const char *msg)
1. operation is commutative and associative and it is safe to
change the order of the computation (if CHECK_REDUCTION is true)
2. no uses for a2 in the loop (a2 is used out of the loop)
- 3. no uses of a1 in the loop besides the reduction operation.
+ 3. no uses of a1 in the loop besides the reduction operation
+ 4. no uses of a1 outside the loop.
- Condition 1 is tested here.
+ Conditions 1,4 are tested here.
Conditions 2,3 are tested in vect_mark_stmts_to_be_vectorized.
(2) Detect a cross-iteration def-use cycle in nested loops, i.e.,
@@ -1702,8 +1703,16 @@ vect_is_simple_reduction_1 (loop_vec_info loop_info, gimple phi,
gimple use_stmt = USE_STMT (use_p);
if (is_gimple_debug (use_stmt))
continue;
- if (flow_bb_inside_loop_p (loop, gimple_bb (use_stmt))
- && vinfo_for_stmt (use_stmt)
+
+ if (!flow_bb_inside_loop_p (loop, gimple_bb (use_stmt)))
+ {
+ if (vect_print_dump_info (REPORT_DETAILS))
+ fprintf (vect_dump, "intermediate value used outside loop.");
+
+ return NULL;
+ }
+
+ if (vinfo_for_stmt (use_stmt)
&& !is_pattern_stmt_p (vinfo_for_stmt (use_stmt)))
nloop_uses++;
if (nloop_uses > 1)
diff --git a/libgo/Makefile.am b/libgo/Makefile.am
index cddcd2439e7..838fec7227b 100644
--- a/libgo/Makefile.am
+++ b/libgo/Makefile.am
@@ -1366,7 +1366,8 @@ bufio/check: $(CHECK_DEPS)
$(CHECK)
.PHONY: bufio/check
-bytes/libbytes.a: $(go_bytes_files) $(go_bytes_c_files) io.gox os.gox utf8.gox
+bytes/libbytes.a: $(go_bytes_files) $(go_bytes_c_files) io.gox os.gox \
+ unicode.gox utf8.gox
test -d bytes || $(MKDIR_P) bytes
$(LTGOCOMPILE) -c -o bytes/bytes.$(OBJEXT) -fgo-prefix=libgo_bytes $(srcdir)/go/bytes/buffer.go $(srcdir)/go/bytes/bytes.go $(srcdir)/go/bytes/bytes_decl.go
$(LTCOMPILE) -c -o bytes/index.$(OBJEXT) $(srcdir)/go/bytes/indexbyte.c
diff --git a/libgo/Makefile.in b/libgo/Makefile.in
index 4ccd863124c..6e2a2dcef03 100644
--- a/libgo/Makefile.in
+++ b/libgo/Makefile.in
@@ -3638,7 +3638,8 @@ bufio/check: $(CHECK_DEPS)
$(CHECK)
.PHONY: bufio/check
-bytes/libbytes.a: $(go_bytes_files) $(go_bytes_c_files) io.gox os.gox utf8.gox
+bytes/libbytes.a: $(go_bytes_files) $(go_bytes_c_files) io.gox os.gox \
+ unicode.gox utf8.gox
test -d bytes || $(MKDIR_P) bytes
$(LTGOCOMPILE) -c -o bytes/bytes.$(OBJEXT) -fgo-prefix=libgo_bytes $(srcdir)/go/bytes/buffer.go $(srcdir)/go/bytes/bytes.go $(srcdir)/go/bytes/bytes_decl.go
$(LTCOMPILE) -c -o bytes/index.$(OBJEXT) $(srcdir)/go/bytes/indexbyte.c
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index b087b5f402d..aa1c306ef8d 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,9 @@
+2011-01-06 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * testsuite/libjava.jni/jni.exp (gcj_jni_get_cxxflags_invocation):
+ Add -shared-libgcc to cxxflags for *-*-solaris*.
+ Remove -lsocket.
+
2011-01-03 Jakub Jelinek <jakub@redhat.com>
* gnu/gcj/convert/Convert.java (version): Update copyright notice
diff --git a/libjava/testsuite/libjava.jni/jni.exp b/libjava/testsuite/libjava.jni/jni.exp
index dbeced481a8..ebdee1b44c9 100644
--- a/libjava/testsuite/libjava.jni/jni.exp
+++ b/libjava/testsuite/libjava.jni/jni.exp
@@ -274,8 +274,10 @@ proc gcj_jni_get_cxxflags_invocation {} {
eval lappend cxxflags "-shared-libgcc -lgcj $libiconv"
}
+ # Make sure libgcc unwinder is used on 64-bit Solaris 10+/x86 rather than
+ # the libc one.
if { [istarget "*-*-solaris*"] } {
- lappend cxxflags "-lsocket"
+ lappend cxxflags "-shared-libgcc"
}
return $cxxflags
diff --git a/libquadmath/ChangeLog b/libquadmath/ChangeLog
index e87d14a2ebb..146e02e60a8 100644
--- a/libquadmath/ChangeLog
+++ b/libquadmath/ChangeLog
@@ -1,3 +1,12 @@
+2011-01-06 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ PR fortran/47174
+ * Makefile.am (libquadmath.info): Unconditionally override
+ target, not only if BUILD_LIBQUADMATH.
+ * Makefile.in: Regenerate.
+ * configure.ac (AM_INIT_AUTOMAKE): Add -Wno-override option to
+ avoid warning from automake.
+
2010-12-19 Tobias Burnus <burnus@net-b.de>
PR fortran/46520
diff --git a/libquadmath/Makefile.am b/libquadmath/Makefile.am
index e9071237755..83eb749dcc2 100644
--- a/libquadmath/Makefile.am
+++ b/libquadmath/Makefile.am
@@ -126,8 +126,6 @@ stamp-geninsrc: libquadmath.info
cp -p $(top_builddir)/libquadmath.info $(srcdir)/libquadmath.info
@touch $@
-libquadmath.info: $(STAMP_BUILD_INFO)
-
stamp-build-info: libquadmath.texi
$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) -o libquadmath.info $(srcdir)/libquadmath.texi
@touch $@
@@ -135,7 +133,11 @@ stamp-build-info: libquadmath.texi
CLEANFILES = $(STAMP_GENINSRC) $(STAMP_BUILD_INFO) libquadmath.info
MAINTAINERCLEANFILES = $(srcdir)/libquadmath.info
-endif
+endif BUILD_LIBQUADMATH
+
+# Unconditionally override this target, so that automake's definition
+# does not wrongly interfere.
+libquadmath.info: $(STAMP_BUILD_INFO)
# Automake Documentation:
diff --git a/libquadmath/Makefile.in b/libquadmath/Makefile.in
index 7b2b699b8d9..b2b64ad2918 100644
--- a/libquadmath/Makefile.in
+++ b/libquadmath/Makefile.in
@@ -843,24 +843,6 @@ distclean-multi:
maintainer-clean-multi:
$(MULTICLEAN) $(AM_MAKEFLAGS) DO=maintainer-clean multi-clean # $(MAKE)
-@BUILD_LIBQUADMATH_FALSE@libquadmath.info: libquadmath.texi
-@BUILD_LIBQUADMATH_FALSE@ restore=: && backupdir="$(am__leading_dot)am$$$$" && \
-@BUILD_LIBQUADMATH_FALSE@ rm -rf $$backupdir && mkdir $$backupdir && \
-@BUILD_LIBQUADMATH_FALSE@ if ($(MAKEINFO) --version) >/dev/null 2>&1; then \
-@BUILD_LIBQUADMATH_FALSE@ for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \
-@BUILD_LIBQUADMATH_FALSE@ if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \
-@BUILD_LIBQUADMATH_FALSE@ done; \
-@BUILD_LIBQUADMATH_FALSE@ else :; fi && \
-@BUILD_LIBQUADMATH_FALSE@ if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
-@BUILD_LIBQUADMATH_FALSE@ -o $@ `test -f 'libquadmath.texi' || echo '$(srcdir)/'`libquadmath.texi; \
-@BUILD_LIBQUADMATH_FALSE@ then \
-@BUILD_LIBQUADMATH_FALSE@ rc=0; \
-@BUILD_LIBQUADMATH_FALSE@ else \
-@BUILD_LIBQUADMATH_FALSE@ rc=$$?; \
-@BUILD_LIBQUADMATH_FALSE@ $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \
-@BUILD_LIBQUADMATH_FALSE@ fi; \
-@BUILD_LIBQUADMATH_FALSE@ rm -rf $$backupdir; exit $$rc
-
libquadmath.dvi: libquadmath.texi
TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
@@ -1288,12 +1270,14 @@ uninstall-am: uninstall-dvi-am uninstall-html-am uninstall-info-am \
@BUILD_LIBQUADMATH_TRUE@ cp -p $(top_builddir)/libquadmath.info $(srcdir)/libquadmath.info
@BUILD_LIBQUADMATH_TRUE@ @touch $@
-@BUILD_LIBQUADMATH_TRUE@libquadmath.info: $(STAMP_BUILD_INFO)
-
@BUILD_LIBQUADMATH_TRUE@stamp-build-info: libquadmath.texi
@BUILD_LIBQUADMATH_TRUE@ $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) -o libquadmath.info $(srcdir)/libquadmath.texi
@BUILD_LIBQUADMATH_TRUE@ @touch $@
+# Unconditionally override this target, so that automake's definition
+# does not wrongly interfere.
+libquadmath.info: $(STAMP_BUILD_INFO)
+
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/libquadmath/configure.ac b/libquadmath/configure.ac
index 68b5cf8924c..568b36a3072 100644
--- a/libquadmath/configure.ac
+++ b/libquadmath/configure.ac
@@ -26,7 +26,7 @@ ACX_NONCANONICAL_TARGET
target_alias=${target_alias-$host_alias}
AC_SUBST(target_alias)
-AM_INIT_AUTOMAKE([1.9.0 foreign subdir-objects no-dist -Wall -Werror])
+AM_INIT_AUTOMAKE([1.9.0 foreign subdir-objects no-dist -Wall -Wno-override -Werror])
AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
AC_ARG_ENABLE(version-specific-runtime-libs,
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 2a2307aebc4..e3430694351 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,22 @@
+2011-01-06 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR libstdc++/47185
+ * src/placeholders.cc: New.
+ * src/Makefile.am: Adjust.
+ * src/Makefile.in: Regenerate.
+ * include/std/functional (placeholders::_1, _2, ..., _29): Declare
+ extern.
+ * config/abi/pre/gnu.ver: Export.
+
+2011-01-05 François Dumont <francois.cppdevs@free.fr>
+
+ * include/debug/safe_base.h (_Safe_iterator_base::_M_unlink): New.
+ * include/src/debug.cc: Use latter
+ * include/debug/forward_list (forward_list<>::_M_swap): Fix to
+ correctly handle before_begin iterators.
+ * testsuite/23_containers/forward_list/debug/swap.cc: Remove now
+ useless _GLIBCXX_DEBUG checks.
+
2011-01-04 Kai Tietz <kai.tietz@onevision.com>
PR libstdc++/47145
diff --git a/libstdc++-v3/aclocal.m4 b/libstdc++-v3/aclocal.m4
index 9bfa6dc932c..60b7ccb5912 100644
--- a/libstdc++-v3/aclocal.m4
+++ b/libstdc++-v3/aclocal.m4
@@ -1,7 +1,7 @@
# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
diff --git a/libstdc++-v3/config/abi/pre/gnu.ver b/libstdc++-v3/config/abi/pre/gnu.ver
index f8c32e1a6e4..6633273cbc9 100644
--- a/libstdc++-v3/config/abi/pre/gnu.ver
+++ b/libstdc++-v3/config/abi/pre/gnu.ver
@@ -1196,6 +1196,9 @@ GLIBCXX_3.4.15 {
# std::future_category is now a function
_ZSt15future_categoryv;
+ # std::placeholders
+ _ZNSt12placeholders*;
+
} GLIBCXX_3.4.14;
# Symbols in the support library (libsupc++) have their own tag.
diff --git a/libstdc++-v3/include/debug/forward_list b/libstdc++-v3/include/debug/forward_list
index 03b661ec221..09b0b8659f4 100644
--- a/libstdc++-v3/include/debug/forward_list
+++ b/libstdc++-v3/include/debug/forward_list
@@ -600,8 +600,80 @@ namespace __debug
&& __it != this->_M_base().cend();
});
}
+ typedef __gnu_debug::_Safe_iterator_base _Safe_iterator_base;
+ static void
+ _M_swap_aux(forward_list& __lhs,
+ _Safe_iterator_base*& __lhs_iterators,
+ forward_list& __rhs,
+ _Safe_iterator_base*& __rhs_iterators);
+ void _M_swap(forward_list& __list);
};
+ template<typename _Tp, typename _Alloc>
+ void
+ forward_list<_Tp, _Alloc>::
+ _M_swap_aux(forward_list<_Tp, _Alloc>& __lhs,
+ __gnu_debug::_Safe_iterator_base*& __lhs_iterators,
+ forward_list<_Tp, _Alloc>& __rhs,
+ __gnu_debug::_Safe_iterator_base*& __rhs_iterators)
+ {
+ using __gnu_debug::_Safe_iterator_base;
+ _Safe_iterator_base* __bbegin_its = 0;
+ _Safe_iterator_base* __last_bbegin = 0;
+ for (_Safe_iterator_base* __iter = __lhs_iterators; __iter;)
+ {
+ // Even iterator are casted to const_iterator, not a problem.
+ const_iterator* __victim = static_cast<const_iterator*>(__iter);
+ __iter = __iter->_M_next;
+ if (__victim->base() == __rhs._M_base().cbefore_begin())
+ {
+ __victim->_M_unlink();
+ if (__lhs_iterators == __victim)
+ __lhs_iterators = __victim->_M_next;
+ if (__bbegin_its)
+ {
+ __victim->_M_next = __bbegin_its;
+ __bbegin_its->_M_prior = __victim;
+ }
+ else
+ __last_bbegin = __victim;
+ __bbegin_its = __victim;
+ }
+ else
+ __victim->_M_sequence = &__lhs;
+ }
+
+ if (__bbegin_its)
+ {
+ if (__rhs_iterators)
+ {
+ __rhs_iterators->_M_prior = __last_bbegin;
+ __last_bbegin->_M_next = __rhs_iterators;
+ }
+ __rhs_iterators = __bbegin_its;
+ }
+ }
+
+ /* Special forward_list _M_swap version that do not swap the
+ * before-begin ownership.*/
+ template<typename _Tp, typename _Alloc>
+ void
+ forward_list<_Tp, _Alloc>::
+ _M_swap(forward_list<_Tp, _Alloc>& __list)
+ {
+ __gnu_cxx::__scoped_lock sentry(this->_M_get_mutex());
+ std::swap(this->_M_iterators, __list._M_iterators);
+ std::swap(this->_M_const_iterators, __list._M_const_iterators);
+ // Useless, always 1 on forward_list
+ //std::swap(this->_M_version, __list._M_version);
+ _Safe_iterator_base* __this_its = this->_M_iterators;
+ _M_swap_aux(__list, __list._M_iterators, *this, this->_M_iterators);
+ _Safe_iterator_base* __this_const_its = this->_M_const_iterators;
+ _M_swap_aux(__list, __list._M_const_iterators, *this, this->_M_const_iterators);
+ _M_swap_aux(*this, __this_its, __list, __list._M_iterators);
+ _M_swap_aux(*this, __this_const_its, __list, __list._M_const_iterators);
+ }
+
template<typename _Tp, typename _Alloc>
bool
operator==(const forward_list<_Tp, _Alloc>& __lx,
diff --git a/libstdc++-v3/include/debug/safe_base.h b/libstdc++-v3/include/debug/safe_base.h
index 2ebdd89b58f..1348004cb57 100644
--- a/libstdc++-v3/include/debug/safe_base.h
+++ b/libstdc++-v3/include/debug/safe_base.h
@@ -146,6 +146,16 @@ namespace __gnu_debug
/** Reset all member variables */
void
_M_reset() throw ();
+
+ /** Unlink itself */
+ void
+ _M_unlink() throw ()
+ {
+ if (_M_prior)
+ _M_prior->_M_next = _M_next;
+ if (_M_next)
+ _M_next->_M_prior = _M_prior;
+ }
};
/**
diff --git a/libstdc++-v3/include/std/functional b/libstdc++-v3/include/std/functional
index 0c37ccc0e9f..a781dbee28f 100644
--- a/libstdc++-v3/include/std/functional
+++ b/libstdc++-v3/include/std/functional
@@ -844,39 +844,36 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
* unique names for each.
*/
namespace placeholders
- {
- namespace
- {
- _Placeholder<1> _1;
- _Placeholder<2> _2;
- _Placeholder<3> _3;
- _Placeholder<4> _4;
- _Placeholder<5> _5;
- _Placeholder<6> _6;
- _Placeholder<7> _7;
- _Placeholder<8> _8;
- _Placeholder<9> _9;
- _Placeholder<10> _10;
- _Placeholder<11> _11;
- _Placeholder<12> _12;
- _Placeholder<13> _13;
- _Placeholder<14> _14;
- _Placeholder<15> _15;
- _Placeholder<16> _16;
- _Placeholder<17> _17;
- _Placeholder<18> _18;
- _Placeholder<19> _19;
- _Placeholder<20> _20;
- _Placeholder<21> _21;
- _Placeholder<22> _22;
- _Placeholder<23> _23;
- _Placeholder<24> _24;
- _Placeholder<25> _25;
- _Placeholder<26> _26;
- _Placeholder<27> _27;
- _Placeholder<28> _28;
- _Placeholder<29> _29;
- }
+ {
+ extern const _Placeholder<1> _1;
+ extern const _Placeholder<2> _2;
+ extern const _Placeholder<3> _3;
+ extern const _Placeholder<4> _4;
+ extern const _Placeholder<5> _5;
+ extern const _Placeholder<6> _6;
+ extern const _Placeholder<7> _7;
+ extern const _Placeholder<8> _8;
+ extern const _Placeholder<9> _9;
+ extern const _Placeholder<10> _10;
+ extern const _Placeholder<11> _11;
+ extern const _Placeholder<12> _12;
+ extern const _Placeholder<13> _13;
+ extern const _Placeholder<14> _14;
+ extern const _Placeholder<15> _15;
+ extern const _Placeholder<16> _16;
+ extern const _Placeholder<17> _17;
+ extern const _Placeholder<18> _18;
+ extern const _Placeholder<19> _19;
+ extern const _Placeholder<20> _20;
+ extern const _Placeholder<21> _21;
+ extern const _Placeholder<22> _22;
+ extern const _Placeholder<23> _23;
+ extern const _Placeholder<24> _24;
+ extern const _Placeholder<25> _25;
+ extern const _Placeholder<26> _26;
+ extern const _Placeholder<27> _27;
+ extern const _Placeholder<28> _28;
+ extern const _Placeholder<29> _29;
}
/**
diff --git a/libstdc++-v3/src/Makefile.am b/libstdc++-v3/src/Makefile.am
index 28a924e9f41..21a1bfd3f8a 100644
--- a/libstdc++-v3/src/Makefile.am
+++ b/libstdc++-v3/src/Makefile.am
@@ -207,6 +207,7 @@ sources = \
locale-inst.cc \
misc-inst.cc \
ostream-inst.cc \
+ placeholders.cc \
sstream-inst.cc \
streambuf-inst.cc \
streambuf.cc \
@@ -354,6 +355,11 @@ debug.lo: debug.cc
debug.o: debug.cc
$(CXXCOMPILE) -std=gnu++0x -c $<
+placeholders.lo: placeholders.cc
+ $(LTCXXCOMPILE) -std=gnu++0x -c $<
+placeholders.o: placeholders.cc
+ $(CXXCOMPILE) -std=gnu++0x -c $<
+
if GLIBCXX_LDBL_COMPAT
# Use special rules for compatibility-ldbl.cc compilation, as we need to
# pass -mlong-double-64.
diff --git a/libstdc++-v3/src/Makefile.in b/libstdc++-v3/src/Makefile.in
index c0d621d32f8..6776eb7e4bb 100644
--- a/libstdc++-v3/src/Makefile.in
+++ b/libstdc++-v3/src/Makefile.in
@@ -109,10 +109,11 @@ am__objects_5 = atomic.lo bitmap_allocator.lo pool_allocator.lo \
strstream.lo system_error.lo tree.lo allocator-inst.lo \
concept-inst.lo fstream-inst.lo ext-inst.lo ios-inst.lo \
iostream-inst.lo istream-inst.lo istream.lo locale-inst.lo \
- misc-inst.lo ostream-inst.lo sstream-inst.lo streambuf-inst.lo \
- streambuf.lo string-inst.lo valarray-inst.lo wlocale-inst.lo \
- wstring-inst.lo mutex.lo condition_variable.lo chrono.lo \
- thread.lo future.lo $(am__objects_1) $(am__objects_4)
+ misc-inst.lo ostream-inst.lo placeholders.lo sstream-inst.lo \
+ streambuf-inst.lo streambuf.lo string-inst.lo valarray-inst.lo \
+ wlocale-inst.lo wstring-inst.lo mutex.lo condition_variable.lo \
+ chrono.lo thread.lo future.lo $(am__objects_1) \
+ $(am__objects_4)
am_libstdc___la_OBJECTS = $(am__objects_5)
libstdc___la_OBJECTS = $(am_libstdc___la_OBJECTS)
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
@@ -422,6 +423,7 @@ sources = \
locale-inst.cc \
misc-inst.cc \
ostream-inst.cc \
+ placeholders.cc \
sstream-inst.cc \
streambuf-inst.cc \
streambuf.cc \
@@ -941,6 +943,11 @@ debug.lo: debug.cc
debug.o: debug.cc
$(CXXCOMPILE) -std=gnu++0x -c $<
+placeholders.lo: placeholders.cc
+ $(LTCXXCOMPILE) -std=gnu++0x -c $<
+placeholders.o: placeholders.cc
+ $(CXXCOMPILE) -std=gnu++0x -c $<
+
# Use special rules for compatibility-ldbl.cc compilation, as we need to
# pass -mlong-double-64.
@GLIBCXX_LDBL_COMPAT_TRUE@compatibility-ldbl.lo: compatibility-ldbl.cc
diff --git a/libstdc++-v3/src/debug.cc b/libstdc++-v3/src/debug.cc
index 188495a3ea8..9074dfb0738 100644
--- a/libstdc++-v3/src/debug.cc
+++ b/libstdc++-v3/src/debug.cc
@@ -257,11 +257,7 @@ namespace __gnu_debug
_M_detach_single(_Safe_iterator_base* __it) throw ()
{
// Remove __it from this sequence's list
- if (__it->_M_prior)
- __it->_M_prior->_M_next = __it->_M_next;
- if (__it->_M_next)
- __it->_M_next->_M_prior = __it->_M_prior;
-
+ __it->_M_unlink();
if (_M_const_iterators == __it)
_M_const_iterators = __it->_M_next;
if (_M_iterators == __it)
diff --git a/libstdc++-v3/src/placeholders.cc b/libstdc++-v3/src/placeholders.cc
new file mode 100644
index 00000000000..1d68bb7cf9e
--- /dev/null
+++ b/libstdc++-v3/src/placeholders.cc
@@ -0,0 +1,65 @@
+// std::placeholders -*- C++ -*-
+
+// Copyright (C) 2011 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+# error "placeholders.cc must be compiled with -std=gnu++0x"
+#endif
+
+#include <functional>
+
+namespace std
+{
+ namespace placeholders
+ {
+ extern const _Placeholder<1> _1{};
+ extern const _Placeholder<2> _2{};
+ extern const _Placeholder<3> _3{};
+ extern const _Placeholder<4> _4{};
+ extern const _Placeholder<5> _5{};
+ extern const _Placeholder<6> _6{};
+ extern const _Placeholder<7> _7{};
+ extern const _Placeholder<8> _8{};
+ extern const _Placeholder<9> _9{};
+ extern const _Placeholder<10> _10{};
+ extern const _Placeholder<11> _11{};
+ extern const _Placeholder<12> _12{};
+ extern const _Placeholder<13> _13{};
+ extern const _Placeholder<14> _14{};
+ extern const _Placeholder<15> _15{};
+ extern const _Placeholder<16> _16{};
+ extern const _Placeholder<17> _17{};
+ extern const _Placeholder<18> _18{};
+ extern const _Placeholder<19> _19{};
+ extern const _Placeholder<20> _20{};
+ extern const _Placeholder<21> _21{};
+ extern const _Placeholder<22> _22{};
+ extern const _Placeholder<23> _23{};
+ extern const _Placeholder<24> _24{};
+ extern const _Placeholder<25> _25{};
+ extern const _Placeholder<26> _26{};
+ extern const _Placeholder<27> _27{};
+ extern const _Placeholder<28> _28{};
+ extern const _Placeholder<29> _29{};
+ }
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/debug/swap.cc b/libstdc++-v3/testsuite/23_containers/forward_list/debug/swap.cc
index 0105791bedc..486bfcf0724 100644
--- a/libstdc++-v3/testsuite/23_containers/forward_list/debug/swap.cc
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/debug/swap.cc
@@ -54,10 +54,8 @@ test01()
// before-begin iterator is not transfered:
// TODO: Validate with LWG group how before begin should be
// treated.
-#if !_GLIBCXX_DEBUG
VERIFY( fit == fl1_its[0] );
-#endif
- // All others are, even paste-the-end one:
+ // All other iterators are, even paste-the-end ones:
for (size_t i = 1; i != fl2_its.size(); ++i)
{
VERIFY( ++fit == fl2_its[i] );
@@ -66,9 +64,7 @@ test01()
fit = fl2.before_begin();
// TODO: Validate with LWG group how before begin should be
// treated.
-#if !_GLIBCXX_DEBUG
VERIFY( fit == fl2_its[0] );
-#endif
for (size_t i = 1; i != fl1_its.size(); ++i)
{
VERIFY( ++fit == fl1_its[i] );