summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2009-10-13 15:53:41 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2009-10-13 15:53:41 +0000
commit3430348274cab35a05ba26a09da4d7eec358d9c4 (patch)
treecb0be27f88176ac210a7c6e53c61ca11c643d249
parentec80f01f4525551ee07b80b9928b0882699d34ba (diff)
downloadgcc-3430348274cab35a05ba26a09da4d7eec358d9c4.tar.gz
2009-10-13 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 152709 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@152713 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--ChangeLog6
-rw-r--r--ChangeLog.MELT3
-rw-r--r--MAINTAINERS1
-rwxr-xr-xconfigure5
-rw-r--r--configure.ac5
-rw-r--r--gcc/ChangeLog106
-rw-r--r--gcc/DATESTAMP2
-rw-r--r--gcc/cfgexpand.c12
-rw-r--r--gcc/config/cris/cris.md6
-rw-r--r--gcc/config/i386/i386.md14
-rw-r--r--gcc/config/s390/s390.c1
-rw-r--r--gcc/cp/ChangeLog11
-rw-r--r--gcc/cp/parser.c13
-rw-r--r--gcc/cp/pt.c11
-rw-r--r--gcc/cselib.c13
-rw-r--r--gcc/emit-rtl.c8
-rw-r--r--gcc/gengtype.c2
-rw-r--r--gcc/gimple-iterator.c8
-rw-r--r--gcc/ipa-cp.c13
-rw-r--r--gcc/ipa-prop.c3
-rw-r--r--gcc/lto-opts.c50
-rw-r--r--gcc/opts.c63
-rw-r--r--gcc/opts.h1
-rw-r--r--gcc/passes.c25
-rw-r--r--gcc/print-rtl.c7
-rw-r--r--gcc/rtl.c4
-rw-r--r--gcc/rtl.def4
-rw-r--r--gcc/rtl.h3
-rw-r--r--gcc/sched-vis.c13
-rw-r--r--gcc/testsuite/ChangeLog46
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/decltype18.C5
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/fntmpdefarg1.C7
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr41661.c20
-rw-r--r--gcc/testsuite/gcc.dg/debug/pr41264-1.c36
-rw-r--r--gcc/testsuite/gcc.dg/debug/pr41343-1.c20
-rw-r--r--gcc/testsuite/gcc.dg/guality/pr41447-1.c25
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090914-2_0.c4
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091006-2_0.c4
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091006-2_1.c1
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091006-2_2.c1
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091013-1_0.c21
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091013-1_1.c111
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091013-1_2.c220
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr26515.c27
-rw-r--r--gcc/testsuite/gfortran.dg/fmt_error_9.f4
-rw-r--r--gcc/tree-dump.c4
-rw-r--r--gcc/tree-flow.h6
-rw-r--r--gcc/tree-pretty-print.c3
-rw-r--r--gcc/tree-ssa-dce.c26
-rw-r--r--gcc/tree-ssa-forwprop.c8
-rw-r--r--gcc/tree-ssa-loop-im.c20
-rw-r--r--gcc/tree-ssa-operands.c4
-rw-r--r--gcc/tree-ssa-reassoc.c2
-rw-r--r--gcc/tree-ssa-sink.c7
-rw-r--r--gcc/tree-ssa.c240
-rw-r--r--gcc/tree-ssanames.c2
-rw-r--r--gcc/tree.c13
-rw-r--r--gcc/tree.def4
-rw-r--r--gcc/tree.h4
-rw-r--r--gcc/var-tracking.c41
-rw-r--r--libgfortran/ChangeLog6
-rw-r--r--libgfortran/io/format.c3
-rw-r--r--libstdc++-v3/ChangeLog50
-rw-r--r--libstdc++-v3/include/bits/random.h138
-rw-r--r--libstdc++-v3/include/parallel/for_each_selectors.h50
-rw-r--r--libstdc++-v3/include/precompiled/stdc++.h1
-rw-r--r--libstdc++-v3/include/std/random1
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/base_copy.cc2
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/base_move.cc2
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/default.cc2
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/seed1.cc2
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/seed2.cc2
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/seed_seq.cc2
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/operators/equal.cc2
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/operators/serialize.cc2
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/requirements/typedefs.cc2
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/requirements/non_uint_neg.cc2
-rw-r--r--lto-plugin/ChangeLog6
-rw-r--r--lto-plugin/Makefile.am2
-rw-r--r--lto-plugin/Makefile.in5
80 files changed, 1280 insertions, 351 deletions
diff --git a/ChangeLog b/ChangeLog
index 853bf1b7f2c..552f0457ae5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-10-13 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ * configure.ac: Add 'lto' to enable_languages, not
+ new_enable_languages, and only if not already present.
+ * configure: Regenerate.
+
2009-10-10 Gerald Pfeifer <gerald@pfeifer.com>
* README: Refer to the various COPYING* files instead of just
diff --git a/ChangeLog.MELT b/ChangeLog.MELT
index ca4ddfc542a..fdc4e6bedb2 100644
--- a/ChangeLog.MELT
+++ b/ChangeLog.MELT
@@ -1,4 +1,7 @@
+2009-10-13 Basile Starynkevitch <basile@starynkevitch.net>
+ MELT branch merged with trunk rev 152709
+
2009-10-12 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 152672
diff --git a/MAINTAINERS b/MAINTAINERS
index 4f75f969c20..0b122acc12a 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -454,6 +454,7 @@ Ghassan Shobaki ghassan.shobaki@amd.com
Johannes Singler singler@ira.uka.de
Franz Sirl franz.sirl-kernel@lauterbach.com
Jan Sjodin jan.sjodin@amd.com
+Edward Smith-Rowland 3dw4rd@verizon.net
Michael Sokolov msokolov@ivan.Harhan.ORG
Richard Stallman rms@gnu.org
Basile Starynkevitch basile@starynkevitch.net
diff --git a/configure b/configure
index 9875e9ef333..95e1278aa4c 100755
--- a/configure
+++ b/configure
@@ -6653,7 +6653,10 @@ if test -d ${srcdir}/gcc; then
# If LTO is enabled, add the LTO front end.
extra_host_libiberty_configure_flags=
if test "$enable_lto" = "yes" ; then
- new_enable_languages="${new_enable_languages}lto,"
+ case ,${enable_languages}, in
+ *,lto,*) ;;
+ *) enable_languages="${enable_languages},lto" ;;
+ esac
if test "${ENABLE_GOLD}" = "yes" ; then
configdirs="$configdirs lto-plugin"
extra_host_libiberty_configure_flags=--enable-shared
diff --git a/configure.ac b/configure.ac
index a43f3a64dad..328cf441085 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1837,7 +1837,10 @@ if test -d ${srcdir}/gcc; then
# If LTO is enabled, add the LTO front end.
extra_host_libiberty_configure_flags=
if test "$enable_lto" = "yes" ; then
- new_enable_languages="${new_enable_languages}lto,"
+ case ,${enable_languages}, in
+ *,lto,*) ;;
+ *) enable_languages="${enable_languages},lto" ;;
+ esac
if test "${ENABLE_GOLD}" = "yes" ; then
configdirs="$configdirs lto-plugin"
extra_host_libiberty_configure_flags=--enable-shared
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 0714158ea99..e2a71f9b5ce 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,106 @@
+
+2009-10-13 Basile Starynkevitch <basile@starynkevitch.net>
+ * passes.c (register_pass): Replaced gcc_unreachable by
+ fatal_error on failure. Mentions plugins in comments & messages.
+
+2009-10-13 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/41693
+ * rtl.h (DEBUG_EXPR_TREE_DECL): Define.
+ * sched-vis.c (print_value): Use it.
+ * cselib.c (cselib_hash_rtx): Likewise.
+ * print-rtl.c (print_rtx): Likewise.
+ * cfgexpand.c (expand_debug_rtx): Likewise.
+ * var-tracking.c (vt_expand_loc_callback): Likewise.
+
+2009-10-13 Richard Guenther <rguenther@suse.de>
+
+ PR lto/41565
+ * opts.c (handle_option): Split out code to handle setting
+ the options flag var ...
+ (set_option): ... here.
+ * opts.h (set_option): Declare.
+ * lto-opts.c (register_user_option_p): Include -fexceptions
+ and all position independent code variants.
+ (handle_common_option): Remove.
+ (lto_reissue_options): Use set_option.
+
+2009-10-13 Martin Jambor <mjambor@suse.cz>
+
+ PR tree-optimization/41661
+ * ipa-prop.c (compute_complex_pass_through): Allow only operations
+ that are tcc_comparisons or do not change the type in any
+ un-usleless way.
+ * ipa-cp.c (ipcp_lattice_from_jfunc): Request boolean type when
+ folding tcc_comparison operations.
+
+2009-10-13 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
+
+ * config/s390/s390.c (s390_encode_section_info): Handle BLKmode
+ properly.
+
+2009-10-12 Alexandre Oliva <aoliva@redhat.com>
+
+ PR debug/41343
+ PR debug/41447
+ PR debug/41264
+ PR debug/41338
+ * tree.def (DEBUG_EXPR_DECL): New.
+ * rtl.def (DEBUG_EXPR): New.
+ * gengtype.c (adjust_field_rtx_def): Handle it.
+ * tree-ssa.c (propagate_var_def_into_debug_stmts): Rename to...
+ (insert_debug_temp_for_var_def): ... this. Drop support for
+ moving. Take iterator for def stmt; insert debug stmt before it.
+ Scan early for use count and kind in debug stmts.
+ (propagate_defs_into_debug_stmts): Rename to...
+ (insert_debug_temps_for_defs): ... this. Likewise.
+ * tree.h (DEBUG_TEMP_UID): New.
+ * tree.c (next_debug_decl_uid): New.
+ (make_node_stat): Count debug decls separately.
+ (copy_node_stat): Likewise.
+ * cfgexpand.c (expand_debug_expr): Handle DEBUG_EXPR_DECL.
+ * var-tracking.c (dv_is_decl_p): Recognize it.
+ (VALUE_RECURSED_INTO): Apply to DEBUG_EXPRs too.
+ (track_expr_p): Track expanded DEBUG_EXPR_DECLs.
+ (vt_expand_loc_callback): Expand DEBUG_EXPRs.
+ (emit_note_insn_var_location): Don't emit notes for DEBUG_EXPR_DECLs.
+ * cselib.c (rtx_equal_for_cselib_p): Handle DEBUG_EXPR.
+ (cselib_hash_rtx): Likewise.
+ (cselib_expand_value_rtx_1): Use callback for DEBUG_EXPR.
+ * tree-ssa-operands.c (get_expr_operands): Skip DEBUG_EXPR_DECLs in
+ debug bind stmts.
+ * emit-rtl.c (verify_rtx_sharing): Handle DEBUG_EXPR and VALUE.
+ (copy_rtx_if_shared_1, reset_used_flags, set_used_flags): Likewise.
+ * rtl.c (copy_rtx): Likewise.
+ (rtx_equal_p_cb, rtx_equal_p): Handle DEBUG_EXPR.
+ * print-rtl.c (print_rtx): Likewise.
+ * sched-vis.c (print_value): Likewise.
+ (print_insn): Handle DEBUG_EXPR_DECL.
+ * tree-dump.c (dequeue_and_dump): Likewise.
+ * tree-pretty-print.c (dump_decl_name, dump_generic_node): Likewise.
+ * gimple-iterator (gsi_replace): Check for same lhs.
+ (gsi_remove): Insert debug temps.
+ * tree-ssa-loop-im.c (rewrite_reciprocal): Replace with same lhs.
+ (move_computations_stmt): Drop explicit propagation into debug stmts.
+ (rewrite_bittest): Likewise. Use gsi_remove for propagation.
+ * tree-ssa-reassoc.c (rewrite_expr_tree, linearize_expr): Likewise.
+ * tree-ssa-sink.c (statement_sink_location): Likewise.
+ * tree-ssa-forwprop (forward_propagate_addr_expr): Likewise.
+ * tree-ssanames.c (release_ssa_name): Adjust for rename.
+ * tree-flow.h: Likewise.
+ * tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Don't mark
+ debug temps without values.
+ (eliminate_unnecessary_stmts): Don't discard just-inserted
+ debug stmts.
+
+2009-10-12 Hans-Peter Nilsson <hp@axis.com>
+
+ PR target/26515
+ * config/cris/cris.md (andu): Check that operand 1 is one of the
+ general registers. Fix typo in head comment.
+
2009-10-12 Stefan Dösinger <stefan@codeweavers.com>
-
+
* config/i386/i386.md (vswapmov): New.
* config/i386/i386.c (ix86_handle_fndecl_attribute): New.
(ix86_function_ms_hook_prologue): New.
@@ -16,8 +117,7 @@
2009-10-12 Uros Bizjak <ubizjak@gmail.com>
- * config/i386/i386.md (*setcc_<mode>_2): Do not use ix86_expand_clear
- to zero operand 0.
+ * config/i386/i386.md (*setcc_<mode>_2): Remove insn pattern.
2009-10-12 Dodji Seketeli <dodji@redhat.com>
diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP
index ea0930452d6..f9ce01ff93c 100644
--- a/gcc/DATESTAMP
+++ b/gcc/DATESTAMP
@@ -1 +1 @@
-20091012
+20091013
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index 2117ee3bc52..6882954fab8 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -2361,6 +2361,18 @@ expand_debug_expr (tree exp)
op1 = wrap_constant (GET_MODE_INNER (mode), op1);
return gen_rtx_CONCAT (mode, op0, op1);
+ case DEBUG_EXPR_DECL:
+ op0 = DECL_RTL_IF_SET (exp);
+
+ if (op0)
+ return op0;
+
+ op0 = gen_rtx_DEBUG_EXPR (mode);
+ DEBUG_EXPR_TREE_DECL (op0) = exp;
+ SET_DECL_RTL (exp, op0);
+
+ return op0;
+
case VAR_DECL:
case PARM_DECL:
case FUNCTION_DECL:
diff --git a/gcc/config/cris/cris.md b/gcc/config/cris/cris.md
index 79eb8da3b0d..bd14a16337e 100644
--- a/gcc/config/cris/cris.md
+++ b/gcc/config/cris/cris.md
@@ -4936,7 +4936,7 @@
;; It should be:
;; movu.b some_byte,reg_32
;; and.b const,reg_32
-;; but is turns into:
+;; but it turns into:
;; move.b some_byte,reg_32
;; and.d const,reg_32
;; Fix it here.
@@ -4953,7 +4953,9 @@
"REGNO (operands[2]) == REGNO (operands[0])
&& INTVAL (operands[3]) <= 65535 && INTVAL (operands[3]) >= 0
&& !CRIS_CONST_OK_FOR_LETTER_P (INTVAL (operands[3]), 'I')
- && !side_effects_p (operands[1])"
+ && !side_effects_p (operands[1])
+ && (!REG_P (operands[1])
+ || REGNO (operands[1]) <= CRIS_LAST_GENERAL_REGISTER)"
;; FIXME: CC0 valid except for M (i.e. CC_NOT_NEGATIVE).
[(set (match_dup 0) (match_dup 4))
(set (match_dup 5) (match_dup 6))]
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 3fa938ea3bb..408787b8ab4 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -13823,20 +13823,6 @@
operands[2] = gen_lowpart (QImode, operands[0]);
})
-(define_insn_and_split "*setcc_<mode>_2"
- [(set (match_operand:SWI48 0 "register_operand" "=q")
- (match_operator:SWI48 1 "ix86_comparison_operator"
- [(reg FLAGS_REG) (const_int 0)]))]
- "TARGET_PARTIAL_REG_STALL"
- "#"
- "&& reload_completed"
- [(set (match_dup 0) (const_int 0))
- (set (strict_low_part (match_dup 2)) (match_dup 1))]
-{
- PUT_MODE (operands[1], QImode);
- operands[2] = gen_lowpart (QImode, operands[0]);
-})
-
(define_insn "*setcc_qi"
[(set (match_operand:QI 0 "nonimmediate_operand" "=qm")
(match_operator:QI 1 "ix86_comparison_operator"
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index e439b01709f..3be52d0d9a4 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -9003,6 +9003,7 @@ s390_encode_section_info (tree decl, rtx rtl, int first)
&& GET_CODE (XEXP (rtl, 0)) == SYMBOL_REF
&& TREE_CONSTANT_POOL_ADDRESS_P (XEXP (rtl, 0))
&& (MEM_ALIGN (rtl) == 0
+ || GET_MODE_BITSIZE (GET_MODE (rtl)) == 0
|| MEM_ALIGN (rtl) < GET_MODE_BITSIZE (GET_MODE (rtl))))
SYMBOL_REF_FLAGS (XEXP (rtl, 0)) |= SYMBOL_FLAG_NOT_NATURALLY_ALIGNED;
}
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index d2a46b2b1b2..7765c73b9de 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,14 @@
+2009-10-12 Jason Merrill <jason@redhat.com>
+
+ PR c++/37875
+ * parser.c (cp_parser_decltype): Set greater_than_is_operator_p.
+
+ PR c++/37766
+ * pt.c (type_unification_real): Call convert_template_argument
+ for function default template arguments.
+ (check_default_tmpl_args): Suggest -std=c++0x when function default
+ template args seen in C++98 mode.
+
2009-10-11 Jason Merrill <jason@redhat.com>
PR c++/37204
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 44dceb21f74..5e37343294b 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -9541,12 +9541,25 @@ cp_parser_decltype (cp_parser *parser)
cp_parser_parse_definitely (parser);
else
{
+ bool saved_greater_than_is_operator_p;
+
/* Abort our attempt to parse an id-expression or member access
expression. */
cp_parser_abort_tentative_parse (parser);
+ /* Within a parenthesized expression, a `>' token is always
+ the greater-than operator. */
+ saved_greater_than_is_operator_p
+ = parser->greater_than_is_operator_p;
+ parser->greater_than_is_operator_p = true;
+
/* Parse a full expression. */
expr = cp_parser_expression (parser, /*cast_p=*/false, NULL);
+
+ /* The `>' token might be the end of a template-id or
+ template-parameter-list now. */
+ parser->greater_than_is_operator_p
+ = saved_greater_than_is_operator_p;
}
/* Go back to evaluating expressions. */
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 148adab2cba..084ad1cb09f 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -4025,7 +4025,8 @@ check_default_tmpl_args (tree decl, tree parms, int is_primary,
else if (is_friend_decl)
msg = "default template arguments may not be used in function template friend declarations";
else if (TREE_CODE (decl) == FUNCTION_DECL && (cxx_dialect == cxx98))
- msg = "default template arguments may not be used in function templates";
+ msg = ("default template arguments may not be used in function templates "
+ "without -std=c++0x or -std=gnu++0x");
else if (is_partial)
msg = "default template arguments may not be used in partial specializations";
else
@@ -13178,9 +13179,11 @@ type_unification_real (tree tparms,
to explicitly check cxx_dialect here. */
if (TREE_PURPOSE (TREE_VEC_ELT (tparms, i)))
{
- tree arg = tsubst_template_arg
- (TREE_PURPOSE (TREE_VEC_ELT (tparms, i)),
- targs, tf_none, NULL_TREE);
+ tree parm = TREE_VALUE (TREE_VEC_ELT (tparms, i));
+ tree arg = TREE_PURPOSE (TREE_VEC_ELT (tparms, i));
+ arg = tsubst_template_arg (arg, targs, tf_none, NULL_TREE);
+ arg = convert_template_argument (parm, arg, targs, tf_none,
+ i, NULL_TREE);
if (arg == error_mark_node)
return 1;
else
diff --git a/gcc/cselib.c b/gcc/cselib.c
index e6e5c143dad..2bf466258f3 100644
--- a/gcc/cselib.c
+++ b/gcc/cselib.c
@@ -585,6 +585,7 @@ rtx_equal_for_cselib_p (rtx x, rtx y)
{
case CONST_DOUBLE:
case CONST_FIXED:
+ case DEBUG_EXPR:
return 0;
case LABEL_REF:
@@ -703,6 +704,11 @@ cselib_hash_rtx (rtx x, int create)
return e->value;
+ case DEBUG_EXPR:
+ hash += ((unsigned) DEBUG_EXPR << 7)
+ + DEBUG_TEMP_UID (DEBUG_EXPR_TREE_DECL (x));
+ return hash ? hash : (unsigned int) DEBUG_EXPR;
+
case CONST_INT:
hash += ((unsigned) CONST_INT << 7) + INTVAL (x);
return hash ? hash : (unsigned int) CONST_INT;
@@ -1213,6 +1219,13 @@ cselib_expand_value_rtx_1 (rtx orig, struct expand_value_data *evd,
result = expand_loc (CSELIB_VAL_PTR (orig)->locs, evd, max_depth);
return result;
}
+
+ case DEBUG_EXPR:
+ if (evd->callback)
+ return evd->callback (orig, evd->regs_active, max_depth,
+ evd->callback_arg);
+ return orig;
+
default:
break;
}
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index b3672e3e5ad..b8682984eca 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -2393,6 +2393,8 @@ verify_rtx_sharing (rtx orig, rtx insn)
switch (code)
{
case REG:
+ case DEBUG_EXPR:
+ case VALUE:
case CONST_INT:
case CONST_DOUBLE:
case CONST_FIXED:
@@ -2593,6 +2595,8 @@ repeat:
switch (code)
{
case REG:
+ case DEBUG_EXPR:
+ case VALUE:
case CONST_INT:
case CONST_DOUBLE:
case CONST_FIXED:
@@ -2712,6 +2716,8 @@ repeat:
switch (code)
{
case REG:
+ case DEBUG_EXPR:
+ case VALUE:
case CONST_INT:
case CONST_DOUBLE:
case CONST_FIXED:
@@ -2783,6 +2789,8 @@ set_used_flags (rtx x)
switch (code)
{
case REG:
+ case DEBUG_EXPR:
+ case VALUE:
case CONST_INT:
case CONST_DOUBLE:
case CONST_FIXED:
diff --git a/gcc/gengtype.c b/gcc/gengtype.c
index 4af00d7322e..6d5bbab16fa 100644
--- a/gcc/gengtype.c
+++ b/gcc/gengtype.c
@@ -1117,6 +1117,8 @@ adjust_field_rtx_def (type_p t, options_p ARG_UNUSED (opt))
t = scalar_tp, subname = "rt_int";
else if (i == VALUE && aindex == 0)
t = scalar_tp, subname = "rt_int";
+ else if (i == DEBUG_EXPR && aindex == 0)
+ t = tree_tp, subname = "rt_tree";
else if (i == REG && aindex == 1)
t = scalar_tp, subname = "rt_int";
else if (i == REG && aindex == 2)
diff --git a/gcc/gimple-iterator.c b/gcc/gimple-iterator.c
index 66927d67c2c..c3ca0e37501 100644
--- a/gcc/gimple-iterator.c
+++ b/gcc/gimple-iterator.c
@@ -358,7 +358,8 @@ gsi_split_seq_before (gimple_stmt_iterator *i)
/* Replace the statement pointed-to by GSI to STMT. If UPDATE_EH_INFO
is true, the exception handling information of the original
- statement is moved to the new statement. */
+ statement is moved to the new statement. Assignments must only be
+ replaced with assignments to the same LHS. */
void
gsi_replace (gimple_stmt_iterator *gsi, gimple stmt, bool update_eh_info)
@@ -368,6 +369,9 @@ gsi_replace (gimple_stmt_iterator *gsi, gimple stmt, bool update_eh_info)
if (stmt == orig_stmt)
return;
+ gcc_assert (!gimple_has_lhs (orig_stmt)
+ || gimple_get_lhs (orig_stmt) == gimple_get_lhs (stmt));
+
gimple_set_location (stmt, gimple_location (orig_stmt));
gimple_set_bb (stmt, gsi_bb (*gsi));
@@ -470,6 +474,8 @@ gsi_remove (gimple_stmt_iterator *i, bool remove_permanently)
gimple_seq_node cur, next, prev;
gimple stmt = gsi_stmt (*i);
+ insert_debug_temps_for_defs (i);
+
/* Free all the data flow information for STMT. */
gimple_set_bb (stmt, NULL);
delink_stmt_imm_use (stmt);
diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c
index 59a051915f6..7e499ca27fa 100644
--- a/gcc/ipa-cp.c
+++ b/gcc/ipa-cp.c
@@ -299,9 +299,16 @@ ipcp_lattice_from_jfunc (struct ipa_node_params *info, struct ipcp_lattice *lat,
cst = caller_lat->constant;
if (jfunc->value.pass_through.operation != NOP_EXPR)
- cst = fold_binary (jfunc->value.pass_through.operation,
- TREE_TYPE (cst), cst,
- jfunc->value.pass_through.operand);
+ {
+ tree restype;
+ if (TREE_CODE_CLASS (jfunc->value.pass_through.operation)
+ == tcc_comparison)
+ restype = boolean_type_node;
+ else
+ restype = TREE_TYPE (cst);
+ cst = fold_binary (jfunc->value.pass_through.operation,
+ restype, cst, jfunc->value.pass_through.operand);
+ }
if (!cst || !is_gimple_ip_invariant (cst))
lat->type = IPA_BOTTOM;
lat->constant = cst;
diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c
index 0e6aaf51168..93c407b0826 100644
--- a/gcc/ipa-prop.c
+++ b/gcc/ipa-prop.c
@@ -357,6 +357,9 @@ compute_complex_pass_through (struct ipa_node_params *info,
{
if (TREE_CODE (op1) != SSA_NAME
|| !SSA_NAME_IS_DEFAULT_DEF (op1)
+ || (TREE_CODE_CLASS (gimple_expr_code (stmt)) != tcc_comparison
+ && !useless_type_conversion_p (TREE_TYPE (name),
+ TREE_TYPE (op1)))
|| !is_gimple_ip_invariant (op2))
return;
diff --git a/gcc/lto-opts.c b/gcc/lto-opts.c
index 2a379f40fdc..fd485b9db60 100644
--- a/gcc/lto-opts.c
+++ b/gcc/lto-opts.c
@@ -208,10 +208,19 @@ input_string_block (struct lto_input_block *ib)
static bool
register_user_option_p (size_t code, int type)
{
- return type == CL_TARGET
- || (type == CL_COMMON
- && (code == OPT_fPIC
- || code == OPT_fcommon));
+ if (type == CL_TARGET)
+ return true;
+ else if (type == CL_COMMON)
+ {
+ return (code == OPT_fPIC
+ || code == OPT_fpic
+ || code == OPT_fPIE
+ || code == OPT_fpie
+ || code == OPT_fcommon
+ || code == OPT_fexceptions);
+ }
+
+ return false;
}
/* Note command line option with the given TYPE and CODE, ARG, and VALUE.
@@ -358,32 +367,6 @@ lto_read_file_options (struct lto_file_decl_data *file_data)
lto_free_section_data (file_data, LTO_section_opts, 0, data, len);
}
-/* Re-handle option with type TYPE and CODE, ARG, and VALUE. Logic extracted
- from common_handle_option() in opts.c.
-
- FIXME lto. This section is not complete. If extended to handle
- optimization options, note that changing these after opts.c prescan may
- involve also adjusting other options that were defaulted from initial
- optimization option values. */
-
-static void
-handle_common_option (size_t code, const char *arg ATTRIBUTE_UNUSED, int value)
-{
- switch (code)
- {
- case OPT_fPIC:
- flag_pic = !!value;
- break;
-
- case OPT_fcommon:
- flag_no_common = !value;
- break;
-
- default:
- gcc_unreachable ();
- }
-}
-
/* Concatenate the user options and any file options read from an LTO IL
file, and reissue them as if all had just been read in from the command
line. As with serialization, file options precede user options. */
@@ -397,10 +380,15 @@ lto_reissue_options (void)
for (i = 0; VEC_iterate (opt_t, opts, i, o); i++)
{
+ const struct cl_option *option = &cl_options[o->code];
+
+ if (option->flag_var)
+ set_option (option, o->value, o->arg);
+
if (o->type == CL_TARGET)
targetm.handle_option (o->code, o->arg, o->value);
else if (o->type == CL_COMMON)
- handle_common_option (o->code, o->arg, o->value);
+ gcc_assert (option->flag_var);
else
gcc_unreachable ();
}
diff --git a/gcc/opts.c b/gcc/opts.c
index b12ed14c21d..51a0cb95419 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -610,32 +610,7 @@ handle_option (const char **argv, unsigned int lang_mask)
}
if (option->flag_var)
- switch (option->var_type)
- {
- case CLVC_BOOLEAN:
- *(int *) option->flag_var = value;
- break;
-
- case CLVC_EQUAL:
- *(int *) option->flag_var = (value
- ? option->var_value
- : !option->var_value);
- break;
-
- case CLVC_BIT_CLEAR:
- case CLVC_BIT_SET:
- if ((value != 0) == (option->var_type == CLVC_BIT_SET))
- *(int *) option->flag_var |= option->var_value;
- else
- *(int *) option->flag_var &= ~option->var_value;
- if (option->flag_var == &target_flags)
- target_flags_explicit |= option->var_value;
- break;
-
- case CLVC_STRING:
- *(const char **) option->flag_var = arg;
- break;
- }
+ set_option (option, value, arg);
if (option->flags & lang_mask)
{
@@ -2349,6 +2324,42 @@ get_option_state (int option, struct cl_option_state *state)
return true;
}
+/* Set *OPTION according to VALUE and ARG. */
+
+void
+set_option (const struct cl_option *option, int value, const char *arg)
+{
+ if (!option->flag_var)
+ return;
+
+ switch (option->var_type)
+ {
+ case CLVC_BOOLEAN:
+ *(int *) option->flag_var = value;
+ break;
+
+ case CLVC_EQUAL:
+ *(int *) option->flag_var = (value
+ ? option->var_value
+ : !option->var_value);
+ break;
+
+ case CLVC_BIT_CLEAR:
+ case CLVC_BIT_SET:
+ if ((value != 0) == (option->var_type == CLVC_BIT_SET))
+ *(int *) option->flag_var |= option->var_value;
+ else
+ *(int *) option->flag_var &= ~option->var_value;
+ if (option->flag_var == &target_flags)
+ target_flags_explicit |= option->var_value;
+ break;
+
+ case CLVC_STRING:
+ *(const char **) option->flag_var = arg;
+ break;
+ }
+}
+
/* Enable a warning option as an error. This is used by -Werror= and
also by legacy Werror-implicit-function-declaration. */
diff --git a/gcc/opts.h b/gcc/opts.h
index b4be1111675..a2eef1938c7 100644
--- a/gcc/opts.h
+++ b/gcc/opts.h
@@ -103,6 +103,7 @@ extern void prune_options (int *argcp, char ***argvp);
extern void decode_options (unsigned int argc, const char **argv);
extern int option_enabled (int opt_idx);
extern bool get_option_state (int, struct cl_option_state *);
+extern void set_option (const struct cl_option *, int, const char *);
extern void enable_warning_as_error (const char *arg, int value,
unsigned int lang_mask);
diff --git a/gcc/passes.c b/gcc/passes.c
index 5ed12060739..5a472156aa2 100644
--- a/gcc/passes.c
+++ b/gcc/passes.c
@@ -600,24 +600,31 @@ position_pass (struct register_pass_info *new_pass_info,
void
register_pass (struct register_pass_info *pass_info)
{
+ /* The checks below could fail in buggy plugins. Existing GCC
+ passes should never fail these checks, so we mention plugin in
+ the messages. */
if (!pass_info->pass)
- {
- gcc_unreachable ();
- }
+ fatal_error ("plugin cannot register a missing pass");
+
+ if (!pass_info->pass->name)
+ fatal_error ("plugin cannot register an unnamed pass");
if (!pass_info->reference_pass_name)
- {
- gcc_unreachable ();
- }
+ fatal_error
+ ("plugin cannot register pass %qs without reference pass name",
+ pass_info->pass->name);
- /* Try to insert the new pass to the pass lists. We need to check all
- three lists as the reference pass could be in one (or all) of them. */
+ /* Try to insert the new pass to the pass lists. We need to check
+ all three lists as the reference pass could be in one (or all) of
+ them. */
if (!position_pass (pass_info, &all_lowering_passes)
&& !position_pass (pass_info, &all_small_ipa_passes)
&& !position_pass (pass_info, &all_regular_ipa_passes)
&& !position_pass (pass_info, &all_lto_gen_passes)
&& !position_pass (pass_info, &all_passes))
- gcc_unreachable ();
+ fatal_error
+ ("pass %qs not found but is referenced by new pass %qs",
+ pass_info->reference_pass_name, pass_info->pass->name);
else
{
/* OK, we have successfully inserted the new pass. We need to register
diff --git a/gcc/print-rtl.c b/gcc/print-rtl.c
index a75442eb6c7..29d3ab91832 100644
--- a/gcc/print-rtl.c
+++ b/gcc/print-rtl.c
@@ -318,6 +318,13 @@ print_rtx (const_rtx in_rtx)
dump_addr (outfile, "/", (void*)val);
#endif
}
+ else if (i == 0 && GET_CODE (in_rtx) == DEBUG_EXPR)
+ {
+#ifndef GENERATOR_FILE
+ fprintf (outfile, " D#%i",
+ DEBUG_TEMP_UID (DEBUG_EXPR_TREE_DECL (in_rtx)));
+#endif
+ }
break;
case 'e':
diff --git a/gcc/rtl.c b/gcc/rtl.c
index feeb40bf61b..53a4992f482 100644
--- a/gcc/rtl.c
+++ b/gcc/rtl.c
@@ -232,6 +232,8 @@ copy_rtx (rtx orig)
switch (code)
{
case REG:
+ case DEBUG_EXPR:
+ case VALUE:
case CONST_INT:
case CONST_DOUBLE:
case CONST_FIXED:
@@ -381,6 +383,7 @@ rtx_equal_p_cb (const_rtx x, const_rtx y, rtx_equal_p_callback_function cb)
case SYMBOL_REF:
return XSTR (x, 0) == XSTR (y, 0);
+ case DEBUG_EXPR:
case VALUE:
case SCRATCH:
case CONST_DOUBLE:
@@ -496,6 +499,7 @@ rtx_equal_p (const_rtx x, const_rtx y)
case SYMBOL_REF:
return XSTR (x, 0) == XSTR (y, 0);
+ case DEBUG_EXPR:
case VALUE:
case SCRATCH:
case CONST_DOUBLE:
diff --git a/gcc/rtl.def b/gcc/rtl.def
index 2aa76b1f6c8..acb7ee915b8 100644
--- a/gcc/rtl.def
+++ b/gcc/rtl.def
@@ -88,6 +88,10 @@ DEF_RTL_EXPR(UNKNOWN, "UnKnown", "*", RTX_EXTRA)
DECL codes in trees. */
DEF_RTL_EXPR(VALUE, "value", "0", RTX_OBJ)
+/* The RTL generated for a DEBUG_EXPR_DECL. It links back to the
+ DEBUG_EXPR_DECL in the first operand. */
+DEF_RTL_EXPR(DEBUG_EXPR, "debug_expr", "0", RTX_OBJ)
+
/* ---------------------------------------------------------------------
Expressions used in constructing lists.
--------------------------------------------------------------------- */
diff --git a/gcc/rtl.h b/gcc/rtl.h
index a7be009b619..d5dbd1eb5f1 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -930,6 +930,9 @@ extern const char * const reg_note_name[];
#define NOTE_DURING_CALL_P(RTX) \
(RTL_FLAG_CHECK1("NOTE_VAR_LOCATION_DURING_CALL_P", (RTX), NOTE)->call)
+/* DEBUG_EXPR_DECL corresponding to a DEBUG_EXPR RTX. */
+#define DEBUG_EXPR_TREE_DECL(RTX) XCTREE (RTX, 0, DEBUG_EXPR)
+
/* Possible initialization status of a variable. When requested
by the user, this information is tracked and recorded in the DWARF
debug information, along with the variable's location. */
diff --git a/gcc/sched-vis.c b/gcc/sched-vis.c
index 89230efa34c..906e9c31f2a 100644
--- a/gcc/sched-vis.c
+++ b/gcc/sched-vis.c
@@ -521,6 +521,10 @@ print_value (char *buf, const_rtx x, int verbose)
cur = safe_concat (buf, cur, t);
cur = safe_concat (buf, cur, "]");
break;
+ case DEBUG_EXPR:
+ sprintf (t, "D#%i", DEBUG_TEMP_UID (DEBUG_EXPR_TREE_DECL (x)));
+ cur = safe_concat (buf, cur, t);
+ break;
default:
print_exp (t, x, verbose);
cur = safe_concat (buf, cur, t);
@@ -670,11 +674,18 @@ print_insn (char *buf, const_rtx x, int verbose)
if (DECL_P (INSN_VAR_LOCATION_DECL (insn)))
{
tree id = DECL_NAME (INSN_VAR_LOCATION_DECL (insn));
+ char idbuf[32];
if (id)
name = IDENTIFIER_POINTER (id);
+ else if (TREE_CODE (INSN_VAR_LOCATION_DECL (insn))
+ == DEBUG_EXPR_DECL)
+ {
+ sprintf (idbuf, "D#%i",
+ DEBUG_TEMP_UID (INSN_VAR_LOCATION_DECL (insn)));
+ name = idbuf;
+ }
else
{
- char idbuf[32];
sprintf (idbuf, "D.%i",
DECL_UID (INSN_VAR_LOCATION_DECL (insn)));
name = idbuf;
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 6f07c4bfbf5..95cddc46651 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,49 @@
+2009-10-13 Richard Guenther <rguenther@suse.de>
+
+ PR lto/41668
+ * gcc.dg/lto/20091006-2_0.c: New testcase.
+ * gcc.dg/lto/20091006-2_1.c: Likewise.
+ * gcc.dg/lto/20091006-2_2.c: Likewise.
+ * gcc.dg/lto/20091013-1_0.c: Likewise.
+ * gcc.dg/lto/20091013-1_1.c: Likewise.
+ * gcc.dg/lto/20091013-1_2.c: Likewise.
+
+2009-10-13 Martin Jambor <mjambor@suse.cz>
+
+ * gcc.c-torture/compile/pr41661.c: New test.
+
+2009-10-12 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libgfortran/41683
+ * gfortran.dg/fmt_error_9.f: Add check for repeat count after P.
+
+2009-10-12 Jason Merrill <jason@redhat.com>
+
+ PR c++/37875
+ * g++.dg/cpp0x/decltype18.C: New.
+
+ PR c++/37766
+ * g++.dg/cpp0x/fntmpdefarg1.C: New.
+
+2009-10-12 Janis Johnson <janis187@us.ibm.com>
+
+ * gcc.dg/lto/20090914-2.c: Fix typos in test directives.
+
+2009-10-12 Alexandre Oliva <aoliva@redhat.com>
+
+ PR debug/41343
+ PR debug/41447
+ PR debug/41264
+ PR debug/41338
+ * gcc.dg/guality/pr41447-1.c: New.
+ * gcc.dg/debug/pr41264-1.c: New.
+ * gcc.dg/debug/pr41343-1.c: New.
+
+2009-10-12 Hans-Peter Nilsson <hp@axis.com>
+
+ PR target/26515
+ * gcc.dg/torture/pr26515.c: New test.
+
2009-10-12 Janis Johnson <janis187@us.ibm.com>
PR testsuite/41659
diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype18.C b/gcc/testsuite/g++.dg/cpp0x/decltype18.C
new file mode 100644
index 00000000000..0d44586e9d2
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/decltype18.C
@@ -0,0 +1,5 @@
+// PR c++/37875
+// { dg-options "-std=c++0x" }
+
+template <typename> struct X {};
+X<decltype(1 > 2)> x;
diff --git a/gcc/testsuite/g++.dg/cpp0x/fntmpdefarg1.C b/gcc/testsuite/g++.dg/cpp0x/fntmpdefarg1.C
new file mode 100644
index 00000000000..25192ad8672
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/fntmpdefarg1.C
@@ -0,0 +1,7 @@
+// PR c++/37766
+// { dg-options -std=c++0x }
+
+int a = 1;
+template<int& b = a> void f() {
+ f<>();
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr41661.c b/gcc/testsuite/gcc.c-torture/compile/pr41661.c
new file mode 100644
index 00000000000..658e4288b8d
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr41661.c
@@ -0,0 +1,20 @@
+/* PR tree-optimization/41661 */
+/* { dg-do compile } */
+/* { dg-options "-fno-early-inlining" } */
+
+int g;
+
+void foo (int x)
+{
+ g = x;
+}
+
+void bar (double d)
+{
+ foo (d == 1);
+}
+
+void baz (int a)
+{
+ bar (1);
+}
diff --git a/gcc/testsuite/gcc.dg/debug/pr41264-1.c b/gcc/testsuite/gcc.dg/debug/pr41264-1.c
new file mode 100644
index 00000000000..b5555b554ba
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/pr41264-1.c
@@ -0,0 +1,36 @@
+/* { dg-do compile } */
+
+typedef unsigned int hashval_t;
+static hashval_t __attribute__((always_inline))
+iterative_hash_host_wide_int (long val, hashval_t val2)
+{
+ hashval_t a = (hashval_t) val;
+ int zero = 0;
+ hashval_t b = (hashval_t) (val >> (sizeof (hashval_t) * 8 + zero));
+
+ a -= b; a -= val2; a ^= (val2>>13);
+ b -= val2; b -= a; b ^= (a<< 8);
+ val2 -= a; val2 -= b; val2 ^= ((b&0xffffffff)>>13);
+ a -= b; a -= val2; a ^= ((val2&0xffffffff)>>12);
+ b -= val2; b -= a; b = (b ^ (a<<16)) & 0xffffffff;
+ val2 -= a; val2 -= b; val2 = (val2 ^ (b>> 5)) & 0xffffffff;
+ a -= b; a -= val2; a = (a ^ (val2>> 3)) & 0xffffffff;
+ b -= val2; b -= a; b = (b ^ (a<<10)) & 0xffffffff;
+ val2 -= a; val2 -= b; val2 = (val2 ^ (b>>15)) & 0xffffffff;
+ return val2;
+}
+
+hashval_t
+bla (int nunits, int mode)
+{
+ hashval_t hashcode = 0;
+
+
+ hashcode = iterative_hash_host_wide_int (14, hashcode);
+ hashcode = iterative_hash_host_wide_int (nunits, hashcode);
+ hashcode = iterative_hash_host_wide_int (mode, hashcode);
+ if (nunits)
+ return 0;
+ else
+ return hashcode;
+}
diff --git a/gcc/testsuite/gcc.dg/debug/pr41343-1.c b/gcc/testsuite/gcc.dg/debug/pr41343-1.c
new file mode 100644
index 00000000000..6d56380383d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/pr41343-1.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+
+#define X(new,old) int i ## new = i ## old + i ## old;
+#define Y(pfx) X(pfx ## 1, pfx) \
+ X(pfx ## 2, pfx ## 1) \
+ X(pfx ## 3, pfx ## 2) \
+ X(pfx ## 4, pfx ## 3) \
+ X(pfx ## 5, pfx ## 4) \
+ X(pfx ## 6, pfx ## 5) \
+ X(pfx ## 7, pfx ## 6) \
+ X(pfx ## 8, pfx ## 7) \
+ X(pfx ## 9, pfx ## 8)
+
+void foo (int i1)
+{
+ Y(1)
+ Y(11)
+ Y(111)
+ asm ("" : : "X" (i1));
+}
diff --git a/gcc/testsuite/gcc.dg/guality/pr41447-1.c b/gcc/testsuite/gcc.dg/guality/pr41447-1.c
new file mode 100644
index 00000000000..675b0304661
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/guality/pr41447-1.c
@@ -0,0 +1,25 @@
+/* { dg-do run { xfail *-*-* } } */
+/* { dg-options "-g -O2" } */
+
+#include "guality.h"
+
+int a;
+
+int foo()
+{
+ int tmp = a;
+ int tmp2 = a;
+ int tmp3;
+ int res;
+ GUALCHKVAL (a);
+ GUALCHKVAL (tmp);
+ GUALCHKVAL (tmp2);
+ a = 0;
+ tmp3 = tmp2;
+ GUALCHKVAL (a);
+ GUALCHKVAL (tmp);
+ GUALCHKVAL (tmp2);
+ GUALCHKVAL (tmp3);
+ res = tmp - tmp2 + 1;
+ return res;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20090914-2_0.c b/gcc/testsuite/gcc.dg/lto/20090914-2_0.c
index 908af697ff8..906b3c44196 100644
--- a/gcc/testsuite/gcc.dg/lto/20090914-2_0.c
+++ b/gcc/testsuite/gcc.dg/lto/20090914-2_0.c
@@ -1,5 +1,5 @@
-/* { dg-lto-do run */
-/* { dg-skip-if "x86 only" { ! { x86_64-*-* i?86-*-* } } { "*" } { "" } }
+/* { dg-lto-do run } */
+/* { dg-skip-if "x86 only" { ! { x86_64-*-* i?86-*-* } } { "*" } { "" } } */
/* Doesn't work without this dummy function with -fwhopr. */
int foo(void) { }
diff --git a/gcc/testsuite/gcc.dg/lto/20091006-2_0.c b/gcc/testsuite/gcc.dg/lto/20091006-2_0.c
new file mode 100644
index 00000000000..f8189920cfd
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091006-2_0.c
@@ -0,0 +1,4 @@
+/* { dg-lto-do link } */
+
+extern int a[10];
+int main() { return 0; }
diff --git a/gcc/testsuite/gcc.dg/lto/20091006-2_1.c b/gcc/testsuite/gcc.dg/lto/20091006-2_1.c
new file mode 100644
index 00000000000..581839344c1
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091006-2_1.c
@@ -0,0 +1 @@
+int a[16];
diff --git a/gcc/testsuite/gcc.dg/lto/20091006-2_2.c b/gcc/testsuite/gcc.dg/lto/20091006-2_2.c
new file mode 100644
index 00000000000..a610b2b1292
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091006-2_2.c
@@ -0,0 +1 @@
+extern int a[14];
diff --git a/gcc/testsuite/gcc.dg/lto/20091013-1_0.c b/gcc/testsuite/gcc.dg/lto/20091013-1_0.c
new file mode 100644
index 00000000000..e1a7dc86b6b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091013-1_0.c
@@ -0,0 +1,21 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-fPIC -shared -flto} {-fPIC -shared -O2 -flto}} } */
+
+void * HeapAlloc(void*,unsigned int,unsigned long);
+
+typedef struct tagGdiFont GdiFont;
+
+typedef struct tagDC {
+ int xunused;
+ GdiFont *gdiFont;
+ unsigned int font_code_page;
+} DC;
+
+DC *alloc_dc_ptr( void *funcs, unsigned short magic )
+{
+ DC *dc;
+ if (!(dc = HeapAlloc( 0, 0, sizeof(*dc) ))) return ((void *)0);
+ dc->gdiFont = 0;
+ return dc;
+}
+
diff --git a/gcc/testsuite/gcc.dg/lto/20091013-1_1.c b/gcc/testsuite/gcc.dg/lto/20091013-1_1.c
new file mode 100644
index 00000000000..68294fa62cb
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091013-1_1.c
@@ -0,0 +1,111 @@
+typedef struct HDC__ { int unused; } *HDC;
+typedef struct HFONT__ { int unused; } *HFONT;
+
+typedef struct
+{
+ unsigned int ciACP;
+} CHARSETINFO, *PCHARSETINFO, *LPCHARSETINFO;
+
+typedef struct tagTEXTMETRICW
+{
+ int tmCharSet;
+} TEXTMETRICW, *LPTEXTMETRICW, *PTEXTMETRICW;
+
+struct gdi_obj_funcs
+{
+ void* (*pSelectObject)( void* handle, void* hdc );
+};
+
+typedef struct tagGdiFont GdiFont;
+
+typedef struct tagDC
+{
+ int xunused;
+ GdiFont *gdiFont;
+ unsigned int font_code_page;
+} DC;
+
+extern GdiFont* WineEngCreateFontInstance(DC*, HFONT);
+extern unsigned int WineEngGetTextCharsetInfo(GdiFont *font, void* fs, unsigned int flags);
+extern int WineEngGetTextMetrics(GdiFont*, LPTEXTMETRICW);
+extern void* alloc_gdi_handle( void *obj, unsigned short type, const struct gdi_obj_funcs *funcs );
+
+enum __wine_debug_class
+{
+ __WINE_DBCL_FIXME,
+ __WINE_DBCL_ERR,
+ __WINE_DBCL_WARN,
+ __WINE_DBCL_TRACE,
+
+ __WINE_DBCL_INIT = 7
+};
+
+struct __wine_debug_channel
+{
+ unsigned char flags;
+ char name[15];
+};
+
+extern int wine_dbg_log( enum __wine_debug_class cls, struct __wine_debug_channel *ch, const char *func,
+ const char *format, ... ) __attribute__((format (printf,4,5)));
+
+static struct __wine_debug_channel __wine_dbch_font = { ~0, "font" };
+static struct __wine_debug_channel * const __wine_dbch___default = &__wine_dbch_font;
+
+static void* FONT_SelectObject( void* handle, void* hdc );
+
+static const struct gdi_obj_funcs font_funcs =
+{
+ FONT_SelectObject,
+};
+
+HFONT CreateFontIndirectW( const void *plf )
+{
+ return alloc_gdi_handle( 0, 6, &font_funcs );
+}
+
+static void update_font_code_page( DC *dc )
+{
+ CHARSETINFO csi;
+ int charset = (unsigned char)1;
+
+ if (dc->gdiFont)
+ charset = WineEngGetTextCharsetInfo( dc->gdiFont, ((void *)0), 0 );
+
+ if (TranslateCharsetInfo( ((void *)(unsigned long)((unsigned long)charset)), &csi, 1) )
+ dc->font_code_page = csi.ciACP;
+ else {
+ switch(charset) {
+ case (unsigned char)1:
+ dc->font_code_page = GetACP();
+ break;
+
+ case (unsigned char)246:
+ dc->font_code_page = 0;
+ break;
+
+ default:
+ do { if((((__wine_dbch___default))->flags & (1 << __WINE_DBCL_FIXME))) { struct __wine_debug_channel * const __dbch = (__wine_dbch___default); const enum __wine_debug_class __dbcl = __WINE_DBCL_FIXME; wine_dbg_log( __dbcl, __dbch, __FUNCTION__, "Can't find codepage for charset %d\n", charset); } } while(0);
+ dc->font_code_page = 0;
+ break;
+ }
+ }
+
+ do { if((((__wine_dbch___default))->flags & (1 << __WINE_DBCL_TRACE))) { struct __wine_debug_channel * const __dbch = (__wine_dbch___default); const enum __wine_debug_class __dbcl = __WINE_DBCL_TRACE; wine_dbg_log( __dbcl, __dbch, __FUNCTION__, "charset %d => cp %d\n", charset, dc->font_code_page); } } while(0);
+}
+
+static void* FONT_SelectObject( void* handle, void* hdc )
+{
+ DC *dc;
+
+ dc->gdiFont = WineEngCreateFontInstance( dc, handle );
+ update_font_code_page( dc );
+ return 0;
+}
+
+int GetTextMetricsW( HDC hdc, TEXTMETRICW *metrics )
+{
+ DC * dc;
+ return WineEngGetTextMetrics(dc->gdiFont, metrics);
+}
+
diff --git a/gcc/testsuite/gcc.dg/lto/20091013-1_2.c b/gcc/testsuite/gcc.dg/lto/20091013-1_2.c
new file mode 100644
index 00000000000..55f8ca1b46d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091013-1_2.c
@@ -0,0 +1,220 @@
+typedef struct HDC__ { int unused; } *HDC;
+typedef struct HFONT__ { int unused; } *HFONT;
+
+void* HeapAlloc(void*,unsigned int,unsigned long);
+
+typedef struct tagLOGFONTW
+{
+ int lfPitchAndFamily;
+ unsigned short lfFaceName[32];
+} LOGFONTW, *PLOGFONTW, *LPLOGFONTW;
+
+typedef struct tagGdiFont GdiFont;
+typedef struct tagDC DC;
+
+extern unsigned int WineEngGetFontData(GdiFont*, unsigned int, unsigned int, void*, unsigned int);
+
+struct list
+{
+ struct list *next;
+ struct list *prev;
+};
+
+typedef struct FT_FaceRec_
+{
+ signed long face_flags;
+} FT_FaceRec, *FT_Face;
+
+typedef struct { } GM;
+
+typedef struct { } FMAT2;
+
+typedef struct {
+ unsigned int hash;
+ LOGFONTW lf;
+ int can_use_bitmap;
+} FONT_DESC;
+
+
+
+typedef struct tagHFONTLIST {
+ struct list entry;
+ HFONT hfont;
+} HFONTLIST;
+
+typedef struct {
+ struct list entry;
+ void *face;
+ GdiFont *font;
+} CHILD_FONT;
+
+
+struct tagGdiFont {
+ struct list entry;
+ GM **gm;
+ struct list hfontlist;
+ struct list child_fonts;
+
+ FT_Face ft_face;
+ FONT_DESC font_desc;
+ long ppem;
+};
+
+
+
+static struct list gdi_font_list = { &(gdi_font_list), &(gdi_font_list) };
+
+
+
+
+static int get_glyph_index_linked(GdiFont *font, unsigned int c, GdiFont **linked_font, unsigned int *glyph);
+static long load_VDMX(GdiFont*, long);
+
+extern int f1(void*,int);
+
+static FT_Face OpenFontFace(GdiFont *font, void *face, long width, long height)
+{
+ FT_Face ft_face;
+
+ font->ppem = load_VDMX(font, height);
+ if(font->ppem == 0)
+ font->ppem = f1(ft_face, height);
+ return ft_face;
+}
+
+
+static GdiFont *alloc_font(void)
+{
+ GdiFont *ret = HeapAlloc(0, 0x00000008, sizeof(*ret));
+ ret->gm = HeapAlloc(0, 0x00000008, sizeof(GM*));
+ return ret;
+}
+
+
+static long load_VDMX(GdiFont *font,long height)
+{
+ unsigned short hdr[3];
+
+ WineEngGetFontData(font, 0x42424242, 0, hdr, 6);
+ return 0;
+}
+
+static int fontcmp(const GdiFont *font, FONT_DESC *fd)
+{
+ if(font->font_desc.hash != fd->hash) return 1;
+ if(memcmp(&font->font_desc.lf, &fd->lf, __builtin_offsetof (LOGFONTW, lfFaceName))) return 1;
+ if(!font->font_desc.can_use_bitmap != !fd->can_use_bitmap) return 1;
+ return strcmpiW(font->font_desc.lf.lfFaceName, fd->lf.lfFaceName);
+}
+
+static GdiFont *find_in_cache(HFONT hfont, const LOGFONTW *plf, const FMAT2 *pmat, int can_use_bitmap)
+{
+ GdiFont *ret;
+ FONT_DESC fd;
+ HFONTLIST *hflist;
+ struct list *font_elem_ptr, *hfontlist_elem_ptr;
+
+ fd.lf = *plf;
+ fd.can_use_bitmap = can_use_bitmap;
+
+
+ for ((font_elem_ptr) = (&gdi_font_list)->next; (font_elem_ptr) != (&gdi_font_list); (font_elem_ptr) = (font_elem_ptr)->next) {
+ ret = ((struct tagGdiFont *)((char *)(font_elem_ptr) - (unsigned long)(&((struct tagGdiFont *)0)->entry)));
+ if(!fontcmp(ret, &fd)) {
+ if(!can_use_bitmap && !( ret->ft_face->face_flags & ( 1L << 0 ) )) continue;
+ for ((hfontlist_elem_ptr) = (&ret->hfontlist)->next; (hfontlist_elem_ptr) != (&ret->hfontlist); (hfontlist_elem_ptr) = (hfontlist_elem_ptr)->next) {
+ hflist = ((struct tagHFONTLIST *)((char *)(hfontlist_elem_ptr) - (unsigned long)(&((struct tagHFONTLIST *)0)->entry)));
+ if(hflist->hfont == hfont)
+ return ret;
+ }
+ hflist = HeapAlloc(0, 0, sizeof(*hflist));
+ hflist->hfont = hfont;
+ return ret;
+ }
+ }
+
+ while(font_elem_ptr) {
+ ret = ((struct tagGdiFont *)((char *)(font_elem_ptr) - (unsigned long)(&((struct tagGdiFont *)0)->entry)));
+ if(!fontcmp(ret, &fd)) {
+ if(!can_use_bitmap && !( ret->ft_face->face_flags & ( 1L << 0 ) )) continue;
+ hflist = HeapAlloc(0, 0, sizeof(*hflist));
+ hflist->hfont = hfont;
+ return ret;
+ }
+ }
+ return ((void *)0);
+}
+
+
+
+
+GdiFont *WineEngCreateFontInstance(DC *dc, HFONT hfont)
+{
+ GdiFont *ret;
+ int can_use_bitmap;
+ LOGFONTW lf;
+ FMAT2 dcmat;
+
+ if((ret = find_in_cache(hfont, &lf, &dcmat, can_use_bitmap)) != ((void *)0))
+ return ret;
+ return alloc_font();
+}
+
+extern unsigned int f(void*,unsigned int g);
+
+static unsigned int get_glyph_index(void*font, unsigned int glyph)
+{
+ return f(font, glyph);
+}
+
+unsigned int WineEngGetGlyphOutline(GdiFont *incoming_font, unsigned int glyph, unsigned int format,
+ void* lpgm, unsigned int buflen, void* buf,
+ const void* lpmat)
+{
+ unsigned int glyph_index;
+
+ get_glyph_index_linked(incoming_font, glyph, &incoming_font, &glyph_index);
+ return 0;
+}
+
+static int load_child_font(GdiFont *font, CHILD_FONT *child)
+{
+ child->font = alloc_font();
+ child->font->ft_face = OpenFontFace(child->font, child->face, 0, -font->ppem);
+ if(!child->font->ft_face)
+ return 0;
+ return 1;
+}
+
+static int get_glyph_index_linked(GdiFont *font, unsigned int c, GdiFont **linked_font, unsigned int *glyph)
+{
+ unsigned int g;
+ CHILD_FONT *child_font;
+
+ for ((child_font) = ((CHILD_FONT *)((char *)((&font->child_fonts)->next) - (unsigned long)(&((CHILD_FONT *)0)->entry))); &(child_font)->entry != (&font->child_fonts); (child_font) = ((CHILD_FONT *)((char *)((child_font)->entry.next) - (unsigned long)(&((CHILD_FONT *)0)->entry))))
+ {
+ if(!load_child_font(font, child_font))
+ continue;
+
+ g = get_glyph_index(child_font->font, c);
+ if(g) {
+ *glyph = g;
+ *linked_font = child_font->font;
+ return 1;
+ }
+ }
+ return 0;
+}
+
+unsigned int WineEngGetFontData(GdiFont *font, unsigned int table, unsigned int offset, void* buf,
+ unsigned int cbData)
+{
+ unsigned long len;
+ load_sfnt_table(font->ft_face, table, offset, buf, &len);
+ return len;
+}
+
+int WineEngGetLinkedHFont(DC *dc, unsigned short c, HFONT *new_hfont, unsigned int *glyph) {
+ return get_glyph_index_linked(0, 0, 0, 0);
+}
+
diff --git a/gcc/testsuite/gcc.dg/torture/pr26515.c b/gcc/testsuite/gcc.dg/torture/pr26515.c
new file mode 100644
index 00000000000..a051e2e53c4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr26515.c
@@ -0,0 +1,27 @@
+/* { dg-options "-march=v10" { target cris*-*-* } } */
+struct i
+{
+ long long i_size;
+ struct a *i_mapping;
+};
+struct p
+{
+ struct a *mapping;
+ long index;
+};
+extern void b (struct p*, unsigned);
+extern void u (struct p*);
+void
+block_page_mkwrite (struct i *i, struct p *p)
+{
+ unsigned end = 0;
+ long long size = 0;
+ size = i->i_size;
+ if ((p->mapping != i->i_mapping))
+ goto out_unlock;
+ if (((p->index + 1) << 13) > size)
+ end = size & ~(~(((1UL) << 13) - 1));
+ b (p, end);
+out_unlock:
+ u (p);
+}
diff --git a/gcc/testsuite/gfortran.dg/fmt_error_9.f b/gcc/testsuite/gfortran.dg/fmt_error_9.f
index 0f2b63b6d32..d8abb851210 100644
--- a/gcc/testsuite/gfortran.dg/fmt_error_9.f
+++ b/gcc/testsuite/gfortran.dg/fmt_error_9.f
@@ -22,4 +22,8 @@
write (line,'(1pd24.15e11.3)') 1.0d0, 1.234
if (line.ne." 1.000000000000000D+00 1.234E+00") call abort
+ str = '(1p2d24.15)'
+ msg = " 1.000000000000000D+00 1.233999967575073D+00That's it!"
+ write (line,'(1p2d24.15a)') 1.0d0, 1.234, "That's it!"
+ if (line.ne.msg) print *, msg
end
diff --git a/gcc/tree-dump.c b/gcc/tree-dump.c
index 61ccc6ce792..7b7a85f5082 100644
--- a/gcc/tree-dump.c
+++ b/gcc/tree-dump.c
@@ -511,6 +511,10 @@ dequeue_and_dump (dump_info_p di)
dump_child ("cnst", DECL_INITIAL (t));
break;
+ case DEBUG_EXPR_DECL:
+ dump_int (di, "-uid", DEBUG_TEMP_UID (t));
+ /* Fall through. */
+
case VAR_DECL:
case PARM_DECL:
case FIELD_DECL:
diff --git a/gcc/tree-flow.h b/gcc/tree-flow.h
index 8e790aec784..85f1f5ef60a 100644
--- a/gcc/tree-flow.h
+++ b/gcc/tree-flow.h
@@ -637,10 +637,8 @@ typedef bool (*walk_use_def_chains_fn) (tree, gimple, void *);
extern void walk_use_def_chains (tree, walk_use_def_chains_fn, void *, bool);
-void propagate_defs_into_debug_stmts (gimple, basic_block,
- const gimple_stmt_iterator *);
-void propagate_var_def_into_debug_stmts (tree, basic_block,
- const gimple_stmt_iterator *);
+void insert_debug_temps_for_defs (gimple_stmt_iterator *);
+void insert_debug_temp_for_var_def (gimple_stmt_iterator *, tree);
void release_defs_bitset (bitmap toremove);
/* In tree-into-ssa.c */
diff --git a/gcc/tree-pretty-print.c b/gcc/tree-pretty-print.c
index a325d75d914..cfc20a178ea 100644
--- a/gcc/tree-pretty-print.c
+++ b/gcc/tree-pretty-print.c
@@ -183,6 +183,8 @@ dump_decl_name (pretty_printer *buffer, tree node, int flags)
{
if (TREE_CODE (node) == LABEL_DECL && LABEL_DECL_UID (node) != -1)
pp_printf (buffer, "L.%d", (int) LABEL_DECL_UID (node));
+ else if (TREE_CODE (node) == DEBUG_EXPR_DECL)
+ pp_printf (buffer, "D#%i", DEBUG_TEMP_UID (node));
else
{
char c = TREE_CODE (node) == CONST_DECL ? 'C' : 'D';
@@ -1051,6 +1053,7 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
case VAR_DECL:
case PARM_DECL:
case FIELD_DECL:
+ case DEBUG_EXPR_DECL:
case NAMESPACE_DECL:
dump_decl_name (buffer, node, flags);
break;
diff --git a/gcc/tree-ssa-dce.c b/gcc/tree-ssa-dce.c
index 67d0472cc59..7dd07c1ca2c 100644
--- a/gcc/tree-ssa-dce.c
+++ b/gcc/tree-ssa-dce.c
@@ -325,7 +325,13 @@ mark_stmt_if_obviously_necessary (gimple stmt, bool aggressive)
break;
case GIMPLE_DEBUG:
- mark_stmt_necessary (stmt, false);
+ /* Debug temps without a value are not useful. ??? If we could
+ easily locate the debug temp bind stmt for a use thereof,
+ would could refrain from marking all debug temps here, and
+ mark them only if they're used. */
+ if (gimple_debug_bind_has_value_p (stmt)
+ || TREE_CODE (gimple_debug_bind_get_var (stmt)) != DEBUG_EXPR_DECL)
+ mark_stmt_necessary (stmt, false);
return;
case GIMPLE_GOTO:
@@ -1071,7 +1077,7 @@ eliminate_unnecessary_stmts (void)
{
bool something_changed = false;
basic_block bb;
- gimple_stmt_iterator gsi;
+ gimple_stmt_iterator gsi, psi;
gimple stmt;
tree call;
VEC (basic_block, heap) *h;
@@ -1111,10 +1117,13 @@ eliminate_unnecessary_stmts (void)
bb = VEC_pop (basic_block, h);
/* Remove dead statements. */
- for (gsi = gsi_last_bb (bb); !gsi_end_p (gsi);)
+ for (gsi = gsi_last_bb (bb); !gsi_end_p (gsi); gsi = psi)
{
stmt = gsi_stmt (gsi);
+ psi = gsi;
+ gsi_prev (&psi);
+
stats.total++;
/* If GSI is not necessary then remove it. */
@@ -1122,14 +1131,6 @@ eliminate_unnecessary_stmts (void)
{
remove_dead_stmt (&gsi, bb);
something_changed = true;
-
- /* If stmt was the last stmt in the block, we want to
- move gsi to the stmt that became the last stmt, but
- gsi_prev would crash. */
- if (gsi_end_p (gsi))
- gsi = gsi_last_bb (bb);
- else
- gsi_prev (&gsi);
}
else if (is_gimple_call (stmt))
{
@@ -1159,10 +1160,7 @@ eliminate_unnecessary_stmts (void)
}
notice_special_calls (stmt);
}
- gsi_prev (&gsi);
}
- else
- gsi_prev (&gsi);
}
}
diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c
index 87795a28223..6ba800d8288 100644
--- a/gcc/tree-ssa-forwprop.c
+++ b/gcc/tree-ssa-forwprop.c
@@ -939,7 +939,6 @@ forward_propagate_addr_expr (tree name, tree rhs)
gimple use_stmt;
bool all = true;
bool single_use_p = has_single_use (name);
- bool debug = false;
FOR_EACH_IMM_USE_STMT (use_stmt, iter, name)
{
@@ -950,9 +949,7 @@ forward_propagate_addr_expr (tree name, tree rhs)
there is nothing we can do. */
if (gimple_code (use_stmt) != GIMPLE_ASSIGN)
{
- if (is_gimple_debug (use_stmt))
- debug = true;
- else
+ if (!is_gimple_debug (use_stmt))
all = false;
continue;
}
@@ -995,9 +992,6 @@ forward_propagate_addr_expr (tree name, tree rhs)
}
}
- if (all && debug)
- propagate_var_def_into_debug_stmts (name, NULL, NULL);
-
return all;
}
diff --git a/gcc/tree-ssa-loop-im.c b/gcc/tree-ssa-loop-im.c
index 738249445b0..6c6a9f17a1d 100644
--- a/gcc/tree-ssa-loop-im.c
+++ b/gcc/tree-ssa-loop-im.c
@@ -764,6 +764,7 @@ rewrite_reciprocal (gimple_stmt_iterator *bsi)
gimple stmt, stmt1, stmt2;
tree var, name, lhs, type;
tree real_one;
+ gimple_stmt_iterator gsi;
stmt = gsi_stmt (*bsi);
lhs = gimple_assign_lhs (stmt);
@@ -798,8 +799,9 @@ rewrite_reciprocal (gimple_stmt_iterator *bsi)
/* Replace division stmt with reciprocal and multiply stmts.
The multiply stmt is not invariant, so update iterator
and avoid rescanning. */
- gsi_replace (bsi, stmt1, true);
- gsi_insert_after (bsi, stmt2, GSI_NEW_STMT);
+ gsi = *bsi;
+ gsi_insert_before (bsi, stmt1, GSI_NEW_STMT);
+ gsi_replace (&gsi, stmt2, true);
/* Continue processing with invariant reciprocal statement. */
return stmt1;
@@ -858,6 +860,8 @@ rewrite_bittest (gimple_stmt_iterator *bsi)
if (outermost_invariant_loop (b, loop_containing_stmt (stmt1)) != NULL
&& outermost_invariant_loop (a, loop_containing_stmt (stmt1)) == NULL)
{
+ gimple_stmt_iterator rsi;
+
/* 1 << B */
var = create_tmp_var (TREE_TYPE (a), "shifttmp");
add_referenced_var (var);
@@ -878,9 +882,14 @@ rewrite_bittest (gimple_stmt_iterator *bsi)
SET_USE (use, name);
gimple_cond_set_rhs (use_stmt, build_int_cst_type (TREE_TYPE (name), 0));
- gsi_insert_before (bsi, stmt1, GSI_SAME_STMT);
- propagate_defs_into_debug_stmts (gsi_stmt (*bsi), NULL, NULL);
- gsi_replace (bsi, stmt2, true);
+ /* Don't use gsi_replace here, none of the new assignments sets
+ the variable originally set in stmt. Move bsi to stmt1, and
+ then remove the original stmt, so that we get a chance to
+ retain debug info for it. */
+ rsi = *bsi;
+ gsi_insert_before (bsi, stmt1, GSI_NEW_STMT);
+ gsi_insert_before (&rsi, stmt2, GSI_SAME_STMT);
+ gsi_remove (&rsi, true);
return stmt1;
}
@@ -1060,7 +1069,6 @@ move_computations_stmt (struct dom_walk_data *dw_data ATTRIBUTE_UNUSED,
mark_virtual_ops_for_renaming (stmt);
gsi_insert_on_edge (loop_preheader_edge (level), stmt);
- propagate_defs_into_debug_stmts (gsi_stmt (bsi), NULL, NULL);
gsi_remove (&bsi, false);
}
}
diff --git a/gcc/tree-ssa-operands.c b/gcc/tree-ssa-operands.c
index 28e6ec65826..6af31a437ea 100644
--- a/gcc/tree-ssa-operands.c
+++ b/gcc/tree-ssa-operands.c
@@ -894,6 +894,10 @@ get_expr_operands (gimple stmt, tree *expr_p, int flags)
add_stmt_operand (expr_p, stmt, flags);
return;
+ case DEBUG_EXPR_DECL:
+ gcc_assert (gimple_debug_bind_p (stmt));
+ return;
+
case MISALIGNED_INDIRECT_REF:
get_expr_operands (stmt, &TREE_OPERAND (expr, 1), flags);
/* fall through */
diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c
index 55ce2f65a4f..5136aee5d32 100644
--- a/gcc/tree-ssa-reassoc.c
+++ b/gcc/tree-ssa-reassoc.c
@@ -1405,7 +1405,6 @@ rewrite_expr_tree (gimple stmt, unsigned int opindex,
{
stmt2 = SSA_NAME_DEF_STMT (gimple_assign_rhs1 (stmt1));
gsirhs1 = gsi_for_stmt (stmt2);
- propagate_defs_into_debug_stmts (stmt2, gimple_bb (stmt), &gsinow);
gsi_move_before (&gsirhs1, &gsinow);
gsi_prev (&gsinow);
stmt1 = stmt2;
@@ -1452,7 +1451,6 @@ linearize_expr (gimple stmt)
gsinow = gsi_for_stmt (stmt);
gsirhs = gsi_for_stmt (binrhs);
- propagate_defs_into_debug_stmts (binrhs, gimple_bb (stmt), &gsinow);
gsi_move_before (&gsirhs, &gsinow);
gimple_assign_set_rhs2 (stmt, gimple_assign_rhs1 (binrhs));
diff --git a/gcc/tree-ssa-sink.c b/gcc/tree-ssa-sink.c
index a9b4b67679b..be3fb7145fd 100644
--- a/gcc/tree-ssa-sink.c
+++ b/gcc/tree-ssa-sink.c
@@ -385,9 +385,6 @@ statement_sink_location (gimple stmt, basic_block frombb,
*togsi = gsi_after_labels (commondom);
- if (debug_stmts)
- propagate_defs_into_debug_stmts (stmt, commondom, togsi);
-
return true;
}
@@ -406,8 +403,6 @@ statement_sink_location (gimple stmt, basic_block frombb,
*togsi = gsi_for_stmt (use);
- propagate_defs_into_debug_stmts (stmt, sinkbb, togsi);
-
return true;
}
@@ -441,8 +436,6 @@ statement_sink_location (gimple stmt, basic_block frombb,
*togsi = gsi_after_labels (sinkbb);
- propagate_defs_into_debug_stmts (stmt, sinkbb, togsi);
-
return true;
}
diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c
index 9015d19c189..9858b109d03 100644
--- a/gcc/tree-ssa.c
+++ b/gcc/tree-ssa.c
@@ -295,152 +295,198 @@ find_released_ssa_name (tree *tp, int *walk_subtrees, void *data_)
return NULL_TREE;
}
-/* Given a VAR whose definition STMT is to be moved to the iterator
- position TOGSIP in the TOBB basic block, verify whether we're
- moving it across any of the debug statements that use it, and
- adjust them as needed. If TOBB is NULL, then the definition is
- understood as being removed, and TOGSIP is unused. */
+/* Insert a DEBUG BIND stmt before the DEF of VAR if VAR is referenced
+ by other DEBUG stmts, and replace uses of the DEF with the
+ newly-created debug temp. */
+
void
-propagate_var_def_into_debug_stmts (tree var,
- basic_block tobb,
- const gimple_stmt_iterator *togsip)
+insert_debug_temp_for_var_def (gimple_stmt_iterator *gsi, tree var)
{
imm_use_iterator imm_iter;
- gimple stmt;
use_operand_p use_p;
+ gimple stmt;
+ gimple def_stmt = NULL;
+ int usecount = 0;
tree value = NULL;
- bool no_value = false;
if (!MAY_HAVE_DEBUG_STMTS)
return;
- FOR_EACH_IMM_USE_STMT (stmt, imm_iter, var)
+ /* First of all, check whether there are debug stmts that reference
+ this variable and, if there are, decide whether we should use a
+ debug temp. */
+ FOR_EACH_IMM_USE_FAST (use_p, imm_iter, var)
{
- basic_block bb;
- gimple_stmt_iterator si;
+ stmt = USE_STMT (use_p);
- if (!is_gimple_debug (stmt))
+ if (!gimple_debug_bind_p (stmt))
continue;
- if (tobb)
+ if (usecount++)
+ break;
+
+ if (gimple_debug_bind_get_value (stmt) != var)
{
- bb = gimple_bb (stmt);
+ /* Count this as an additional use, so as to make sure we
+ use a temp unless VAR's definition has a SINGLE_RHS that
+ can be shared. */
+ usecount++;
+ break;
+ }
+ }
- if (bb != tobb)
- {
- gcc_assert (dom_info_available_p (CDI_DOMINATORS));
- if (dominated_by_p (CDI_DOMINATORS, bb, tobb))
- continue;
- }
- else
- {
- si = *togsip;
+ if (!usecount)
+ return;
- if (gsi_end_p (si))
- continue;
+ if (gsi)
+ def_stmt = gsi_stmt (*gsi);
+ else
+ def_stmt = SSA_NAME_DEF_STMT (var);
- do
- {
- gsi_prev (&si);
- if (gsi_end_p (si))
- break;
- }
- while (gsi_stmt (si) != stmt);
+ /* If we didn't get an insertion point, and the stmt has already
+ been removed, we won't be able to insert the debug bind stmt, so
+ we'll have to drop debug information. */
+ if (is_gimple_assign (def_stmt))
+ {
+ bool no_value = false;
- if (gsi_end_p (si))
- continue;
- }
+ if (!dom_info_available_p (CDI_DOMINATORS))
+ {
+ struct walk_stmt_info wi;
+
+ memset (&wi, 0, sizeof (wi));
+
+ /* When removing blocks without following reverse dominance
+ order, we may sometimes encounter SSA_NAMEs that have
+ already been released, referenced in other SSA_DEFs that
+ we're about to release. Consider:
+
+ <bb X>:
+ v_1 = foo;
+
+ <bb Y>:
+ w_2 = v_1 + bar;
+ # DEBUG w => w_2
+
+ If we deleted BB X first, propagating the value of w_2
+ won't do us any good. It's too late to recover their
+ original definition of v_1: when it was deleted, it was
+ only referenced in other DEFs, it couldn't possibly know
+ it should have been retained, and propagating every
+ single DEF just in case it might have to be propagated
+ into a DEBUG STMT would probably be too wasteful.
+
+ When dominator information is not readily available, we
+ check for and accept some loss of debug information. But
+ if it is available, there's no excuse for us to remove
+ blocks in the wrong order, so we don't even check for
+ dead SSA NAMEs. SSA verification shall catch any
+ errors. */
+ if ((!gsi && !gimple_bb (def_stmt))
+ || !walk_gimple_op (def_stmt, find_released_ssa_name,
+ &wi))
+ no_value = true;
}
- /* Here we compute (lazily) the value assigned to VAR, but we
- remember if we tried before and failed, so that we don't try
- again. */
- if (!value && !no_value)
+ if (!no_value)
+ value = gimple_assign_rhs_to_tree (def_stmt);
+ }
+
+ if (value)
+ {
+ /* If there's a single use of VAR, and VAR is the entire debug
+ expression (usecount would have been incremented again
+ otherwise), and the definition involves only constants and
+ SSA names, then we can propagate VALUE into this single use,
+ avoiding the temp.
+
+ We can also avoid using a temp if VALUE can be shared and
+ propagated into all uses, without generating expressions that
+ wouldn't be valid gimple RHSs.
+
+ Other cases that would require unsharing or non-gimple RHSs
+ are deferred to a debug temp, although we could avoid temps
+ at the expense of duplication of expressions. */
+
+ if (CONSTANT_CLASS_P (value)
+ || (usecount == 1
+ && (!gimple_assign_single_p (def_stmt)
+ || is_gimple_min_invariant (value)))
+ || is_gimple_reg (value))
+ value = unshare_expr (value);
+ else
{
- gimple def_stmt = SSA_NAME_DEF_STMT (var);
+ gimple def_temp;
+ tree vexpr = make_node (DEBUG_EXPR_DECL);
- if (is_gimple_assign (def_stmt))
- {
- if (!dom_info_available_p (CDI_DOMINATORS))
- {
- struct walk_stmt_info wi;
-
- memset (&wi, 0, sizeof (wi));
-
- /* When removing blocks without following reverse
- dominance order, we may sometimes encounter SSA_NAMEs
- that have already been released, referenced in other
- SSA_DEFs that we're about to release. Consider:
-
- <bb X>:
- v_1 = foo;
-
- <bb Y>:
- w_2 = v_1 + bar;
- # DEBUG w => w_2
-
- If we deleted BB X first, propagating the value of
- w_2 won't do us any good. It's too late to recover
- their original definition of v_1: when it was
- deleted, it was only referenced in other DEFs, it
- couldn't possibly know it should have been retained,
- and propagating every single DEF just in case it
- might have to be propagated into a DEBUG STMT would
- probably be too wasteful.
-
- When dominator information is not readily
- available, we check for and accept some loss of
- debug information. But if it is available,
- there's no excuse for us to remove blocks in the
- wrong order, so we don't even check for dead SSA
- NAMEs. SSA verification shall catch any
- errors. */
- if (!walk_gimple_op (def_stmt, find_released_ssa_name, &wi))
- no_value = true;
- }
+ def_temp = gimple_build_debug_bind (vexpr,
+ unshare_expr (value),
+ def_stmt);
+
+ DECL_ARTIFICIAL (vexpr) = 1;
+ TREE_TYPE (vexpr) = TREE_TYPE (value);
+ if (DECL_P (value))
+ DECL_MODE (vexpr) = DECL_MODE (value);
+ else
+ DECL_MODE (vexpr) = TYPE_MODE (TREE_TYPE (value));
- if (!no_value)
- value = gimple_assign_rhs_to_tree (def_stmt);
+ if (gsi)
+ gsi_insert_before (gsi, def_temp, GSI_SAME_STMT);
+ else
+ {
+ gimple_stmt_iterator ngsi = gsi_for_stmt (def_stmt);
+ gsi_insert_before (&ngsi, def_temp, GSI_SAME_STMT);
}
- if (!value)
- no_value = true;
+ value = vexpr;
}
+ }
- if (no_value)
- gimple_debug_bind_reset_value (stmt);
- else
+ FOR_EACH_IMM_USE_STMT (stmt, imm_iter, var)
+ {
+ if (!gimple_debug_bind_p (stmt))
+ continue;
+
+ if (value)
FOR_EACH_IMM_USE_ON_STMT (use_p, imm_iter)
- SET_USE (use_p, unshare_expr (value));
+ /* unshare_expr is not needed here. vexpr is either a
+ SINGLE_RHS, that can be safely shared, some other RHS
+ that was unshared when we found it had a single debug
+ use, or a DEBUG_EXPR_DECL, that can be safely
+ shared. */
+ SET_USE (use_p, value);
+ else
+ gimple_debug_bind_reset_value (stmt);
update_stmt (stmt);
}
}
-/* Given a STMT to be moved to the iterator position TOBSIP in the
- TOBB basic block, verify whether we're moving it across any of the
- debug statements that use it. If TOBB is NULL, then the definition
- is understood as being removed, and TOBSIP is unused. */
+/* Insert a DEBUG BIND stmt before STMT for each DEF referenced by
+ other DEBUG stmts, and replace uses of the DEF with the
+ newly-created debug temp. */
void
-propagate_defs_into_debug_stmts (gimple def, basic_block tobb,
- const gimple_stmt_iterator *togsip)
+insert_debug_temps_for_defs (gimple_stmt_iterator *gsi)
{
+ gimple stmt;
ssa_op_iter op_iter;
def_operand_p def_p;
if (!MAY_HAVE_DEBUG_STMTS)
return;
- FOR_EACH_SSA_DEF_OPERAND (def_p, def, op_iter, SSA_OP_DEF)
+ stmt = gsi_stmt (*gsi);
+
+ FOR_EACH_SSA_DEF_OPERAND (def_p, stmt, op_iter, SSA_OP_DEF)
{
tree var = DEF_FROM_PTR (def_p);
if (TREE_CODE (var) != SSA_NAME)
continue;
- propagate_var_def_into_debug_stmts (var, tobb, togsip);
+ insert_debug_temp_for_var_def (gsi, var);
}
}
diff --git a/gcc/tree-ssanames.c b/gcc/tree-ssanames.c
index 45183218a2c..bb0880260ff 100644
--- a/gcc/tree-ssanames.c
+++ b/gcc/tree-ssanames.c
@@ -206,7 +206,7 @@ release_ssa_name (tree var)
use_operand_p imm = &(SSA_NAME_IMM_USE_NODE (var));
if (MAY_HAVE_DEBUG_STMTS)
- propagate_var_def_into_debug_stmts (var, NULL, NULL);
+ insert_debug_temp_for_var_def (NULL, var);
#ifdef ENABLE_CHECKING
verify_imm_links (stderr, var);
diff --git a/gcc/tree.c b/gcc/tree.c
index 4c3f52bd7b7..9e463c04872 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -152,6 +152,9 @@ static const char * const tree_node_kind_names[] = {
static GTY(()) int next_decl_uid;
/* Unique id for next type created. */
static GTY(()) int next_type_uid = 1;
+/* Unique id for next debug decl created. Use negative numbers,
+ to catch erroneous uses. */
+static GTY(()) int next_debug_decl_uid;
/* Since we cannot rehash a type after it is in the table, we have to
keep the hash code. */
@@ -872,7 +875,10 @@ make_node_stat (enum tree_code code MEM_STAT_DECL)
DECL_ALIGN (t) = 1;
}
DECL_SOURCE_LOCATION (t) = input_location;
- DECL_UID (t) = next_decl_uid++;
+ if (TREE_CODE (t) == DEBUG_EXPR_DECL)
+ DECL_UID (t) = --next_debug_decl_uid;
+ else
+ DECL_UID (t) = next_decl_uid++;
if (TREE_CODE (t) == LABEL_DECL)
LABEL_DECL_UID (t) = -1;
@@ -948,7 +954,10 @@ copy_node_stat (tree node MEM_STAT_DECL)
if (TREE_CODE_CLASS (code) == tcc_declaration)
{
- DECL_UID (t) = next_decl_uid++;
+ if (code == DEBUG_EXPR_DECL)
+ DECL_UID (t) = --next_debug_decl_uid;
+ else
+ DECL_UID (t) = next_decl_uid++;
if ((TREE_CODE (node) == PARM_DECL || TREE_CODE (node) == VAR_DECL)
&& DECL_HAS_VALUE_EXPR_P (node))
{
diff --git a/gcc/tree.def b/gcc/tree.def
index c1ba96aa966..01d91b76a6f 100644
--- a/gcc/tree.def
+++ b/gcc/tree.def
@@ -351,6 +351,10 @@ DEFTREECODE (PARM_DECL, "parm_decl", tcc_declaration, 0)
DEFTREECODE (TYPE_DECL, "type_decl", tcc_declaration, 0)
DEFTREECODE (RESULT_DECL, "result_decl", tcc_declaration, 0)
+/* A "declaration" of a debug temporary. It should only appear in
+ DEBUG stmts. */
+DEFTREECODE (DEBUG_EXPR_DECL, "debug_expr_decl", tcc_declaration, 0)
+
/* A namespace declaration. Namespaces appear in DECL_CONTEXT of other
_DECLs, providing a hierarchy of names. */
DEFTREECODE (NAMESPACE_DECL, "namespace_decl", tcc_declaration, 0)
diff --git a/gcc/tree.h b/gcc/tree.h
index 20463b4a18b..2487a1ce9fe 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -2455,6 +2455,10 @@ struct function;
/* Every ..._DECL node gets a unique number. */
#define DECL_UID(NODE) (DECL_MINIMAL_CHECK (NODE)->decl_minimal.uid)
+/* DEBUG_EXPR_DECLs get negative UID numbers, to catch erroneous
+ uses. */
+#define DEBUG_TEMP_UID(NODE) (-DECL_UID (TREE_CHECK ((NODE), DEBUG_EXPR_DECL)))
+
/* These two fields describe where in the source code the declaration
was. If the declaration appears in several places (as for a C
function that is declared first and then defined later), this
diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c
index bdd3bdee34e..acc4d13d717 100644
--- a/gcc/var-tracking.c
+++ b/gcc/var-tracking.c
@@ -732,6 +732,7 @@ dv_is_decl_p (decl_or_value dv)
case (int)PARM_DECL:
case (int)RESULT_DECL:
case (int)FUNCTION_DECL:
+ case (int)DEBUG_EXPR_DECL:
case (int)COMPONENT_REF:
return true;
@@ -2222,7 +2223,7 @@ dataflow_set_union (dataflow_set *dst, dataflow_set *src)
/* Whether the value is currently being expanded. */
#define VALUE_RECURSED_INTO(x) \
- (RTL_FLAG_CHECK1 ("VALUE_RECURSED_INTO", (x), VALUE)->used)
+ (RTL_FLAG_CHECK2 ("VALUE_RECURSED_INTO", (x), VALUE, DEBUG_EXPR)->used)
/* Whether the value is in changed_variables hash table. */
#define VALUE_CHANGED(x) \
(RTL_FLAG_CHECK1 ("VALUE_CHANGED", (x), VALUE)->frame_related)
@@ -4112,6 +4113,9 @@ track_expr_p (tree expr, bool need_rtl)
rtx decl_rtl;
tree realdecl;
+ if (TREE_CODE (expr) == DEBUG_EXPR_DECL)
+ return DECL_RTL_SET_P (expr);
+
/* If EXPR is not a parameter or a variable do not track it. */
if (TREE_CODE (expr) != VAR_DECL && TREE_CODE (expr) != PARM_DECL)
return 0;
@@ -6271,11 +6275,12 @@ vt_expand_loc_callback (rtx x, bitmap regs, int max_depth, void *data)
decl_or_value dv;
variable var;
location_chain loc;
- rtx result;
+ rtx result, subreg, xret;
- if (GET_CODE (x) == SUBREG)
+ switch (GET_CODE (x))
{
- rtx subreg = SUBREG_REG (x);
+ case SUBREG:
+ subreg = SUBREG_REG (x);
if (GET_CODE (SUBREG_REG (x)) != VALUE)
return x;
@@ -6297,22 +6302,31 @@ vt_expand_loc_callback (rtx x, bitmap regs, int max_depth, void *data)
result = gen_rtx_raw_SUBREG (GET_MODE (x), subreg, SUBREG_BYTE (x));
return result;
- }
- if (GET_CODE (x) != VALUE)
- return x;
+ case DEBUG_EXPR:
+ dv = dv_from_decl (DEBUG_EXPR_TREE_DECL (x));
+ xret = NULL;
+ break;
+
+ case VALUE:
+ dv = dv_from_value (x);
+ xret = x;
+ break;
+
+ default:
+ return x;
+ }
if (VALUE_RECURSED_INTO (x))
- return x;
+ return NULL;
- dv = dv_from_value (x);
var = (variable) htab_find_with_hash (vars, dv, dv_htab_hash (dv));
if (!var)
- return x;
+ return xret;
if (var->n_var_parts == 0)
- return x;
+ return xret;
gcc_assert (var->n_var_parts == 1);
@@ -6332,7 +6346,7 @@ vt_expand_loc_callback (rtx x, bitmap regs, int max_depth, void *data)
if (result)
return result;
else
- return x;
+ return xret;
}
/* Expand VALUEs in LOC, using VARS as well as cselib's equivalence
@@ -6382,6 +6396,9 @@ emit_note_insn_var_location (void **varp, void *data)
decl = dv_as_decl (var->dv);
+ if (TREE_CODE (decl) == DEBUG_EXPR_DECL)
+ goto clear;
+
gcc_assert (decl);
complete = true;
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index b7c75e033ea..bf51dbcdd6d 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,9 @@
+2009-10-12 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libgfortran/41683
+ * io/format.c (parse_format_list): Allow a repeat specifier immediately
+ after a P specifier.
+
2009-10-11 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/38439
diff --git a/libgfortran/io/format.c b/libgfortran/io/format.c
index 97bd2da77ba..0ee60ea9012 100644
--- a/libgfortran/io/format.c
+++ b/libgfortran/io/format.c
@@ -706,7 +706,8 @@ parse_format_list (st_parameter_dt *dtp, bool *save_ok)
goto data_desc;
}
- if (t != FMT_COMMA && t != FMT_RPAREN && t != FMT_SLASH)
+ if (t != FMT_COMMA && t != FMT_RPAREN && t != FMT_SLASH
+ && t != FMT_POSINT)
{
fmt->error = "Comma required after P descriptor";
goto finished;
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index e68d69d86bb..424967d3560 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,53 @@
+2009-10-13 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * include/parallel/for_each_selectors.h: Minor uglification and
+ stylistic fixes.
+
+2009-10-13 Edward Smith-Rowland <3dw4rd@verizon.net>
+
+ * include/precompiled/stdc++.h: Include <initializer_list>
+ for completeness.
+
+2009-10-12 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * include/bits/random.h (class linear_congruential_engine,
+ class mersenne_twister_engine, class subtract_with_carry_engine,
+ class discard_block_engine, class independent_bits_engine,
+ class shuffle_order_engine, class uniform_int_distribution,
+ class binomial_distribution, class geometric_distribution,
+ class negative_binomial_distribution, class poisson_distribution,
+ class discrete_distribution): Do not use simulated concept checks,
+ tidy startic_asserts on argument types and ranges.
+ (class uniform_real_distribution, class normal_distribution,
+ class lognormal_distribution, class gamma_distribution,
+ class chi_squared_distribution, class cauchy_distribution,
+ class fisher_f_distribution, class student_t_distribution,
+ class exponential_distribution, class weibull_distribution,
+ class extreme_value_distribution, class piecewise_linear_distribution,
+ class piecewise_constant_distribution): Add static_assert on
+ template argument type.
+ * include/std/random: Do not include <bits/concept_check.h>.
+ * testsuite/26_numerics/random/discard_block_engine/cons/base_move.cc:
+ Fix.
+ * testsuite/26_numerics/random/discard_block_engine/cons/seed1.cc:
+ Likewise.
+ * testsuite/26_numerics/random/discard_block_engine/cons/seed2.cc:
+ Likewise.
+ * testsuite/26_numerics/random/discard_block_engine/cons/base_copy.cc:
+ Likewise.
+ * testsuite/26_numerics/random/discard_block_engine/cons/default.cc:
+ Likewise.
+ * testsuite/26_numerics/random/discard_block_engine/cons/seed_seq.cc:
+ Likewise.
+ * testsuite/26_numerics/random/discard_block_engine/requirements/
+ typedefs.cc: Likewise.
+ * testsuite/26_numerics/random/discard_block_engine/operators/
+ equal.cc: Likewise.
+ * testsuite/26_numerics/random/discard_block_engine/operators/
+ serialize.cc: Likewise.
+ * testsuite/26_numerics/random/linear_congruential_engine/
+ requirements/non_uint_neg.cc: Tweak.
+
2009-10-10 Gerald Pfeifer <gerald@pfeifer.com>
* doc/xml/manual/messages.xml: Update GNU gettext reference.
diff --git a/libstdc++-v3/include/bits/random.h b/libstdc++-v3/include/bits/random.h
index 06aa6f87b91..2c2c79ca16b 100644
--- a/libstdc++-v3/include/bits/random.h
+++ b/libstdc++-v3/include/bits/random.h
@@ -32,7 +32,6 @@
namespace std
{
-
// [26.4] Random number generation
/**
@@ -154,10 +153,10 @@ namespace std
template<typename _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
class linear_congruential_engine
{
- __glibcxx_class_requires(_UIntType, _UnsignedIntegerConcept)
- static_assert(__m == 0 || (__a < __m && __c < __m),
- "template arguments out of bounds"
- " in linear_congruential_engine");
+ static_assert(std::is_unsigned<_UIntType>::value, "template argument "
+ "_UIntType not an unsigned integral type");
+ static_assert(__m == 0u || (__a < __m && __c < __m),
+ "template argument __m out of bounds");
public:
/** The type of the generated random value. */
@@ -341,35 +340,27 @@ namespace std
_UIntType __c, size_t __l, _UIntType __f>
class mersenne_twister_engine
{
- __glibcxx_class_requires(_UIntType, _UnsignedIntegerConcept)
-
- static_assert(__m >= 1U,
- "mersenne_twister_engine template arguments out of bounds");
- static_assert(__n >= __m,
- "mersenne_twister_engine template arguments out of bounds");
- static_assert(__w >= __r,
- "mersenne_twister_engine template arguments out of bounds");
- static_assert(__w >= __u,
- "mersenne_twister_engine template arguments out of bounds");
- static_assert(__w >= __s,
- "mersenne_twister_engine template arguments out of bounds");
- static_assert(__w >= __t,
- "mersenne_twister_engine template arguments out of bounds");
- static_assert(__w >= __l,
- "mersenne_twister_engine template arguments out of bounds");
- static_assert(__w <=
- static_cast<size_t>(std::numeric_limits<_UIntType>::digits),
- "mersenne_twister_engine template arguments out of bounds");
+ static_assert(std::is_unsigned<_UIntType>::value, "template argument "
+ "_UIntType not an unsigned integral type");
+ static_assert(1u <= __m && __m <= __n,
+ "template argument __m out of bounds");
+ static_assert(__r <= __w, "template argument __r out of bound");
+ static_assert(__u <= __w, "template argument __u out of bound");
+ static_assert(__s <= __w, "template argument __s out of bound");
+ static_assert(__t <= __w, "template argument __t out of bound");
+ static_assert(__l <= __w, "template argument __l out of bound");
+ static_assert(__w <= std::numeric_limits<_UIntType>::digits,
+ "template argument __w out of bound");
static_assert(__a <= (__detail::_Shift<_UIntType, __w>::__value - 1),
- "mersenne_twister_engine template arguments out of bounds");
+ "template argument __a out of bound");
static_assert(__b <= (__detail::_Shift<_UIntType, __w>::__value - 1),
- "mersenne_twister_engine template arguments out of bounds");
+ "template argument __b out of bound");
static_assert(__c <= (__detail::_Shift<_UIntType, __w>::__value - 1),
- "mersenne_twister_engine template arguments out of bounds");
+ "template argument __c out of bound");
static_assert(__d <= (__detail::_Shift<_UIntType, __w>::__value - 1),
- "mersenne_twister_engine template arguments out of bounds");
+ "template argument __d out of bound");
static_assert(__f <= (__detail::_Shift<_UIntType, __w>::__value - 1),
- "mersenne_twister_engine template arguments out of bounds");
+ "template argument __f out of bound");
public:
/** The type of the generated random value. */
@@ -538,13 +529,12 @@ namespace std
template<typename _UIntType, size_t __w, size_t __s, size_t __r>
class subtract_with_carry_engine
{
- __glibcxx_class_requires(_UIntType, _UnsignedIntegerConcept)
- static_assert(__s > 0U && __r > __s
- && __w > 0U
- && __w <= static_cast<size_t>
- (std::numeric_limits<_UIntType>::digits),
- "template arguments out of bounds"
- " in subtract_with_carry_engine");
+ static_assert(std::is_unsigned<_UIntType>::value, "template argument "
+ "_UIntType not an unsigned integral type");
+ static_assert(0u < __s && __s < __r,
+ "template argument __s out of bounds");
+ static_assert(0u < __w && __w <= std::numeric_limits<_UIntType>::digits,
+ "template argument __w out of bounds");
public:
/** The type of the generated random value. */
@@ -702,9 +692,8 @@ namespace std
template<typename _RandomNumberEngine, size_t __p, size_t __r>
class discard_block_engine
{
- static_assert(__r >= 1U && __p >= __r,
- "template arguments out of bounds"
- " in discard_block_engine");
+ static_assert(1 <= __r && __r <= __p,
+ "template argument __r out of bounds");
public:
/** The type of the generated random value. */
@@ -903,12 +892,10 @@ namespace std
template<typename _RandomNumberEngine, size_t __w, typename _UIntType>
class independent_bits_engine
{
- static_assert(__w > 0U
- && __w <=
- static_cast<size_t>
- (std::numeric_limits<_UIntType>::digits),
- "template arguments out of bounds "
- "in independent_bits_engine");
+ static_assert(std::is_unsigned<_UIntType>::value, "template argument "
+ "_UIntType not an unsigned integral type");
+ static_assert(0u < __w && __w <= std::numeric_limits<_UIntType>::digits,
+ "template argument __w out of bounds");
public:
/** The type of the generated random value. */
@@ -1102,9 +1089,7 @@ namespace std
template<typename _RandomNumberEngine, size_t __k>
class shuffle_order_engine
{
- static_assert(__k >= 1U,
- "template arguments out of bounds"
- " in shuffle_order_engine");
+ static_assert(1u <= __k, "template argument __k out of bound");
public:
/** The type of the generated random value. */
@@ -1480,7 +1465,8 @@ namespace std
template<typename _IntType = int>
class uniform_int_distribution
{
- __glibcxx_class_requires(_IntType, _IntegerConcept)
+ static_assert(std::is_integral<_IntType>::value,
+ "template argument not an integral type");
public:
/** The type of the range of the distribution. */
@@ -1633,6 +1619,9 @@ namespace std
template<typename _RealType = double>
class uniform_real_distribution
{
+ static_assert(std::is_floating_point<_RealType>::value,
+ "template argument not a floating point type");
+
public:
/** The type of the range of the distribution. */
typedef _RealType result_type;
@@ -1791,6 +1780,9 @@ namespace std
template<typename _RealType = double>
class normal_distribution
{
+ static_assert(std::is_floating_point<_RealType>::value,
+ "template argument not a floating point type");
+
public:
/** The type of the range of the distribution. */
typedef _RealType result_type;
@@ -1943,6 +1935,9 @@ namespace std
template<typename _RealType = double>
class lognormal_distribution
{
+ static_assert(std::is_floating_point<_RealType>::value,
+ "template argument not a floating point type");
+
public:
/** The type of the range of the distribution. */
typedef _RealType result_type;
@@ -2086,6 +2081,9 @@ namespace std
template<typename _RealType = double>
class gamma_distribution
{
+ static_assert(std::is_floating_point<_RealType>::value,
+ "template argument not a floating point type");
+
public:
/** The type of the range of the distribution. */
typedef _RealType result_type;
@@ -2243,6 +2241,9 @@ namespace std
template<typename _RealType = double>
class chi_squared_distribution
{
+ static_assert(std::is_floating_point<_RealType>::value,
+ "template argument not a floating point type");
+
public:
/** The type of the range of the distribution. */
typedef _RealType result_type;
@@ -2378,6 +2379,9 @@ namespace std
template<typename _RealType = double>
class cauchy_distribution
{
+ static_assert(std::is_floating_point<_RealType>::value,
+ "template argument not a floating point type");
+
public:
/** The type of the range of the distribution. */
typedef _RealType result_type;
@@ -2519,6 +2523,9 @@ namespace std
template<typename _RealType = double>
class fisher_f_distribution
{
+ static_assert(std::is_floating_point<_RealType>::value,
+ "template argument not a floating point type");
+
public:
/** The type of the range of the distribution. */
typedef _RealType result_type;
@@ -2670,6 +2677,9 @@ namespace std
template<typename _RealType = double>
class student_t_distribution
{
+ static_assert(std::is_floating_point<_RealType>::value,
+ "template argument not a floating point type");
+
public:
/** The type of the range of the distribution. */
typedef _RealType result_type;
@@ -2972,7 +2982,8 @@ namespace std
template<typename _IntType = int>
class binomial_distribution
{
- __glibcxx_class_requires(_IntType, _IntegerConcept)
+ static_assert(std::is_integral<_IntType>::value,
+ "template argument not an integral type");
public:
/** The type of the range of the distribution. */
@@ -3142,7 +3153,8 @@ namespace std
template<typename _IntType = int>
class geometric_distribution
{
- __glibcxx_class_requires(_IntType, _IntegerConcept)
+ static_assert(std::is_integral<_IntType>::value,
+ "template argument not an integral type");
public:
/** The type of the range of the distribution. */
@@ -3287,7 +3299,8 @@ namespace std
template<typename _IntType = int>
class negative_binomial_distribution
{
- __glibcxx_class_requires(_IntType, _IntegerConcept)
+ static_assert(std::is_integral<_IntType>::value,
+ "template argument not an integral type");
public:
/** The type of the range of the distribution. */
@@ -3439,7 +3452,8 @@ namespace std
template<typename _IntType = int>
class poisson_distribution
{
- __glibcxx_class_requires(_IntType, _IntegerConcept)
+ static_assert(std::is_integral<_IntType>::value,
+ "template argument not an integral type");
public:
/** The type of the range of the distribution. */
@@ -3594,6 +3608,9 @@ namespace std
template<typename _RealType = double>
class exponential_distribution
{
+ static_assert(std::is_floating_point<_RealType>::value,
+ "template argument not a floating point type");
+
public:
/** The type of the range of the distribution. */
typedef _RealType result_type;
@@ -3736,6 +3753,9 @@ namespace std
template<typename _RealType = double>
class weibull_distribution
{
+ static_assert(std::is_floating_point<_RealType>::value,
+ "template argument not a floating point type");
+
public:
/** The type of the range of the distribution. */
typedef _RealType result_type;
@@ -3879,6 +3899,9 @@ namespace std
template<typename _RealType = double>
class extreme_value_distribution
{
+ static_assert(std::is_floating_point<_RealType>::value,
+ "template argument not a floating point type");
+
public:
/** The type of the range of the distribution. */
typedef _RealType result_type;
@@ -4021,7 +4044,8 @@ namespace std
template<typename _IntType = int>
class discrete_distribution
{
- __glibcxx_class_requires(_IntType, _IntegerConcept)
+ static_assert(std::is_integral<_IntType>::value,
+ "template argument not an integral type");
public:
/** The type of the range of the distribution. */
@@ -4185,6 +4209,9 @@ namespace std
template<typename _RealType = double>
class piecewise_constant_distribution
{
+ static_assert(std::is_floating_point<_RealType>::value,
+ "template argument not a floating point type");
+
public:
/** The type of the range of the distribution. */
typedef _RealType result_type;
@@ -4363,6 +4390,9 @@ namespace std
template<typename _RealType = double>
class piecewise_linear_distribution
{
+ static_assert(std::is_floating_point<_RealType>::value,
+ "template argument not a floating point type");
+
public:
/** The type of the range of the distribution. */
typedef _RealType result_type;
diff --git a/libstdc++-v3/include/parallel/for_each_selectors.h b/libstdc++-v3/include/parallel/for_each_selectors.h
index 9fd432df021..3a37e5ca637 100644
--- a/libstdc++-v3/include/parallel/for_each_selectors.h
+++ b/libstdc++-v3/include/parallel/for_each_selectors.h
@@ -37,17 +37,15 @@
namespace __gnu_parallel
{
-
/** @brief Generic __selector for embarrassingly parallel functions. */
template<typename _It>
- struct __generic_for_each_selector
- {
- /** @brief _Iterator on last element processed; needed for some
- * algorithms (e. g. std::transform()).
- */
- _It _M_finish_iterator;
- };
-
+ struct __generic_for_each_selector
+ {
+ /** @brief _Iterator on last element processed; needed for some
+ * algorithms (e. g. std::transform()).
+ */
+ _It _M_finish_iterator;
+ };
/** @brief std::for_each() selector. */
template<typename _It>
@@ -220,21 +218,21 @@ namespace __gnu_parallel
};
/** @brief std::inner_product() selector. */
- template<typename _It, typename It2, typename _Tp>
+ template<typename _It, typename _It2, typename _Tp>
struct __inner_product_selector : public __generic_for_each_selector<_It>
{
/** @brief Begin iterator of first sequence. */
- _It __begin1_iterator;
+ _It __begin1_iterator;
/** @brief Begin iterator of second sequence. */
- It2 begin2_iterator;
+ _It2 __begin2_iterator;
/** @brief Constructor.
* @param b1 Begin iterator of first sequence.
* @param b2 Begin iterator of second sequence. */
explicit
- __inner_product_selector(_It b1, It2 b2)
- : __begin1_iterator(b1), begin2_iterator(b2) { }
+ __inner_product_selector(_It __b1, _It2 __b2)
+ : __begin1_iterator(__b1), __begin2_iterator(__b2) { }
/** @brief Functor execution.
* @param __mult Multiplication functor.
@@ -246,7 +244,7 @@ namespace __gnu_parallel
{
typename std::iterator_traits<_It>::difference_type __position
= __current - __begin1_iterator;
- return __mult(*__current, *(begin2_iterator + __position));
+ return __mult(*__current, *(__begin2_iterator + __position));
}
};
@@ -268,8 +266,8 @@ namespace __gnu_parallel
* __elements.
*/
template<typename _It>
- struct __adjacent_difference_selector :
- public __generic_for_each_selector<_It>
+ struct __adjacent_difference_selector
+ : public __generic_for_each_selector<_It>
{
template<typename _Op>
bool
@@ -293,14 +291,14 @@ namespace __gnu_parallel
* @param __i iterator referencing object. */
template<typename _It>
void
- operator()(_It __i) { }
+ operator()(_It) { }
};
/** @brief Reduction function doing nothing. */
struct _DummyReduct
{
bool
- operator()(bool /*__x*/, bool /*__y*/) const
+ operator()(bool, bool) const
{ return true; }
};
@@ -315,12 +313,7 @@ namespace __gnu_parallel
_It
operator()(_It __x, _It __y)
- {
- if (__comp(*__x, *__y))
- return __x;
- else
- return __y;
- }
+ { return (__comp(*__x, *__y)) ? __x : __y; }
};
/** @brief Reduction for finding the maximum element, using a comparator. */
@@ -334,12 +327,7 @@ namespace __gnu_parallel
_It
operator()(_It __x, _It __y)
- {
- if (__comp(*__x, *__y))
- return __y;
- else
- return __x;
- }
+ { return (__comp(*__x, *__y)) ? __y : __x; }
};
/** @brief General reduction, using a binary operator. */
diff --git a/libstdc++-v3/include/precompiled/stdc++.h b/libstdc++-v3/include/precompiled/stdc++.h
index 1c615091bdc..99def363142 100644
--- a/libstdc++-v3/include/precompiled/stdc++.h
+++ b/libstdc++-v3/include/precompiled/stdc++.h
@@ -101,6 +101,7 @@
#include <condition_variable>
#include <forward_list>
#include <future>
+#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
diff --git a/libstdc++-v3/include/std/random b/libstdc++-v3/include/std/random
index b57ef4925d6..72d3ceb7f43 100644
--- a/libstdc++-v3/include/std/random
+++ b/libstdc++-v3/include/std/random
@@ -43,7 +43,6 @@
#include <limits>
#include <ext/type_traits.h>
#include <ext/numeric_traits.h>
-#include <bits/concept_check.h>
#include <debug/debug.h>
#include <type_traits>
diff --git a/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/base_copy.cc b/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/base_copy.cc
index 328dd71d0bb..6c8498e7b10 100644
--- a/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/base_copy.cc
+++ b/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/base_copy.cc
@@ -31,7 +31,7 @@ test01()
{
bool test __attribute__((unused)) = true;
- typedef std::subtract_with_carry_engine<long, 24, 10, 24>
+ typedef std::subtract_with_carry_engine<unsigned long, 24, 10, 24>
base_engine;
base_engine b;
diff --git a/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/base_move.cc b/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/base_move.cc
index 990dc9b3fe9..fabe17a2b56 100644
--- a/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/base_move.cc
+++ b/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/base_move.cc
@@ -31,7 +31,7 @@ test01()
{
bool test __attribute__((unused)) = true;
- typedef std::subtract_with_carry_engine<long, 24, 10, 24>
+ typedef std::subtract_with_carry_engine<unsigned long, 24, 10, 24>
base_engine;
std::discard_block_engine<base_engine, 389, 24>
diff --git a/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/default.cc b/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/default.cc
index 17fea5bdb47..926bb2c24db 100644
--- a/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/default.cc
+++ b/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/default.cc
@@ -33,7 +33,7 @@ test01()
std::discard_block_engine
<
- std::subtract_with_carry_engine<long, 24, 10, 24>,
+ std::subtract_with_carry_engine<unsigned long, 24, 10, 24>,
389, 24
> e;
}
diff --git a/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/seed1.cc b/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/seed1.cc
index efe194c99f0..4cedeb85d39 100644
--- a/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/seed1.cc
+++ b/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/seed1.cc
@@ -35,7 +35,7 @@ test01()
std::discard_block_engine
<
- std::subtract_with_carry_engine<long, 24, 10, 24>,
+ std::subtract_with_carry_engine<unsigned long, 24, 10, 24>,
389, 24
> e(seed);
}
diff --git a/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/seed2.cc b/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/seed2.cc
index 82f6fdb1c74..b66752c2b6e 100644
--- a/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/seed2.cc
+++ b/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/seed2.cc
@@ -35,7 +35,7 @@ test01()
std::discard_block_engine
<
- std::subtract_with_carry_engine<long, 24, 10, 24>,
+ std::subtract_with_carry_engine<unsigned long, 24, 10, 24>,
389, 24
> e(seed);
}
diff --git a/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/seed_seq.cc b/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/seed_seq.cc
index 58f0f1c392a..aa86b9afedc 100644
--- a/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/seed_seq.cc
+++ b/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/seed_seq.cc
@@ -35,7 +35,7 @@ test01()
std::discard_block_engine
<
- std::subtract_with_carry_engine<long, 24, 10, 24>,
+ std::subtract_with_carry_engine<unsigned long, 24, 10, 24>,
389, 24
> e(seq);
}
diff --git a/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/operators/equal.cc b/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/operators/equal.cc
index db2497540a3..5d63114fef3 100644
--- a/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/operators/equal.cc
+++ b/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/operators/equal.cc
@@ -33,7 +33,7 @@ test01()
std::discard_block_engine
<
- std::subtract_with_carry_engine<long, 24, 10, 24>,
+ std::subtract_with_carry_engine<unsigned long, 24, 10, 24>,
389, 24
> u, v;
diff --git a/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/operators/serialize.cc b/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/operators/serialize.cc
index 1d39a213f47..7aec649c03b 100644
--- a/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/operators/serialize.cc
+++ b/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/operators/serialize.cc
@@ -35,7 +35,7 @@ test01()
std::stringstream str;
std::discard_block_engine
<
- std::subtract_with_carry_engine<long, 24, 10, 24>,
+ std::subtract_with_carry_engine<unsigned long, 24, 10, 24>,
389, 24
> u, v;
diff --git a/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/requirements/typedefs.cc b/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/requirements/typedefs.cc
index 379b3aeb978..6e23316caa1 100644
--- a/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/requirements/typedefs.cc
+++ b/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/requirements/typedefs.cc
@@ -31,7 +31,7 @@ test01()
{
typedef std::discard_block_engine
<
- std::subtract_with_carry_engine<long, 24, 10, 24>,
+ std::subtract_with_carry_engine<unsigned long, 24, 10, 24>,
389, 24
> test_type;
diff --git a/libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/requirements/non_uint_neg.cc b/libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/requirements/non_uint_neg.cc
index f54d76ada07..18fb44fdac5 100644
--- a/libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/requirements/non_uint_neg.cc
+++ b/libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/requirements/non_uint_neg.cc
@@ -19,7 +19,7 @@
// <http://www.gnu.org/licenses/>.
// { dg-do compile }
-// { dg-options "-std=c++0x -D_GLIBCXX_CONCEPT_CHECKS" }
+// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
// { dg-error "not a valid type" "" { target *-*-* } 32 }
// { dg-error "invalid type" "" { target *-*-* } 32 }
diff --git a/lto-plugin/ChangeLog b/lto-plugin/ChangeLog
index cabfcca9f2e..a68e3ff3343 100644
--- a/lto-plugin/ChangeLog
+++ b/lto-plugin/ChangeLog
@@ -1,3 +1,9 @@
+2009-10-13 Richard Guenther <rguenther@suse.de>
+
+ * Makefile.am (liblto_plugin_la_LIBADD): Link against the
+ correct libiberty.
+ * Makefile.in: Regenerated.
+
2009-10-08 Rafael Avila de Espindola <espindola@google.com>
* lto-plugin.c (add_input_library): New.
diff --git a/lto-plugin/Makefile.am b/lto-plugin/Makefile.am
index b5dd5fc4716..19fbdcd8ef5 100644
--- a/lto-plugin/Makefile.am
+++ b/lto-plugin/Makefile.am
@@ -16,4 +16,4 @@ AM_CFLAGS = -Wall -Werror
libexecsub_LTLIBRARIES = liblto_plugin.la
liblto_plugin_la_SOURCES = lto-plugin.c
-liblto_plugin_la_LIBADD = $(LIBELFLIBS) -L../libiberty/pic -liberty
+liblto_plugin_la_LIBADD = $(LIBELFLIBS) ../libiberty/pic/libiberty.a
diff --git a/lto-plugin/Makefile.in b/lto-plugin/Makefile.in
index 7284e4cb856..6ae87de40c1 100644
--- a/lto-plugin/Makefile.in
+++ b/lto-plugin/Makefile.in
@@ -82,7 +82,8 @@ am__base_list = \
am__installdirs = "$(DESTDIR)$(libexecsubdir)"
LTLIBRARIES = $(libexecsub_LTLIBRARIES)
am__DEPENDENCIES_1 =
-liblto_plugin_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
+liblto_plugin_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+ ../libiberty/pic/libiberty.a
am_liblto_plugin_la_OBJECTS = lto-plugin.lo
liblto_plugin_la_OBJECTS = $(am_liblto_plugin_la_OBJECTS)
DEFAULT_INCLUDES = -I.@am__isrc@
@@ -240,7 +241,7 @@ AM_CPPFLAGS = -I$(top_srcdir)/../include $(LIBELFINC)
AM_CFLAGS = -Wall -Werror
libexecsub_LTLIBRARIES = liblto_plugin.la
liblto_plugin_la_SOURCES = lto-plugin.c
-liblto_plugin_la_LIBADD = $(LIBELFLIBS) -L../libiberty/pic -liberty
+liblto_plugin_la_LIBADD = $(LIBELFLIBS) ../libiberty/pic/libiberty.a
all: all-am
.SUFFIXES: