This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] [tuples] partial merge from trunk
- From: "Rafael Espindola" <espindola at google dot com>
- To: "Gcc Patch List" <gcc-patches at gcc dot gnu dot org>
- Cc: "Diego Novillo" <dnovillo at google dot com>
- Date: Wed, 19 Mar 2008 19:49:42 +0000
- Subject: [patch] [tuples] partial merge from trunk
This patch merges everything up to but not including the phiprop
split. I will work on it as soon as this is in.
One of the new tests fails:
gcc.dg/tree-ssa/ipa-reference-1.c scan-tree-dump-times optimized
"conststaticvariable" 0
but there are no regressions.
OK?
Cheers,
--
Rafael Avila de Espindola
Google Ireland Ltd.
Gordon House
Barrow Street
Dublin 4
Ireland
Registered in Dublin, Ireland
Registration Number: 368047
Property changes on: .
___________________________________________________________________
Name: svnmerge-integrated
- /trunk:1-133081
+ /trunk:1-133138
Index: libgomp/ChangeLog
===================================================================
--- libgomp/ChangeLog (revision 133344)
+++ libgomp/ChangeLog (working copy)
@@ -1,3 +1,8 @@
+2008-03-12 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/35549
+ * testsuite/libgomp.c/pr35549.c: New test.
+
2008-03-06 Jakub Jelinek <jakub@redhat.com>
* testsuite/libgomp.c/atomic-3.c: New test.
Index: gcc/java/jcf-parse.c
===================================================================
--- gcc/java/jcf-parse.c (revision 133344)
+++ gcc/java/jcf-parse.c (working copy)
@@ -1702,6 +1702,7 @@
cgraph_build_static_cdtor ('I', body, DEFAULT_INIT_PRIORITY);
}
+
void
java_parse_file (int set_yydebug ATTRIBUTE_UNUSED)
{
@@ -1952,6 +1953,7 @@
finish:
/* Arrange for any necessary initialization to happen. */
java_emit_static_constructor ();
+ gcc_assert (global_bindings_p ());
/* Only finalize the compilation unit after we've told cgraph which
functions have their addresses stored. */
Index: gcc/java/ChangeLog
===================================================================
--- gcc/java/ChangeLog (revision 133344)
+++ gcc/java/ChangeLog (working copy)
@@ -1,3 +1,10 @@
+2008-03-11 Paolo Bonzini <bonzini@gnu.org>
+
+ * jcf-parse.c (java_parse_file): Assert binding levels are
+ left in order.
+ * lang.c (LANG_HOOKS_CLEAR_BINDING_STACK, java_clear_binding_stack):
+ Delete.
+
2008-03-02 Jakub Jelinek <jakub@redhat.com>
* jcf-dump.c (version): Update copyright notice dates.
Index: gcc/java/lang.c
===================================================================
--- gcc/java/lang.c (revision 133344)
+++ gcc/java/lang.c (working copy)
@@ -62,7 +62,6 @@
static void dump_compound_expr (dump_info_p, tree);
static bool java_decl_ok_for_sibcall (const_tree);
static tree java_get_callee_fndecl (const_tree);
-static void java_clear_binding_stack (void);
static enum classify_record java_classify_record (tree type);
@@ -197,9 +196,6 @@
#undef LANG_HOOKS_GET_CALLEE_FNDECL
#define LANG_HOOKS_GET_CALLEE_FNDECL java_get_callee_fndecl
-#undef LANG_HOOKS_CLEAR_BINDING_STACK
-#define LANG_HOOKS_CLEAR_BINDING_STACK java_clear_binding_stack
-
#undef LANG_HOOKS_SET_DECL_ASSEMBLER_NAME
#define LANG_HOOKS_SET_DECL_ASSEMBLER_NAME java_mangle_decl
@@ -949,14 +945,6 @@
}
-/* Clear the binding stack. */
-static void
-java_clear_binding_stack (void)
-{
- while (!global_bindings_p ())
- poplevel (0, 0, 0);
-}
-
static enum classify_record
java_classify_record (tree type)
{
Index: gcc/tree-ssa-loop-manip.c
===================================================================
--- gcc/tree-ssa-loop-manip.c (revision 133344)
+++ gcc/tree-ssa-loop-manip.c (working copy)
@@ -106,7 +106,7 @@
}
/* Gimplify the step if necessary. We put the computations in front of the
loop (i.e. the step should be loop invariant). */
- step = force_gimple_operand (step, &stmts, true, var);
+ step = force_gimple_operand (step, &stmts, true, NULL_TREE);
if (stmts)
gsi_insert_seq_on_edge_immediate (pe, stmts);
Index: gcc/DATESTAMP
===================================================================
--- gcc/DATESTAMP (revision 133344)
+++ gcc/DATESTAMP (working copy)
@@ -1 +1 @@
-20080310
+20080312
Index: gcc/configure
===================================================================
--- gcc/configure (revision 133344)
+++ gcc/configure (working copy)
@@ -1490,7 +1490,7 @@
use sysroot as the system root during the build
--with-sysroot=DIR Search for usr/lib, usr/include, et al, within DIR.
--with-pkgversion=PKG Use PKG in the version string in place of
- "gimple-tuples-branch merged with rev. 133081"
+ "gimple-tuples-branch merged with rev. 133138"
--with-bugurl=URL Direct users to URL to report a bug
--with-gnu-ld assume the C compiler uses GNU ld default=no
--with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib
@@ -7887,7 +7887,7 @@
*) PKGVERSION="($withval) " ;;
esac
else
- PKGVERSION="(gimple-tuples-branch merged with rev. 133081) "
+ PKGVERSION="(gimple-tuples-branch merged with rev. 133138) "
fi
Index: gcc/omp-low.c
===================================================================
--- gcc/omp-low.c (revision 133344)
+++ gcc/omp-low.c (working copy)
@@ -459,7 +459,7 @@
}
static inline tree
-maybe_lookup_decl (tree var, omp_context *ctx)
+maybe_lookup_decl (const_tree var, omp_context *ctx)
{
tree *n;
n = (tree *) pointer_map_contains (ctx->cb.decl_map, var);
@@ -482,18 +482,18 @@
return n ? (tree) n->value : NULL_TREE;
}
-/* Return true if DECL should be copied by pointer. SHARED_P is true
- if DECL is to be shared. */
+/* Return true if DECL should be copied by pointer. SHARED_CTX is
+ the parallel context if DECL is to be shared. */
static bool
-use_pointer_for_field (const_tree decl, bool shared_p)
+use_pointer_for_field (const_tree decl, omp_context *shared_ctx)
{
if (AGGREGATE_TYPE_P (TREE_TYPE (decl)))
return true;
/* We can only use copy-in/copy-out semantics for shared variables
when we know the value is not accessible from an outer scope. */
- if (shared_p)
+ if (shared_ctx)
{
/* ??? Trivially accessible from anywhere. But why would we even
be passing an address in this case? Should we simply assert
@@ -513,6 +513,34 @@
address taken. */
if (TREE_ADDRESSABLE (decl))
return true;
+
+ /* Disallow copy-in/out in nested parallel if
+ decl is shared in outer parallel, otherwise
+ each thread could store the shared variable
+ in its own copy-in location, making the
+ variable no longer really shared. */
+ if (!TREE_READONLY (decl) && shared_ctx->is_nested)
+ {
+ omp_context *up;
+
+ for (up = shared_ctx->outer; up; up = up->outer)
+ if (maybe_lookup_decl (decl, up))
+ break;
+
+ if (up && is_parallel_ctx (up))
+ {
+ tree c;
+
+ for (c = OMP_PARALLEL_CLAUSES (up->stmt);
+ c; c = OMP_CLAUSE_CHAIN (c))
+ if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_SHARED
+ && OMP_CLAUSE_DECL (c) == decl)
+ break;
+
+ if (c)
+ return true;
+ }
+ }
}
return false;
@@ -599,7 +627,7 @@
}
else if (is_parallel_ctx (ctx))
{
- bool by_ref = use_pointer_for_field (var, false);
+ bool by_ref = use_pointer_for_field (var, NULL);
x = build_receiver_ref (var, by_ref, ctx);
}
else if (ctx->outer)
@@ -969,7 +997,7 @@
gcc_assert (is_parallel_ctx (ctx));
decl = OMP_CLAUSE_DECL (c);
gcc_assert (!is_variable_sized (decl));
- by_ref = use_pointer_for_field (decl, true);
+ by_ref = use_pointer_for_field (decl, ctx);
/* Global variables don't need to be copied,
the receiver side will use them directly. */
if (is_global_var (maybe_lookup_decl_in_outer_ctx (decl, ctx)))
@@ -1004,7 +1032,7 @@
&& ! is_global_var (maybe_lookup_decl_in_outer_ctx (decl,
ctx)))
{
- by_ref = use_pointer_for_field (decl, false);
+ by_ref = use_pointer_for_field (decl, NULL);
install_var_field (decl, by_ref, ctx);
}
install_var_local (decl, ctx);
@@ -1017,7 +1045,7 @@
case OMP_CLAUSE_COPYIN:
decl = OMP_CLAUSE_DECL (c);
- by_ref = use_pointer_for_field (decl, false);
+ by_ref = use_pointer_for_field (decl, NULL);
install_var_field (decl, by_ref, ctx);
break;
@@ -1761,7 +1789,7 @@
/* Set up the DECL_VALUE_EXPR for shared variables now. This
needs to be delayed until after fixup_child_record_type so
that we get the correct type during the dereference. */
- by_ref = use_pointer_for_field (var, true);
+ by_ref = use_pointer_for_field (var, ctx);
x = build_receiver_ref (var, by_ref, ctx);
SET_DECL_VALUE_EXPR (new_var, x);
DECL_HAS_VALUE_EXPR_P (new_var) = 1;
@@ -1804,7 +1832,7 @@
break;
case OMP_CLAUSE_COPYIN:
- by_ref = use_pointer_for_field (var, false);
+ by_ref = use_pointer_for_field (var, NULL);
x = build_receiver_ref (var, by_ref, ctx);
x = lang_hooks.decls.omp_clause_assign_op (c, new_var, x);
append_to_statement_list (x, ©in_seq);
@@ -2020,7 +2048,7 @@
continue;
var = OMP_CLAUSE_DECL (c);
- by_ref = use_pointer_for_field (var, false);
+ by_ref = use_pointer_for_field (var, NULL);
ref = build_sender_ref (var, ctx);
x = lookup_decl_in_outer_ctx (var, ctx);
@@ -2072,7 +2100,7 @@
continue;
if (is_variable_sized (val))
continue;
- by_ref = use_pointer_for_field (val, false);
+ by_ref = use_pointer_for_field (val, NULL);
switch (OMP_CLAUSE_CODE (c))
{
@@ -2142,7 +2170,7 @@
mapping for OVAR. */
var = lookup_decl_in_outer_ctx (ovar, ctx);
- if (use_pointer_for_field (ovar, true))
+ if (use_pointer_for_field (ovar, ctx))
{
x = build_sender_ref (ovar, ctx);
var = build_fold_addr_expr (var);
Index: gcc/ipa-reference.c
===================================================================
--- gcc/ipa-reference.c (revision 133344)
+++ gcc/ipa-reference.c (working copy)
@@ -950,7 +950,6 @@
unsigned int index;
bitmap_iterator bi;
bitmap module_statics_readonly = BITMAP_ALLOC (&ipa_obstack);
- bitmap module_statics_const = BITMAP_ALLOC (&ipa_obstack);
bitmap bm_temp = BITMAP_ALLOC (&ipa_obstack);
EXECUTE_IF_SET_IN_BITMAP (module_statics_escape, 0, index, bi)
@@ -1000,14 +999,6 @@
fprintf (dump_file, "read-only var %s\n",
get_static_name (index));
}
- if (DECL_INITIAL (var)
- && is_gimple_min_invariant (DECL_INITIAL (var)))
- {
- bitmap_set_bit (module_statics_const, index);
- if (dump_file)
- fprintf (dump_file, "read-only constant %s\n",
- get_static_name (index));
- }
}
BITMAP_FREE(module_statics_escape);
@@ -1037,7 +1028,6 @@
}
BITMAP_FREE(module_statics_readonly);
- BITMAP_FREE(module_statics_const);
BITMAP_FREE(bm_temp);
}
Index: gcc/toplev.c
===================================================================
--- gcc/toplev.c (revision 133344)
+++ gcc/toplev.c (working copy)
@@ -958,10 +958,6 @@
rest_of_compilation for each function). */
lang_hooks.parse_file (set_yydebug);
- /* In case there were missing block closers,
- get us back to the global binding level. */
- lang_hooks.clear_binding_stack ();
-
/* Compilation is now finished except for writing
what's left of the symbol table output. */
timevar_pop (TV_PARSE);
Index: gcc/ChangeLog
===================================================================
--- gcc/ChangeLog (revision 133344)
+++ gcc/ChangeLog (working copy)
@@ -1,3 +1,134 @@
+2008-03-12 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/35549
+ * omp-low.c (maybe_lookup_decl): Constify first argument.
+ (use_pointer_for_field): Change last argument from bool to
+ omp_context *. Disallow shared copy-in/out in nested
+ parallel if decl is shared in outer parallel too.
+ (build_outer_var_ref, scan_sharing_clauses,
+ lower_rec_input_clauses, lower_copyprivate_clauses,
+ lower_send_clauses, lower_send_shared_vars): Adjust callers.
+
+2008-03-12 Victor Kaplansky <victork@il.ibm.com>
+ Ira Rosen <irar@il.ibm.com>
+
+ * tree-vectorizer.c (free_stmt_vec_info): New function.
+ (destroy_loop_vec_info): Move code to free_stmt_vec_info().
+ Call free_stmt_vec_info(). Free LOOP_VINFO_STRIDED_STORES..
+ * tree-vectorizer.h (free_stmt_vec_info): Declare.
+ * tree-vect-transform.c (vectorizable_conversion): Free
+ vec_oprnds0 if it was allocated.
+ (vect_permute_store_chain): Remove unused VECs.
+ (vectorizable_store): Free VECs that are allocated in the..
+ function.
+ (vect_transform_strided_load, vectorizable_load): Likewise.
+ (vect_remove_stores): Simplify the code.
+ (vect_transform_loop): Move code to vect_remove_stores().
+ Call vect_remove_stores() and free_stmt_vec_info().
+
+2008-03-11 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ * pa.h (TARGET_LONG_PIC_SDIFF_CALL): Conditionalize define on
+ TARGET_HPUX. Revise comment.
+ (TARGET_LONG_PIC_PCREL_CALL): Revise comment.
+ * pa.c (output_call): Update for revised TARGET_LONG_PIC_SDIFF_CALL.
+ Use sr4 variant of `be' instruction when not generating PIC code.
+ (attr_length_call): Adjust for above change.
+
+2008-03-11 Andrew Pinski <andrew_pinski@playstation.sony.com>
+
+ * ipa-reference.c (static_execute): Remove module_statics_const and
+ associated setting code.
+
+2008-03-11 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/35540
+ * config/i386/i386.md (paritysi2, paritydi2): Use register_operand
+ constraint for operand 1.
+ (paritysi2_cmp): Use register_operand constraint for operand 2.
+ Use earlyclobber modifier for operand 1. Remove support for
+ memory operands.
+ (paritydi2_cmp): Use register_operand constraint for operand 3.
+ Use earlyclobber modifier for operand 1. Remove support for
+ memory operands.
+
+2008-03-11 Paul Brook <paul@codesourcery.com>
+ Vladimir Prus <vladimir@codesourcery.com>
+
+ * config/arm/arm.c (use_return_insn): Check TARGET_APCS_FRAME.
+ (arm_compute_save_reg0_reg12_mask): Always
+ check if register 11 must be saved. Always safe hard frame pointer
+ when frame_pointer_needeed.
+ (arm_compute_save_reg_mask): Save IP and PC
+ only with apcs frames.
+ (arm_output_epilogue): Adjust Thumb2 codepath to
+ be also invoked and work for ARM non-apcs frames.
+ (arm_expand_prologue): Don't bother saving IP
+ for non-apcs frame, since it's not clobbered by
+ prologue code. Implement non-apcs frame
+ layout.
+
+2008-03-11 Paolo Bonzini <bonzini@gnu.org>
+
+ PR rtl-optimization/35281
+ * expr.c (convert_move): Use a new pseudo for the intermediate
+ from_mode->word_mode result.
+
+2008-03-11 Paolo Bonzini <bonzini@gnu.org>
+
+ * langhooks-def.h (LANG_HOOKS_CLEAR_BINDING_STACK): Delete.
+ * langhooks.h (struct lang_hooks): Delete clear_binding_stack member.
+ * toplev.c (compile_file): Don't call it.
+
+2008-03-11 Uros Bizjak <ubizjak@gmail.com>
+
+ PR middle-end/35526
+ * expr.c (store_expr): Call emit_block_move if the mode
+ of "temp" RTX is BLKmode.
+
+2008-03-11 Andrew Pinski <andrew_pinski@playstation.sony.com>
+ Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/31358
+ * tree-ssa-loop-manip.c (create_iv): Call force_gimple_operand for
+ the step with a NULL_TREE.
+ * tree-ssa-loop-ivopts.c (find_bivs): Convert the step
+ to sizetype if type is a pointer type.
+ (add_candidate_1): Don't convert the base and step to
+ the generic type if the orginal type is a pointer type.
+ (add_iv_value_candidates): Use sizetype for the step
+ if type is a pointer type.
+ (cand_value_at): Likewise.
+ * tree-ssa-address.c (add_to_parts): Use POINTER_PLUS_EXPR
+ for pointer types.
+ * tree-affine.c (tree_to_aff_combination <POINTER_PLUS_EXPR>):
+ Don't convert the tem affine to the type.
+ (add_elt_to_tree): Use sizetype for the step if a pointer.
+ Use POINTER_PLUS_EXPR for pointers.
+ (aff_combination_to_tree): Use sizetype for the step if a
+ pointer.
+
+2008-03-10 Vladimir Makarov <vmakarov@redhat.com>
+
+ * config/i386/sse.md (ssse3_pmaddubswv8hi3, ssse3_pmaddubswv4hi3):
+ Remove commutativity hint.
+
+2008-03-10 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/35438
+ PR c/35439
+ * c-parser.c (c_parser_omp_threadprivate): Don't add vars with
+ errorneous type. Check that v is a VAR_DECL.
+
+ PR middle-end/35099
+ * tree-cfg.c (new_label_mapper): Update cfun->last_label_uid.
+
+2008-03-10 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR tree-optimization/35494
+ * tree-ssa-ccp.c (get_symbol_constant_value): Check if value
+ may be overriden at link and run time.
+
2008-03-10 Richard Guenther <rguenther@suse.de>
PR tree-optimization/34677
@@ -20,7 +151,7 @@
to avoid conflicts.
2008-03-10 Paul Brook <paul@codesourcery.com>
- Mark Shinwell <shinwell@codesourcery.com>
+ Mark Shinwell <shinwell@codesourcery.com>
* config/arm/cortex-r4.md: New.
* config/arm/thumb2.md (divsi3, udivsi3): Annotate with
@@ -535,7 +666,7 @@
__absvsi2, __absvDI2): Use unsigned arithmetic.
2008-03-02 Andi Kleen <ak@suse.de>
- Richard Guenther <rguenther@suse.de>
+ Richard Guenther <rguenther@suse.de>
* struct-equiv.c: Remove file.
* cfg_cleanup.c (condjump_equiv_p): Remove.
Index: gcc/testsuite/ChangeLog
===================================================================
--- gcc/testsuite/ChangeLog (revision 133344)
+++ gcc/testsuite/ChangeLog (working copy)
@@ -1,19 +1,53 @@
+2008-03-11 Andrew Pinski <andrew_pinski@playstation.sony.com>
+
+ PR tree-opt/35403
+ * gcc.dg/tree-ssa/ipa-reference-1.c: New testcase.
+
+2008-03-11 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/35540
+ * gcc.target/i386/pr35540.c: New test.
+
+2008-03-11 Uros Bizjak <ubizjak@gmail.com>
+
+ * g++.dg/inherit/override-attribs.C: Require ilp32 x86 target.
+
+2008-03-11 Uros Bizjak <ubizjak@gmail.com>
+
+ PR middle-end/35526
+ * g++.dg/torture/pr35526.C: New test.
+
+2008-03-10 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/35328
+ * g++.dg/gomp/pr35328.C: New test.
+
+ PR c++/35337
+ * g++.dg/gomp/pr35337.C: New test.
+
+ PR c/35438
+ PR c/35439
+ * gcc.dg/gomp/pr35438.c: New test.
+ * gcc.dg/gomp/pr35439.c: New test.
+
+ PR middle-end/35099
+ * g++.dg/gomp/pr35099.C: New test.
+
+2008-03-10 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/range_check2.adb: New test.
+
+2008-03-10 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR tree-optimization/35494
+ * g++.dg/tree-ssa/ssa-store-ccp-1.C: New.
+ * gcc.dg/tree-ssa/ssa-store-ccp-2.c: Likewise.
+ * gcc.dg/tree-ssa/ssa-store-ccp-3.c: Likewise.
+ * gcc.dg/tree-ssa/ssa-store-ccp-4.c: Likewise.
+
2008-03-10 Richard Guenther <rguenther@suse.de>
PR tree-optimization/34677
- * tree-ssa-pre.c (modify_expr_node_pool): Remove.
- (poolify_tree): Likewise.
- (modify_expr_template): Likewise.
- (poolify_modify_stmt): Likewise.
- (insert_fake_stores): Handle all component-ref style stores
- in addition to INDIRECT_REF. Also handle complex types.
- Do not poolify the inserted load.
- (realify_fake_stores): Do not rebuild the tree but only
- make it a SSA_NAME copy.
- (init_pre): Remove initialzation of modify_expr_template.
- Do not allocate modify_expr_node_pool.
- (fini_pre): Do not free modify_expr_node_pool.
-
* gcc.dg/tree-ssa/loadpre23.c: New testcase.
* gcc.dg/tree-ssa/loadpre24.c: Likewise.
* gcc.dg/tree-ssa/loadpre25.c: Likewise.
Index: gcc/testsuite/g++.dg/inherit/override-attribs.C
===================================================================
--- gcc/testsuite/g++.dg/inherit/override-attribs.C (revision 133344)
+++ gcc/testsuite/g++.dg/inherit/override-attribs.C (working copy)
@@ -1,5 +1,7 @@
// PR c++/14688
-// { dg-do compile { target i?86-*-* } }
+// { dg-do compile { target i?86-*-* x86_64-*-* } }
+// { dg-require-effective-target ilp32 }
+
class one
{
public:
Index: gcc/cp/ChangeLog
===================================================================
--- gcc/cp/ChangeLog (revision 133344)
+++ gcc/cp/ChangeLog (working copy)
@@ -1,3 +1,13 @@
+2008-03-10 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/35328
+ * semantics.c (finish_omp_clauses): Look through NOP_EXPR even
+ if errorcount.
+
+ PR c++/35337
+ * semantics.c (finish_omp_clauses): Use %qD instead of %qE for
+ DECL_P in not a variable and appears more than once error messages.
+
2008-03-07 Paolo Bonzini <bonzini@gnu.org>
Revert:
Index: gcc/cp/semantics.c
===================================================================
--- gcc/cp/semantics.c (revision 133344)
+++ gcc/cp/semantics.c (working copy)
@@ -3400,13 +3400,16 @@
{
if (processing_template_decl)
break;
- error ("%qE is not a variable in clause %<firstprivate%>", t);
+ if (DECL_P (t))
+ error ("%qD is not a variable in clause %<firstprivate%>", t);
+ else
+ error ("%qE is not a variable in clause %<firstprivate%>", t);
remove = true;
}
else if (bitmap_bit_p (&generic_head, DECL_UID (t))
|| bitmap_bit_p (&firstprivate_head, DECL_UID (t)))
{
- error ("%qE appears more than once in data clauses", t);
+ error ("%qD appears more than once in data clauses", t);
remove = true;
}
else
@@ -3419,13 +3422,16 @@
{
if (processing_template_decl)
break;
- error ("%qE is not a variable in clause %<lastprivate%>", t);
+ if (DECL_P (t))
+ error ("%qD is not a variable in clause %<lastprivate%>", t);
+ else
+ error ("%qE is not a variable in clause %<lastprivate%>", t);
remove = true;
}
else if (bitmap_bit_p (&generic_head, DECL_UID (t))
|| bitmap_bit_p (&lastprivate_head, DECL_UID (t)))
{
- error ("%qE appears more than once in data clauses", t);
+ error ("%qD appears more than once in data clauses", t);
remove = true;
}
else
@@ -3661,7 +3667,7 @@
complete_ctor_identifier,
t, inner_type, LOOKUP_NORMAL);
- if (targetm.cxx.cdtor_returns_this ())
+ if (targetm.cxx.cdtor_returns_this () || errorcount)
/* Because constructors and destructors return this,
the call will have been cast to "void". Remove the
cast here. We would like to use STRIP_NOPS, but it
@@ -3683,7 +3689,7 @@
t = build_special_member_call (t, complete_dtor_identifier,
NULL, inner_type, LOOKUP_NORMAL);
- if (targetm.cxx.cdtor_returns_this ())
+ if (targetm.cxx.cdtor_returns_this () || errorcount)
/* Because constructors and destructors return this,
the call will have been cast to "void". Remove the
cast here. We would like to use STRIP_NOPS, but it
Index: gcc/tree-ssa-ccp.c
===================================================================
--- gcc/tree-ssa-ccp.c (revision 133344)
+++ gcc/tree-ssa-ccp.c (working copy)
@@ -301,7 +301,10 @@
{
if (TREE_STATIC (sym)
&& TREE_READONLY (sym)
- && !MTAG_P (sym))
+ && !MTAG_P (sym)
+ /* Check if a read-only definition may be overridden at
+ link and run time. */
+ && targetm.binds_local_p (sym))
{
tree val = DECL_INITIAL (sym);
if (val
Index: gcc/tree-ssa-loop-ivopts.c
===================================================================
--- gcc/tree-ssa-loop-ivopts.c (revision 133344)
+++ gcc/tree-ssa-loop-ivopts.c (working copy)
@@ -918,7 +918,12 @@
type = TREE_TYPE (PHI_RESULT (phi));
base = fold_convert (type, base);
if (step)
- step = fold_convert (type, step);
+ {
+ if (POINTER_TYPE_P (type))
+ step = fold_convert (sizetype, step);
+ else
+ step = fold_convert (type, step);
+ }
set_iv (data, PHI_RESULT (phi), base, step);
found = true;
@@ -2036,7 +2041,9 @@
{
orig_type = TREE_TYPE (base);
type = generic_type_for (orig_type);
- if (type != orig_type)
+ /* Don't convert the base to the generic type for pointers as the generic
+ type is an integer type with the same size as the pointer type. */
+ if (type != orig_type && !POINTER_TYPE_P (orig_type))
{
base = fold_convert (type, base);
step = fold_convert (type, step);
@@ -2234,13 +2241,17 @@
{
unsigned HOST_WIDE_INT offset;
tree base;
+ tree basetype;
add_candidate (data, iv->base, iv->step, false, use);
/* The same, but with initial value zero. Make such variable important,
since it is generic enough so that possibly many uses may be based
on it. */
- add_candidate (data, build_int_cst (TREE_TYPE (iv->base), 0),
+ basetype = TREE_TYPE (iv->base);
+ if (POINTER_TYPE_P (basetype))
+ basetype = sizetype;
+ add_candidate (data, build_int_cst (basetype, 0),
iv->step, true, use);
/* Third, try removing the constant offset. */
@@ -3668,10 +3679,13 @@
aff_tree step, delta, nit;
struct iv *iv = cand->iv;
tree type = TREE_TYPE (iv->base);
+ tree steptype = type;
+ if (POINTER_TYPE_P (type))
+ steptype = sizetype;
- tree_to_aff_combination (iv->step, type, &step);
+ tree_to_aff_combination (iv->step, steptype, &step);
tree_to_aff_combination (niter, TREE_TYPE (niter), &nit);
- aff_combination_convert (&nit, type);
+ aff_combination_convert (&nit, steptype);
aff_combination_mult (&nit, &step, &delta);
if (stmt_after_increment (loop, cand, at))
aff_combination_add (&delta, &step);
Index: gcc/expr.c
===================================================================
--- gcc/expr.c (revision 133344)
+++ gcc/expr.c (working copy)
@@ -552,15 +552,15 @@
&& ((code = can_extend_p (to_mode, word_mode, unsignedp))
!= CODE_FOR_nothing))
{
+ rtx word_to = gen_reg_rtx (word_mode);
if (REG_P (to))
{
if (reg_overlap_mentioned_p (to, from))
from = force_reg (from_mode, from);
emit_insn (gen_rtx_CLOBBER (VOIDmode, to));
}
- convert_move (gen_lowpart (word_mode, to), from, unsignedp);
- emit_unop_insn (code, to,
- gen_lowpart (word_mode, to), equiv_code);
+ convert_move (word_to, from, unsignedp);
+ emit_unop_insn (code, to, word_to, equiv_code);
return;
}
@@ -4654,7 +4654,8 @@
temp = convert_to_mode (GET_MODE (target), temp, unsignedp);
emit_move_insn (target, temp);
}
- else if (GET_MODE (target) == BLKmode)
+ else if (GET_MODE (target) == BLKmode
+ || GET_MODE (temp) == BLKmode)
emit_block_move (target, temp, expr_size (exp),
(call_param_p
? BLOCK_OP_CALL_PARM
Index: gcc/ada/ChangeLog
===================================================================
--- gcc/ada/ChangeLog (revision 133344)
+++ gcc/ada/ChangeLog (working copy)
@@ -1,3 +1,8 @@
+2008-03-10 Eric Botcazou <ebotcazou@adacore.com>
+
+ * trans.c (emit_range_check): Do not emit the check if the base type
+ of the expression is the type against which its range must be checked.
+
2008-03-08 Eric Botcazou <ebotcazou@adacore.com>
* decl.c (maybe_pad_type): Use value_factor_p.
Index: gcc/ada/trans.c
===================================================================
--- gcc/ada/trans.c (revision 133344)
+++ gcc/ada/trans.c (working copy)
@@ -5757,6 +5757,11 @@
tree gnu_high = TYPE_MAX_VALUE (gnu_range_type);
tree gnu_compare_type = get_base_type (TREE_TYPE (gnu_expr));
+ /* If GNU_EXPR has GNAT_RANGE_TYPE as its base type, no check is needed.
+ This can for example happen when translating 'Val or 'Value. */
+ if (gnu_compare_type == gnu_range_type)
+ return gnu_expr;
+
/* If GNU_EXPR has an integral type that is narrower than GNU_RANGE_TYPE,
we can't do anything since we might be truncating the bounds. No
check is needed in this case. */
Index: gcc/fortran/ChangeLog
===================================================================
--- gcc/fortran/ChangeLog (revision 133344)
+++ gcc/fortran/ChangeLog (working copy)
@@ -1,3 +1,9 @@
+2008-03-11 Paolo Bonzini <bonzini@gnu.org>
+
+ * f95-lang.c (LANG_HOOKS_CLEAR_BINDING_STACK): Delete.
+ (gfc_be_parse_file): Call clear_binding_stack from here.
+ (gfc_clear_binding_stack): Rename to clear_binding_stack.
+
2008-03-09 Paul Thomas <pault@gcc.gnu.org>
PR fortran/35474
Index: gcc/fortran/f95-lang.c
===================================================================
--- gcc/fortran/f95-lang.c (revision 133344)
+++ gcc/fortran/f95-lang.c (working copy)
@@ -96,7 +96,7 @@
void do_function_end (void);
int global_bindings_p (void);
void insert_block (tree);
-static void gfc_clear_binding_stack (void);
+static void clear_binding_stack (void);
static void gfc_be_parse_file (int);
static alias_set_type gfc_get_alias_set (tree);
@@ -111,7 +111,6 @@
#undef LANG_HOOKS_MARK_ADDRESSABLE
#undef LANG_HOOKS_TYPE_FOR_MODE
#undef LANG_HOOKS_TYPE_FOR_SIZE
-#undef LANG_HOOKS_CLEAR_BINDING_STACK
#undef LANG_HOOKS_GET_ALIAS_SET
#undef LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE
#undef LANG_HOOKS_OMP_PREDETERMINED_SHARING
@@ -134,7 +133,6 @@
#define LANG_HOOKS_MARK_ADDRESSABLE gfc_mark_addressable
#define LANG_HOOKS_TYPE_FOR_MODE gfc_type_for_mode
#define LANG_HOOKS_TYPE_FOR_SIZE gfc_type_for_size
-#define LANG_HOOKS_CLEAR_BINDING_STACK gfc_clear_binding_stack
#define LANG_HOOKS_GET_ALIAS_SET gfc_get_alias_set
#define LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE gfc_omp_privatize_by_reference
#define LANG_HOOKS_OMP_PREDETERMINED_SHARING gfc_omp_predetermined_sharing
@@ -268,6 +266,8 @@
gfc_get_errors (&warnings, &errors);
errorcount += errors;
warningcount += warnings;
+
+ clear_binding_stack ();
}
@@ -536,7 +536,7 @@
/* Clear the binding stack. */
static void
-gfc_clear_binding_stack (void)
+clear_binding_stack (void)
{
while (!global_bindings_p ())
poplevel (0, 0, 0);
Index: gcc/configure.ac
===================================================================
--- gcc/configure.ac (revision 133344)
+++ gcc/configure.ac (working copy)
@@ -775,7 +775,7 @@
[onestep=""])
AC_SUBST(onestep)
-ACX_PKGVERSION([gimple-tuples-branch merged with rev. 133081])
+ACX_PKGVERSION([gimple-tuples-branch merged with rev. 133138])
ACX_BUGURL([http://gcc.gnu.org/bugs.html])
# Sanity check enable_languages in case someone does not run the toplevel
Index: gcc/tree-vectorizer.c
===================================================================
--- gcc/tree-vectorizer.c (revision 133344)
+++ gcc/tree-vectorizer.c (working copy)
@@ -1547,6 +1547,22 @@
}
+/* Free stmt vectorization related info. */
+
+void
+free_stmt_vec_info (tree stmt)
+{
+ stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
+
+ if (!stmt_info)
+ return;
+
+ VEC_free (dr_p, heap, STMT_VINFO_SAME_ALIGN_REFS (stmt_info));
+ free (stmt_info);
+ set_stmt_info (stmt_ann (stmt), NULL);
+}
+
+
/* Function bb_in_loop_p
Used as predicate for dfs order traversal of the loop bbs. */
@@ -1703,21 +1719,13 @@
{
basic_block bb = bbs[j];
tree phi;
- stmt_vec_info stmt_info;
for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
- {
- stmt_ann_t ann = stmt_ann (phi);
+ free_stmt_vec_info (phi);
- stmt_info = vinfo_for_stmt (phi);
- free (stmt_info);
- set_stmt_info (ann, NULL);
- }
-
for (si = bsi_start (bb); !bsi_end_p (si); )
{
tree stmt = bsi_stmt (si);
- stmt_ann_t ann = stmt_ann (stmt);
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
if (stmt_info)
@@ -1735,9 +1743,7 @@
}
/* Free stmt_vec_info. */
- VEC_free (dr_p, heap, STMT_VINFO_SAME_ALIGN_REFS (stmt_info));
- free (stmt_info);
- set_stmt_info (ann, NULL);
+ free_stmt_vec_info (stmt);
/* Remove dead "pattern stmts". */
if (remove_stmt_p)
@@ -1756,6 +1762,7 @@
for (j = 0; VEC_iterate (slp_instance, slp_instances, j, instance); j++)
vect_free_slp_tree (SLP_INSTANCE_TREE (instance));
VEC_free (slp_instance, heap, LOOP_VINFO_SLP_INSTANCES (loop_vinfo));
+ VEC_free (tree, heap, LOOP_VINFO_STRIDED_STORES (loop_vinfo));
free (loop_vinfo);
loop->aux = NULL;
Index: gcc/langhooks.h
===================================================================
--- gcc/langhooks.h (revision 133344)
+++ gcc/langhooks.h (working copy)
@@ -294,9 +294,6 @@
parsers to dump debugging information during parsing. */
void (*parse_file) (int);
- /* Called immediately after parsing to clear the binding stack. */
- void (*clear_binding_stack) (void);
-
/* Called to obtain the alias set to be used for an expression or type.
Returns -1 if the language does nothing special for it. */
alias_set_type (*get_alias_set) (tree);
Index: gcc/tree-vectorizer.h
===================================================================
--- gcc/tree-vectorizer.h (revision 133344)
+++ gcc/tree-vectorizer.h (working copy)
@@ -668,6 +668,7 @@
extern loop_vec_info new_loop_vec_info (struct loop *loop);
extern void destroy_loop_vec_info (loop_vec_info, bool);
extern stmt_vec_info new_stmt_vec_info (tree stmt, loop_vec_info);
+extern void free_stmt_vec_info (tree stmt);
/** In tree-vect-analyze.c **/
Index: gcc/tree-affine.c
===================================================================
--- gcc/tree-affine.c (revision 133344)
+++ gcc/tree-affine.c (working copy)
@@ -279,7 +279,6 @@
case POINTER_PLUS_EXPR:
tree_to_aff_combination (TREE_OPERAND (expr, 0), type, comb);
tree_to_aff_combination (TREE_OPERAND (expr, 1), sizetype, &tmp);
- aff_combination_convert (&tmp, type);
aff_combination_add (comb, &tmp);
return;
@@ -350,29 +349,40 @@
aff_tree *comb)
{
enum tree_code code;
+ tree type1 = type;
+ if (POINTER_TYPE_P (type))
+ type1 = sizetype;
scale = double_int_ext_for_comb (scale, comb);
- elt = fold_convert (type, elt);
+ elt = fold_convert (type1, elt);
if (double_int_one_p (scale))
{
if (!expr)
- return elt;
+ return fold_convert (type, elt);
+ if (POINTER_TYPE_P (type))
+ return fold_build2 (POINTER_PLUS_EXPR, type, expr, elt);
return fold_build2 (PLUS_EXPR, type, expr, elt);
}
if (double_int_minus_one_p (scale))
{
if (!expr)
- return fold_build1 (NEGATE_EXPR, type, elt);
+ return fold_convert (type, fold_build1 (NEGATE_EXPR, type1, elt));
+ if (POINTER_TYPE_P (type))
+ {
+ elt = fold_build1 (NEGATE_EXPR, type1, elt);
+ return fold_build2 (POINTER_PLUS_EXPR, type, expr, elt);
+ }
return fold_build2 (MINUS_EXPR, type, expr, elt);
}
if (!expr)
- return fold_build2 (MULT_EXPR, type, elt,
- double_int_to_tree (type, scale));
+ return fold_convert (type,
+ fold_build2 (MULT_EXPR, type1, elt,
+ double_int_to_tree (type1, scale)));
if (double_int_negative_p (scale))
{
@@ -382,8 +392,14 @@
else
code = PLUS_EXPR;
- elt = fold_build2 (MULT_EXPR, type, elt,
- double_int_to_tree (type, scale));
+ elt = fold_build2 (MULT_EXPR, type1, elt,
+ double_int_to_tree (type1, scale));
+ if (POINTER_TYPE_P (type))
+ {
+ if (code == MINUS_EXPR)
+ elt = fold_build1 (NEGATE_EXPR, type1, elt);
+ return fold_build2 (POINTER_PLUS_EXPR, type, expr, elt);
+ }
return fold_build2 (code, type, expr, elt);
}
@@ -396,6 +412,9 @@
tree expr = comb->rest;
unsigned i;
double_int off, sgn;
+ tree type1 = type;
+ if (POINTER_TYPE_P (type))
+ type1 = sizetype;
gcc_assert (comb->n == MAX_AFF_ELTS || comb->rest == NULL_TREE);
@@ -415,7 +434,7 @@
off = comb->offset;
sgn = double_int_one;
}
- return add_elt_to_tree (expr, type, double_int_to_tree (type, off), sgn,
+ return add_elt_to_tree (expr, type, double_int_to_tree (type1, off), sgn,
comb);
}
Index: gcc/tree-vect-transform.c
===================================================================
--- gcc/tree-vect-transform.c (revision 133344)
+++ gcc/tree-vect-transform.c (working copy)
@@ -3633,6 +3633,9 @@
*vec_stmt = STMT_VINFO_VEC_STMT (stmt_info);
}
+ if (vec_oprnds0)
+ VEC_free (tree, heap, vec_oprnds0);
+
return true;
}
@@ -4584,11 +4587,8 @@
tree scalar_dest, tmp;
int i;
unsigned int j;
- VEC(tree,heap) *first, *second;
scalar_dest = GIMPLE_STMT_OPERAND (stmt, 0);
- first = VEC_alloc (tree, heap, length/2);
- second = VEC_alloc (tree, heap, length/2);
/* Check that the operation is supported. */
if (!vect_strided_store_supported (vectype))
@@ -4971,6 +4971,11 @@
}
}
+ VEC_free (tree, heap, dr_chain);
+ VEC_free (tree, heap, oprnds);
+ if (result_chain)
+ VEC_free (tree, heap, result_chain);
+
return true;
}
@@ -5476,6 +5481,8 @@
break;
}
}
+
+ VEC_free (tree, heap, result_chain);
return true;
}
@@ -5913,6 +5920,7 @@
if (!vect_transform_strided_load (stmt, dr_chain, group_size, bsi))
return false;
*vec_stmt = STMT_VINFO_VEC_STMT (stmt_info);
+ VEC_free (tree, heap, dr_chain);
dr_chain = VEC_alloc (tree, heap, group_size);
}
else
@@ -5925,6 +5933,9 @@
}
}
+ if (dr_chain)
+ VEC_free (tree, heap, dr_chain);
+
return true;
}
@@ -7261,10 +7272,8 @@
static void
vect_remove_stores (tree first_stmt)
{
- stmt_ann_t ann;
tree next = first_stmt;
tree tmp;
- stmt_vec_info next_stmt_info;
block_stmt_iterator next_si;
while (next)
@@ -7272,11 +7281,8 @@
/* Free the attached stmt_vec_info and remove the stmt. */
next_si = bsi_for_stmt (next);
bsi_remove (&next_si, true);
- next_stmt_info = vinfo_for_stmt (next);
- ann = stmt_ann (next);
- tmp = DR_GROUP_NEXT_DR (next_stmt_info);
- free (next_stmt_info);
- set_stmt_info (ann, NULL);
+ tmp = DR_GROUP_NEXT_DR (vinfo_for_stmt (next));
+ free_stmt_vec_info (next);
next = tmp;
}
}
@@ -7375,7 +7381,7 @@
struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
basic_block *bbs = LOOP_VINFO_BBS (loop_vinfo);
int nbbs = loop->num_nodes;
- block_stmt_iterator si, next_si;
+ block_stmt_iterator si;
int i;
tree ratio = NULL;
int vectorization_factor = LOOP_VINFO_VECT_FACTOR (loop_vinfo);
@@ -7540,37 +7546,19 @@
is_store = vect_transform_stmt (stmt, &si, &strided_store, NULL);
if (is_store)
{
- stmt_ann_t ann;
if (STMT_VINFO_STRIDED_ACCESS (stmt_info))
{
/* Interleaving. If IS_STORE is TRUE, the vectorization of the
interleaving chain was completed - free all the stores in
the chain. */
- tree next = DR_GROUP_FIRST_DR (stmt_info);
- tree tmp;
- stmt_vec_info next_stmt_info;
-
- while (next)
- {
- next_si = bsi_for_stmt (next);
- next_stmt_info = vinfo_for_stmt (next);
- /* Free the attached stmt_vec_info and remove the stmt. */
- ann = stmt_ann (next);
- tmp = DR_GROUP_NEXT_DR (next_stmt_info);
- free (next_stmt_info);
- set_stmt_info (ann, NULL);
- bsi_remove (&next_si, true);
- next = tmp;
- }
+ vect_remove_stores (DR_GROUP_FIRST_DR (stmt_info));
bsi_remove (&si, true);
continue;
}
else
{
/* Free the attached stmt_vec_info and remove the stmt. */
- ann = stmt_ann (stmt);
- free (stmt_info);
- set_stmt_info (ann, NULL);
+ free_stmt_vec_info (stmt);
bsi_remove (&si, true);
continue;
}
Index: gcc/tree-cfg.c
===================================================================
--- gcc/tree-cfg.c (revision 133344)
+++ gcc/tree-cfg.c (working copy)
@@ -5583,6 +5583,8 @@
m->base.from = decl;
m->to = create_artificial_label ();
LABEL_DECL_UID (m->to) = LABEL_DECL_UID (decl);
+ if (LABEL_DECL_UID (m->to) >= cfun->last_label_uid)
+ cfun->last_label_uid = LABEL_DECL_UID (m->to) + 1;
slot = htab_find_slot_with_hash (hash, m, m->hash, INSERT);
gcc_assert (*slot == NULL);
Index: gcc/c-parser.c
===================================================================
--- gcc/c-parser.c (revision 133344)
+++ gcc/c-parser.c (working copy)
@@ -1,6 +1,7 @@
/* Parser for C and Objective-C.
Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008
+ Free Software Foundation, Inc.
Parser actions based on the old Bison parser; structure somewhat
influenced by and fragments based on the C++ parser.
@@ -7964,10 +7965,14 @@
/* If V had already been marked threadprivate, it doesn't matter
whether it had been used prior to this point. */
- if (TREE_USED (v) && !C_DECL_THREADPRIVATE_P (v))
+ if (TREE_CODE (v) != VAR_DECL)
+ error ("%qD is not a variable", v);
+ else if (TREE_USED (v) && !C_DECL_THREADPRIVATE_P (v))
error ("%qE declared %<threadprivate%> after first use", v);
else if (! TREE_STATIC (v) && ! DECL_EXTERNAL (v))
error ("automatic variable %qE cannot be %<threadprivate%>", v);
+ else if (TREE_TYPE (v) == error_mark_node)
+ ;
else if (! COMPLETE_TYPE_P (TREE_TYPE (v)))
error ("%<threadprivate%> %qE has incomplete type", v);
else
Index: gcc/config/i386/i386.md
===================================================================
--- gcc/config/i386/i386.md (revision 133344)
+++ gcc/config/i386/i386.md (working copy)
@@ -15429,7 +15429,7 @@
(define_expand "paritydi2"
[(set (match_operand:DI 0 "register_operand" "")
- (parity:DI (match_operand:DI 1 "nonimmediate_operand" "")))]
+ (parity:DI (match_operand:DI 1 "register_operand" "")))]
"! TARGET_POPCNT"
{
rtx scratch = gen_reg_rtx (QImode);
@@ -15457,10 +15457,10 @@
(define_insn_and_split "paritydi2_cmp"
[(set (reg:CC FLAGS_REG)
- (parity:CC (match_operand:DI 3 "nonimmediate_operand" "0,m")))
- (clobber (match_scratch:DI 0 "=r,X"))
- (clobber (match_scratch:SI 1 "=r,r"))
- (clobber (match_scratch:HI 2 "=Q,Q"))]
+ (parity:CC (match_operand:DI 3 "register_operand" "0")))
+ (clobber (match_scratch:DI 0 "=r"))
+ (clobber (match_scratch:SI 1 "=&r"))
+ (clobber (match_scratch:HI 2 "=Q"))]
"! TARGET_POPCNT"
"#"
"&& reload_completed"
@@ -15476,20 +15476,18 @@
{
operands[4] = gen_lowpart (SImode, operands[3]);
- if (MEM_P (operands[3]))
- emit_move_insn (operands[1], gen_highpart (SImode, operands[3]));
- else if (! TARGET_64BIT)
- operands[1] = gen_highpart (SImode, operands[3]);
- else
+ if (TARGET_64BIT)
{
emit_move_insn (operands[1], gen_lowpart (SImode, operands[3]));
emit_insn (gen_lshrdi3 (operands[3], operands[3], GEN_INT (32)));
}
+ else
+ operands[1] = gen_highpart (SImode, operands[3]);
})
(define_expand "paritysi2"
[(set (match_operand:SI 0 "register_operand" "")
- (parity:SI (match_operand:SI 1 "nonimmediate_operand" "")))]
+ (parity:SI (match_operand:SI 1 "register_operand" "")))]
"! TARGET_POPCNT"
{
rtx scratch = gen_reg_rtx (QImode);
@@ -15508,9 +15506,9 @@
(define_insn_and_split "paritysi2_cmp"
[(set (reg:CC FLAGS_REG)
- (parity:CC (match_operand:SI 2 "nonimmediate_operand" "0,m")))
- (clobber (match_scratch:SI 0 "=r,X"))
- (clobber (match_scratch:HI 1 "=Q,Q"))]
+ (parity:CC (match_operand:SI 2 "register_operand" "0")))
+ (clobber (match_scratch:SI 0 "=r"))
+ (clobber (match_scratch:HI 1 "=&Q"))]
"! TARGET_POPCNT"
"#"
"&& reload_completed"
@@ -15525,13 +15523,8 @@
{
operands[3] = gen_lowpart (HImode, operands[2]);
- if (MEM_P (operands[2]))
- emit_move_insn (operands[1], gen_highpart (HImode, operands[2]));
- else
- {
- emit_move_insn (operands[1], gen_lowpart (HImode, operands[2]));
- emit_insn (gen_lshrsi3 (operands[2], operands[2], GEN_INT (16)));
- }
+ emit_move_insn (operands[1], gen_lowpart (HImode, operands[2]));
+ emit_insn (gen_lshrsi3 (operands[2], operands[2], GEN_INT (16)));
})
(define_insn "*parityhi2_cmp"
Index: gcc/config/i386/sse.md
===================================================================
--- gcc/config/i386/sse.md (revision 133344)
+++ gcc/config/i386/sse.md (working copy)
@@ -5969,7 +5969,7 @@
(mult:V8HI
(zero_extend:V8HI
(vec_select:V4QI
- (match_operand:V16QI 1 "nonimmediate_operand" "%0")
+ (match_operand:V16QI 1 "nonimmediate_operand" "0")
(parallel [(const_int 0)
(const_int 2)
(const_int 4)
@@ -6023,7 +6023,7 @@
(mult:V4HI
(zero_extend:V4HI
(vec_select:V4QI
- (match_operand:V8QI 1 "nonimmediate_operand" "%0")
+ (match_operand:V8QI 1 "nonimmediate_operand" "0")
(parallel [(const_int 0)
(const_int 2)
(const_int 4)
Index: gcc/config/arm/arm.c
===================================================================
--- gcc/config/arm/arm.c (revision 133344)
+++ gcc/config/arm/arm.c (working copy)
@@ -1662,7 +1662,8 @@
|| current_function_calls_alloca
/* Or if there is a stack adjustment. However, if the stack pointer
is saved on the stack, we can use a pre-incrementing stack load. */
- || !(stack_adjust == 0 || (frame_pointer_needed && stack_adjust == 4)))
+ || !(stack_adjust == 0 || (TARGET_APCS_FRAME && frame_pointer_needed
+ && stack_adjust == 4)))
return 0;
saved_int_regs = arm_compute_save_reg_mask ();
@@ -10706,26 +10707,15 @@
}
else
{
- /* In arm mode we handle r11 (FP) as a special case. */
- unsigned last_reg = TARGET_ARM ? 10 : 11;
-
/* In the normal case we only need to save those registers
which are call saved and which are used by this function. */
- for (reg = 0; reg <= last_reg; reg++)
+ for (reg = 0; reg <= 11; reg++)
if (df_regs_ever_live_p (reg) && ! call_used_regs[reg])
save_reg_mask |= (1 << reg);
/* Handle the frame pointer as a special case. */
- if (! TARGET_APCS_FRAME
- && ! frame_pointer_needed
- && df_regs_ever_live_p (HARD_FRAME_POINTER_REGNUM)
- && ! call_used_regs[HARD_FRAME_POINTER_REGNUM])
+ if (frame_pointer_needed)
save_reg_mask |= 1 << HARD_FRAME_POINTER_REGNUM;
- else if (! TARGET_APCS_FRAME
- && ! frame_pointer_needed
- && df_regs_ever_live_p (HARD_FRAME_POINTER_REGNUM)
- && ! call_used_regs[HARD_FRAME_POINTER_REGNUM])
- save_reg_mask |= 1 << HARD_FRAME_POINTER_REGNUM;
/* If we aren't loading the PIC register,
don't stack it even though it may be live. */
@@ -10775,7 +10765,7 @@
/* If we are creating a stack frame, then we must save the frame pointer,
IP (which will hold the old stack pointer), LR and the PC. */
- if (frame_pointer_needed && TARGET_ARM)
+ if (TARGET_APCS_FRAME && frame_pointer_needed && TARGET_ARM)
save_reg_mask |=
(1 << ARM_HARD_FRAME_POINTER_REGNUM)
| (1 << IP_REGNUM)
@@ -11306,7 +11296,7 @@
if (saved_regs_mask & (1 << reg))
floats_offset += 4;
- if (frame_pointer_needed && TARGET_ARM)
+ if (TARGET_APCS_FRAME && frame_pointer_needed && TARGET_ARM)
{
/* This variable is for the Virtual Frame Pointer, not VFP regs. */
int vfp_offset = offsets->frame;
@@ -11452,33 +11442,61 @@
}
else
{
+ /* This branch is executed for ARM mode (non-apcs frames) and
+ Thumb-2 mode. Frame layout is essentially the same for those
+ cases, except that in ARM mode frame pointer points to the
+ first saved register, while in Thumb-2 mode the frame pointer points
+ to the last saved register.
+
+ It is possible to make frame pointer point to last saved
+ register in both cases, and remove some conditionals below.
+ That means that fp setup in prologue would be just "mov fp, sp"
+ and sp restore in epilogue would be just "mov sp, fp", whereas
+ now we have to use add/sub in those cases. However, the value
+ of that would be marginal, as both mov and add/sub are 32-bit
+ in ARM mode, and it would require extra conditionals
+ in arm_expand_prologue to distingish ARM-apcs-frame case
+ (where frame pointer is required to point at first register)
+ and ARM-non-apcs-frame. Therefore, such change is postponed
+ until real need arise. */
HOST_WIDE_INT amount;
int rfe;
/* Restore stack pointer if necessary. */
- if (frame_pointer_needed)
+ if (TARGET_ARM && frame_pointer_needed)
{
- /* For Thumb-2 restore sp from the frame pointer.
- Operand restrictions mean we have to increment FP, then copy
- to SP. */
- amount = offsets->locals_base - offsets->saved_regs;
- operands[0] = hard_frame_pointer_rtx;
+ operands[0] = stack_pointer_rtx;
+ operands[1] = hard_frame_pointer_rtx;
+
+ operands[2] = GEN_INT (offsets->frame - offsets->saved_regs);
+ output_add_immediate (operands);
}
else
{
- operands[0] = stack_pointer_rtx;
- amount = offsets->outgoing_args - offsets->saved_regs;
+ if (frame_pointer_needed)
+ {
+ /* For Thumb-2 restore sp from the frame pointer.
+ Operand restrictions mean we have to incrememnt FP, then copy
+ to SP. */
+ amount = offsets->locals_base - offsets->saved_regs;
+ operands[0] = hard_frame_pointer_rtx;
+ }
+ else
+ {
+ operands[0] = stack_pointer_rtx;
+ amount = offsets->outgoing_args - offsets->saved_regs;
+ }
+
+ if (amount)
+ {
+ operands[1] = operands[0];
+ operands[2] = GEN_INT (amount);
+ output_add_immediate (operands);
+ }
+ if (frame_pointer_needed)
+ asm_fprintf (f, "\tmov\t%r, %r\n",
+ SP_REGNUM, HARD_FRAME_POINTER_REGNUM);
}
- if (amount)
- {
- operands[1] = operands[0];
- operands[2] = GEN_INT (amount);
- output_add_immediate (operands);
- }
- if (frame_pointer_needed)
- asm_fprintf (f, "\tmov\t%r, %r\n",
- SP_REGNUM, HARD_FRAME_POINTER_REGNUM);
-
if (arm_fpu_arch == FPUTYPE_FPA_EMU2)
{
for (reg = FIRST_FPA_REGNUM; reg <= LAST_FPA_REGNUM; reg++)
@@ -12320,7 +12338,10 @@
emit_insn (gen_movsi (stack_pointer_rtx, r1));
}
- if (frame_pointer_needed && TARGET_ARM)
+ /* For APCS frames, if IP register is clobbered
+ when creating frame, save that register in a special
+ way. */
+ if (TARGET_APCS_FRAME && frame_pointer_needed && TARGET_ARM)
{
if (IS_INTERRUPT (func_type))
{
@@ -12419,13 +12440,13 @@
}
/* If this is an interrupt service routine, and the link register
- is going to be pushed, and we are not creating a stack frame,
- (which would involve an extra push of IP and a pop in the epilogue)
+ is going to be pushed, and we're not generating extra
+ push of IP (needed when frame is needed and frame layout if apcs),
subtracting four from LR now will mean that the function return
can be done with a single instruction. */
if ((func_type == ARM_FT_ISR || func_type == ARM_FT_FIQ)
&& (live_regs_mask & (1 << LR_REGNUM)) != 0
- && ! frame_pointer_needed
+ && !(frame_pointer_needed && TARGET_APCS_FRAME)
&& TARGET_ARM)
{
rtx lr = gen_rtx_REG (SImode, LR_REGNUM);
@@ -12446,6 +12467,7 @@
if (frame_pointer_needed && TARGET_ARM)
{
/* Create the new frame pointer. */
+ if (TARGET_APCS_FRAME)
{
insn = GEN_INT (-(4 + args_to_push + fp_offset));
insn = emit_insn (gen_addsi3 (hard_frame_pointer_rtx, ip_rtx, insn));
@@ -12467,6 +12489,13 @@
emit_insn (gen_prologue_use (ip_rtx));
}
}
+ else
+ {
+ insn = GEN_INT (saved_regs - 4);
+ insn = emit_insn (gen_addsi3 (hard_frame_pointer_rtx,
+ stack_pointer_rtx, insn));
+ RTX_FRAME_RELATED_P (insn) = 1;
+ }
}
offsets = arm_get_frame_offsets ();
Index: gcc/config/pa/pa.c
===================================================================
--- gcc/config/pa/pa.c (revision 133344)
+++ gcc/config/pa/pa.c (working copy)
@@ -7417,14 +7417,13 @@
length += 12;
/* long pc-relative branch sequence. */
- else if ((TARGET_SOM && TARGET_LONG_PIC_SDIFF_CALL)
- || (TARGET_64BIT && !TARGET_GAS)
+ else if (TARGET_LONG_PIC_SDIFF_CALL
|| (TARGET_GAS && !TARGET_SOM
&& (TARGET_LONG_PIC_PCREL_CALL || local_call)))
{
length += 20;
- if (!TARGET_PA_20 && !TARGET_NO_SPACE_REGS)
+ if (!TARGET_PA_20 && !TARGET_NO_SPACE_REGS && flag_pic)
length += 8;
}
@@ -7444,7 +7443,7 @@
if (!sibcall)
length += 8;
- if (!TARGET_NO_SPACE_REGS)
+ if (!TARGET_NO_SPACE_REGS && flag_pic)
length += 8;
}
}
@@ -7528,7 +7527,7 @@
of increasing length and complexity. In most cases,
they don't allow an instruction in the delay slot. */
if (!((TARGET_LONG_ABS_CALL || local_call) && !flag_pic)
- && !(TARGET_SOM && TARGET_LONG_PIC_SDIFF_CALL)
+ && !TARGET_LONG_PIC_SDIFF_CALL
&& !(TARGET_GAS && !TARGET_SOM
&& (TARGET_LONG_PIC_PCREL_CALL || local_call))
&& !TARGET_64BIT)
@@ -7574,13 +7573,12 @@
}
else
{
- if ((TARGET_SOM && TARGET_LONG_PIC_SDIFF_CALL)
- || (TARGET_64BIT && !TARGET_GAS))
+ if (TARGET_LONG_PIC_SDIFF_CALL)
{
/* The HP assembler and linker can handle relocations
- for the difference of two symbols. GAS and the HP
- linker can't do this when one of the symbols is
- external. */
+ for the difference of two symbols. The HP assembler
+ recognizes the sequence as a pc-relative call and
+ the linker provides stubs when needed. */
xoperands[1] = gen_label_rtx ();
output_asm_insn ("{bl|b,l} .+8,%%r1", xoperands);
output_asm_insn ("addil L'%0-%l1,%%r1", xoperands);
@@ -7665,20 +7663,20 @@
}
else
{
- if (!TARGET_NO_SPACE_REGS)
+ if (!TARGET_NO_SPACE_REGS && flag_pic)
output_asm_insn ("ldsid (%%r1),%%r31\n\tmtsp %%r31,%%sr0",
xoperands);
if (sibcall)
{
- if (TARGET_NO_SPACE_REGS)
+ if (TARGET_NO_SPACE_REGS || !flag_pic)
output_asm_insn ("be 0(%%sr4,%%r1)", xoperands);
else
output_asm_insn ("be 0(%%sr0,%%r1)", xoperands);
}
else
{
- if (TARGET_NO_SPACE_REGS)
+ if (TARGET_NO_SPACE_REGS || !flag_pic)
output_asm_insn ("ble 0(%%sr4,%%r1)", xoperands);
else
output_asm_insn ("ble 0(%%sr0,%%r1)", xoperands);
Index: gcc/config/pa/pa.h
===================================================================
--- gcc/config/pa/pa.h (revision 133344)
+++ gcc/config/pa/pa.h (working copy)
@@ -101,17 +101,18 @@
calls. They are used only in non-pic code. */
#define TARGET_LONG_ABS_CALL (TARGET_SOM && !TARGET_GAS)
-/* Define to a C expression evaluating to true to use long pic symbol
- difference calls. This is a call variant similar to the long pic
- pc-relative call. Long pic symbol difference calls are only used with
- the HP SOM linker. Currently, only the HP assembler supports these
- calls. GAS doesn't allow an arbitrary difference of two symbols. */
-#define TARGET_LONG_PIC_SDIFF_CALL (!TARGET_GAS)
+/* Define to a C expression evaluating to true to use long PIC symbol
+ difference calls. Long PIC symbol difference calls are only used with
+ the HP assembler and linker. The HP assembler detects this instruction
+ sequence and treats it as long pc-relative call. Currently, GAS only
+ allows a difference of two symbols in the same subspace, and it doesn't
+ detect the sequence as a pc-relative call. */
+#define TARGET_LONG_PIC_SDIFF_CALL (!TARGET_GAS && TARGET_HPUX)
-/* Define to a C expression evaluating to true to use long pic
- pc-relative calls. Long pic pc-relative calls are only used with
- GAS. Currently, they are usable for calls within a module but
- not for external calls. */
+/* Define to a C expression evaluating to true to use long PIC
+ pc-relative calls. Long PIC pc-relative calls are only used with
+ GAS. Currently, they are usable for calls which bind local to a
+ module but not for external calls. */
#define TARGET_LONG_PIC_PCREL_CALL 0
/* Define to a C expression evaluating to true to use SOM secondary
Index: gcc/langhooks-def.h
===================================================================
--- gcc/langhooks-def.h (revision 133344)
+++ gcc/langhooks-def.h (working copy)
@@ -85,7 +85,6 @@
#define LANG_HOOKS_INIT hook_bool_void_false
#define LANG_HOOKS_FINISH lhd_do_nothing
#define LANG_HOOKS_PARSE_FILE lhd_do_nothing_i
-#define LANG_HOOKS_CLEAR_BINDING_STACK lhd_do_nothing
#define LANG_HOOKS_INIT_OPTIONS hook_uint_uint_constcharptrptr_0
#define LANG_HOOKS_INITIALIZE_DIAGNOSTICS lhd_initialize_diagnostics
#define LANG_HOOKS_HANDLE_OPTION hook_int_size_t_constcharptr_int_0
@@ -250,7 +249,6 @@
LANG_HOOKS_INIT, \
LANG_HOOKS_FINISH, \
LANG_HOOKS_PARSE_FILE, \
- LANG_HOOKS_CLEAR_BINDING_STACK, \
LANG_HOOKS_GET_ALIAS_SET, \
LANG_HOOKS_EXPAND_EXPR, \
LANG_HOOKS_EXPAND_DECL, \
Index: libgfortran/intrinsics/random.c
===================================================================
--- libgfortran/intrinsics/random.c (revision 133344)
+++ libgfortran/intrinsics/random.c (working copy)
@@ -639,6 +639,29 @@
#endif
+
+
+static void
+scramble_seed (unsigned char *dest, unsigned char *src, int size)
+{
+ int i;
+
+ for (i = 0; i < size; i++)
+ dest[(i % 2) * (size / 2) + i / 2] = src[i];
+}
+
+
+static void
+unscramble_seed (unsigned char *dest, unsigned char *src, int size)
+{
+ int i;
+
+ for (i = 0; i < size; i++)
+ dest[i] = src[(i % 2) * (size / 2) + i / 2];
+}
+
+
+
/* random_seed is used to seed the PRNG with either a default
set of seeds or user specified set of seeds. random_seed
must be called with no argument or exactly one argument. */
@@ -647,6 +670,7 @@
random_seed_i4 (GFC_INTEGER_4 *size, gfc_array_i4 *put, gfc_array_i4 *get)
{
int i;
+ unsigned char seed[4*kiss_size];
__gthread_mutex_lock (&random_lock);
@@ -673,9 +697,15 @@
if (((put->dim[0].ubound + 1 - put->dim[0].lbound)) < kiss_size)
runtime_error ("Array size of PUT is too small.");
- /* This code now should do correct strides. */
+ /* We copy the seed given by the user. */
for (i = 0; i < kiss_size; i++)
- kiss_seed[i] = (GFC_UINTEGER_4) put->data[i * put->dim[0].stride];
+ memcpy (seed + i * sizeof(GFC_UINTEGER_4),
+ &(put->data[(kiss_size - 1 - i) * put->dim[0].stride]),
+ sizeof(GFC_UINTEGER_4));
+
+ /* We put it after scrambling the bytes, to paper around users who
+ provide seeds with quality only in the lower or upper part. */
+ scramble_seed ((unsigned char *) kiss_seed, seed, 4*kiss_size);
}
/* Return the seed to GET data. */
@@ -689,9 +719,14 @@
if (((get->dim[0].ubound + 1 - get->dim[0].lbound)) < kiss_size)
runtime_error ("Array size of GET is too small.");
- /* This code now should do correct strides. */
+ /* Unscramble the seed. */
+ unscramble_seed (seed, (unsigned char *) kiss_seed, 4*kiss_size);
+
+ /* Then copy it back to the user variable. */
for (i = 0; i < kiss_size; i++)
- get->data[i * get->dim[0].stride] = (GFC_INTEGER_4) kiss_seed[i];
+ memcpy (&(get->data[(kiss_size - 1 - i) * get->dim[0].stride]),
+ seed + i * sizeof(GFC_UINTEGER_4),
+ sizeof(GFC_UINTEGER_4));
}
__gthread_mutex_unlock (&random_lock);
Index: libgfortran/intrinsics/erfc_scaled_inc.c
===================================================================
--- libgfortran/intrinsics/erfc_scaled_inc.c (revision 133344)
+++ libgfortran/intrinsics/erfc_scaled_inc.c (working copy)
@@ -35,16 +35,28 @@
#define KIND_SUFFIX(x,y) CONCAT(x,y)
#if (KIND == 4)
+
# define EXP(x) expf(x)
# define TRUNC(x) truncf(x)
+
#elif (KIND == 8)
+
# define EXP(x) exp(x)
# define TRUNC(x) trunc(x)
+
#else
-# define EXP(x) expl(x)
-# define TRUNC(x) truncl(x)
+
+# ifdef HAVE_EXPL
+# define EXP(x) expl(x)
+# endif
+# ifdef HAVE_TRUNCL
+# define TRUNC(x) truncl(x)
+# endif
+
#endif
+#if defined(EXP) && defined(TRUNC)
+
extern TYPE KIND_SUFFIX(erfc_scaled_r,KIND) (TYPE);
export_proto(KIND_SUFFIX(erfc_scaled_r,KIND));
@@ -167,6 +179,8 @@
return res;
}
+#endif
+
#undef EXP
#undef TRUNC
Index: libgfortran/ChangeLog
===================================================================
--- libgfortran/ChangeLog (revision 133344)
+++ libgfortran/ChangeLog (working copy)
@@ -1,3 +1,17 @@
+2008-03-12 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
+ PR libfortran/35524
+ * intrinsics/erfc_scaled_inc.c: Only define the long double
+ variant of erfc_scaled if expl is available.
+
+2008-03-11 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
+ PR libfortran/32812
+ * intrinsics/random.c (scramble_seed, unscramble_seed): New
+ functions.
+ (random_seed_i4): Scramble the seed the user gives us before
+ storing it, and unscramble it when we return it back later.
+
2008-03-05 Hans-Peter Nilsson <hp@axis.com>
PR libfortran/35293
Index: libiberty/ChangeLog
===================================================================
--- libiberty/ChangeLog (revision 133344)
+++ libiberty/ChangeLog (working copy)
@@ -1,3 +1,8 @@
+2008-03-11 Nick Clifton <nickc@redhat.com>
+
+ * md5.c (md5_process_bytes): Do not assume that memcpy will
+ provide a return value.
+
2008-02-19 Ben Elliston <bje@au.ibm.com>
PR other/12618
Index: libiberty/md5.c
===================================================================
--- libiberty/md5.c (revision 133344)
+++ libiberty/md5.c (working copy)
@@ -234,7 +234,8 @@
if (UNALIGNED_P (buffer))
while (len > 64)
{
- md5_process_block (memcpy (ctx->buffer, buffer, 64), 64, ctx);
+ memcpy (ctx->buffer, buffer, 64);
+ md5_process_block (ctx->buffer, 64, ctx);
buffer = (const char *) buffer + 64;
len -= 64;
}
Index: contrib/ChangeLog
===================================================================
--- contrib/ChangeLog (revision 133344)
+++ contrib/ChangeLog (working copy)
@@ -1,3 +1,17 @@
+2008-03-10 Janis Johnson <janis187@us.ibm.com>
+
+ * patch_tester.sh (initialization): Initialize svnpatch and stop.
+ (usage): Add -svnpath and -stop.
+ (makedir): New.
+ (argument handling): Process -stop and -svnpath.
+ (setup code): Use makedir, error out if initial svn checkout fails.
+ (update): Use svnpath. Invoke contrib/gcc_update.
+ (apply_patch): Require that patch was created at top level. Use eval
+ with option variables. Don't use bootstrap target for make. Verify
+ that some tests were run.
+ (bootntest_patched): Use snvpath.
+ (main loop): For -stop, exit when there are no more patches to test.
+
2008-03-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* check_warning_flags.sh: Instead of invoke.texi, take the path
Index: contrib/patch_tester.sh
===================================================================
--- contrib/patch_tester.sh (revision 133344)
+++ contrib/patch_tester.sh (working copy)
@@ -29,6 +29,7 @@
args=$@
+svnpath=svn://gcc.gnu.org/svn/gcc
dashj=
default_standby=1
standby=$default_standby
@@ -36,10 +37,12 @@
watermark=$default_watermark
savecompilers=false
nogpg=false
+stop=false
usage() {
cat <<EOF
patch_tester.sh [-j<N>] [-standby N] [-watermark N] [-savecompilers] [-nogpg]
+ [-svnpath URL] [-stop]
<source_dir> [patches_dir [state_dir [build_dir]]]
J is the flag passed to make. Default is empty string.
@@ -55,6 +58,11 @@
NOGPG can be used to avoid checking the GPG signature of patches.
+ URL is the location of the GCC SVN repository. The default is
+ ${svnpath}.
+
+ STOP exits when PATCHES_DIR is empty.
+
SOURCE_DIR is the directory containing GCC's toplevel configure.
PATCHES_DIR is the directory containing the patches to be tested.
@@ -70,6 +78,15 @@
exit 1
}
+makedir () {
+ DIRNAME=$1
+ mkdir -p $DIRNAME
+ if [ $? -ne 0 ]; then
+ echo "ERROR: could not make directory $DIRNAME"
+ exit 1
+ fi
+}
+
while [ $# -ne 0 ]; do
case $1 in
-j*)
@@ -89,6 +106,12 @@
-nogpg)
nogpg=true; shift
;;
+ -stop)
+ stop=true; shift
+ ;;
+ -svnpath)
+ svnpath=$2; shift; shift
+ ;;
-*)
echo "Invalid option: $1"
usage
@@ -122,13 +145,17 @@
BUILD=$4
fi
-[ -d $PATCHES ] || mkdir -p $PATCHES
-[ -d $STATE ] || mkdir -p $STATE
-[ -d $STATE/patched ] || mkdir -p $STATE/patched
-[ -d $SOURCE ] || mkdir -p $SOURCE
+[ -d $PATCHES ] || makedir $PATCHES
+[ -d $STATE ] || makedir $STATE
+[ -d $STATE/patched ] || makedir $STATE/patched
+[ -d $SOURCE ] || makedir $SOURCE
[ -f $SOURCE/config.guess ] || {
cd $SOURCE
- svn -q co svn://gcc.gnu.org/svn/gcc/trunk .
+ svn -q co $svnpath/trunk .
+ if [ $? -ne 0 ]; then
+ echo "ERROR: initial svn checkout failed"
+ exit 1
+ fi
}
# This can contain required local settings:
@@ -205,15 +232,15 @@
cd $SOURCE
case $svn_branch in
trunk)
- if ! svn switch -r $svn_revision svn://gcc.gnu.org/svn/gcc/trunk &> $TESTING/svn ; then
+ if ! svn switch -r $svn_revision $svnpath/trunk &> $TESTING/svn ; then
report "failed to update svn sources with"
- report "svn switch -r $svn_revision svn://gcc.gnu.org/svn/gcc/trunk"
+ report "svn switch -r $svn_revision $svnpath/trunk"
freport $TESTING/svn
return 1
fi
;;
- svn://gcc.gnu.org/svn/gcc/*)
+ ${svnpath}*)
if ! svn switch -r $svn_revision $svn_branch &> $TESTING/svn ; then
report "failed to update svn sources with"
report "svn switch -r $svn_revision $svn_branch"
@@ -223,14 +250,15 @@
;;
*)
- if ! svn switch -r $svn_revision svn://gcc.gnu.org/svn/gcc/branches/$svn_branch &> $TESTING/svn ; then
+ if ! svn switch -r $svn_revision $svnpath/branches/$svn_branch &> $TESTING/svn ; then
report "failed to update svn sources with"
- report "svn switch -r $svn_revision svn://gcc.gnu.org/svn/gcc/branches/$svn_branch"
+ report "svn switch -r $svn_revision $svnpath/branches/$svn_branch"
freport $TESTING/svn
return 1
fi
;;
esac
+ contrib/gcc_update --touch
current_version=`svn info $SOURCE | grep "^Revision:" | sed -e "s/^Revision://g" -e "s/ //g"`
if [[ $VERSION < $current_version ]]; then
@@ -251,22 +279,12 @@
fi
fi
- # Detect if the patch was created in toplev GCC.
- grep "^Index: " $PATCH | grep "gcc/"
- if [ $? = 0 ]; then
- cd $SOURCE
- if ! patch -p0 < $PATCH &> $TESTING/patching ; then
- report "your patch failed to apply:"
- freport $TESTING/patching
- return 1
- fi
- else
- cd $SOURCE/gcc
- if ! patch -p0 < $PATCH &> $TESTING/patching ; then
- report "your patch failed to apply:"
- freport $TESTING/patching
- return 1
- fi
+ cd $SOURCE
+ if ! patch -p0 < $PATCH &> $TESTING/patching ; then
+ report "your patch failed to apply:"
+ report "(check that the patch was created at the top level)"
+ freport $TESTING/patching
+ return 1
fi
# Just assume indexes for now -- not really great, but svn always
@@ -296,16 +314,16 @@
CONFIG_OPTIONS=`grep "^configure:" $PATCH | sed -e "s/^configure://g"`
CONFIG_OPTIONS="$default_config $CONFIG_OPTIONS"
- if ! $SOURCE/configure $CONFIG_OPTIONS &> $1/configure ; then
- report "configure failed with:"
+ if ! eval $SOURCE/configure $CONFIG_OPTIONS &> $1/configure ; then
+ report "configure with `basename $1` version failed with:"
freport $1/configure
return 1
fi
MAKE_ARGS=`grep "^make:" $PATCH | sed -e "s/^make://g"`
MAKE_ARGS="$default_make $MAKE_ARGS"
- if ! make $dashj $MAKE_ARGS bootstrap &> $1/bootstrap ; then
- report "bootstrap failed with last lines:"
+ if ! eval make $dashj $MAKE_ARGS &> $1/bootstrap ; then
+ report "bootstrap with `basename $1` version failed with last lines:"
tail -30 $1/bootstrap > $1/last_bootstrap
freport $1/last_bootstrap
report "grep --context=20 Error bootstrap:"
@@ -316,8 +334,14 @@
CHECK_OPTIONS=`grep "^check:" $PATCH | sed -e "s/^check://g"`
CHECK_OPTIONS="$default_check $CHECK_OPTIONS"
- make $dashj $CHECK_OPTIONS -k check &> $1/check
+ eval make $dashj $CHECK_OPTIONS -k check &> $1/check
+ SUITESRUN="`grep 'Summary ===' $1/check | cut -d' ' -f 2 | sort`"
+ if [ x$SUITESRUN = x ]; then
+ report "check with `basename $1` version failed, no testsuites were run"
+ return 1
+ fi
+
for LOG in $TESTLOGS ; do
if [ -f $BUILD/$LOG ]; then
mv $BUILD/$LOG $1
@@ -338,7 +362,7 @@
# Build the pristine tree with exactly the same options as the patch under test.
bootntest_pristine () {
cleanup
- current_branch=`svn info $SOURCE | grep "^URL:" | sed -e "s/URL: //g" -e "s/svn:\/\/gcc.gnu.org\/svn\/gcc\///g"`
+ current_branch=`svn info $SOURCE | grep "^URL:" | sed -e "s/URL: //g" -e "s,${svnpath},,g"`
current_version=`svn info $SOURCE | grep "^Revision:" | sed -e "s/^Revision://g" -e "s/ //g"`
PRISTINE=$STATE/$current_branch/$current_version
@@ -448,11 +472,22 @@
fi
fi
+firstpatch=true
while true; do
PATCH=`ls -rt -1 $PATCHES | head -1`
if [ x$PATCH = x ]; then
+ if [ $stop = true ]; then
+ if [ $firstpatch = true ]; then
+ echo "No patches ready to test, quitting."
+ exit 1
+ else
+ echo "No more patches to test."
+ exit 0
+ fi
+ fi
sleep ${standby}m
else
+ firstpatch=false
sysload=`uptime | cut -d, -f 5`
if [[ $sysload > $watermark ]]; then
# Wait a bit when system load is too high.
Index: libjava/classpath/native/jni/classpath/jcl.c
===================================================================
--- libjava/classpath/native/jni/classpath/jcl.c (revision 133344)
+++ libjava/classpath/native/jni/classpath/jcl.c (working copy)
@@ -1,5 +1,5 @@
/* jcl.c
- Copyright (C) 1998, 2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2005, 2006, 2008 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -152,9 +152,11 @@
JNIEXPORT void *JNICALL
JCL_realloc (JNIEnv * env, void *ptr, size_t size)
{
+ void *orig_ptr = ptr;
ptr = realloc (ptr, size);
if (ptr == 0)
{
+ free (orig_ptr);
JCL_ThrowException (env, "java/lang/OutOfMemoryError",
"malloc() failed.");
return NULL;
Index: libjava/classpath/ChangeLog
===================================================================
--- libjava/classpath/ChangeLog (revision 133344)
+++ libjava/classpath/ChangeLog (working copy)
@@ -1,3 +1,9 @@
+2008-03-10 Jim Meyering <meyering@redhat.com>
+
+ Don't leak upon failed realloc.
+ * native/jni/classpath/jcl.c (JCL_realloc): Upon failed realloc,
+ free the original buffer before throwing the exception.
+
2008-03-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* doc/cp-hacking.texinfo: Fix spacing after periods.
Index: libjava/ChangeLog
===================================================================
--- libjava/ChangeLog (revision 133344)
+++ libjava/ChangeLog (working copy)
@@ -1,3 +1,9 @@
+2008-03-10 Jim Meyering <meyering@redhat.com>
+
+ Don't leak upon failed realloc.
+ * gnu/classpath/natSystemProperties.cc
+ (SystemProperties::insertSystemProperties):
+
2008-03-06 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* HACKING: Fix grep patterns.
Index: libjava/gnu/classpath/natSystemProperties.cc
===================================================================
--- libjava/gnu/classpath/natSystemProperties.cc (revision 133344)
+++ libjava/gnu/classpath/natSystemProperties.cc (working copy)
@@ -270,7 +270,10 @@
if (errno != ERANGE)
break;
buflen = 2 * buflen;
+ char *orig_buf = buffer;
buffer = (char *) realloc (buffer, buflen);
+ if (buffer == NULL)
+ free (orig_buf);
}
if (buffer != NULL)
free (buffer);