Richard Biener [Wed, 23 May 2012 12:25:41 +0000 (12:25 +0000)]
tree-dfa.c (add_referenced_var_1): Do not add global vars.
2012-05-23 Richard Guenther <rguenther@suse.de>
* tree-dfa.c (add_referenced_var_1): Do not add global vars.
* tree-ssa-live.c (mark_all_vars_used_1): Handle global vars
via the global_unused_vars bitmap.
(remove_unused_locals): Handle global vars in local-decls via
a global_unused_vars bitmap instead of the used flag in the
var annotation. Simplify global variable handling and removal.
Tobias Burnus [Wed, 23 May 2012 08:34:06 +0000 (10:34 +0200)]
re PR libfortran/53444 (Accommodate non-compliant strerror_r() on VxWorks.)
2012-05-23 Tobias Burnus <burnus@net-b.de>
PR libfortran/53444
* acinclude.m4 (LIBGFOR_CHECK_STRERROR_R): Add configure checks
* for
two- and three-argument versions of strerror_r.
* configure.ac (LIBGFOR_CHECK_STRERROR_R): Use it.
* runtime/error.c (gf_strerror): Handle two-argument version
of strerror_r.
* config.h.in: Regenerate.
* configure: Regenerate.
Tobias Burnus [Tue, 22 May 2012 10:10:47 +0000 (12:10 +0200)]
re PR fortran/53389 (-frealloc-lhs: memory leak when assigning array function result to allocatable array, where one of its supplied arguments is itself an array function result)
2012-05-22 Tobias Burnus <burnus@net-b.de>
PR fortran/53389
* trans-array.c (gfc_add_loop_ss_code): Don't evaluate
* expression, if
ss->is_alloc_lhs is set.
Dodji Seketeli [Tue, 22 May 2012 03:50:26 +0000 (03:50 +0000)]
PR c++/53322 - -Wunused-local-typedefs is not enabled by Wall or Wunused
As the audit trail of this shows, -Wunused-local-typedefs is not
turned on by -Wunused after all. Sigh.
Now that we have the EnabledBy construct for the *.opt files, it's
more precise and concise to use that to make -Wunused-local-typedefs
be triggered by -Wunused.
I have changed the gcc+.dg/warn/Wunused-local-typedefs.C test case to
make it use -Wunused instead of -Wunused-local-typedefs. I had to
adjust it to avoid the warnings due to the other -W* options triggered
by -Wunused there.
While testing the compiler, it turned out that some local typedefs
were not being used when the experimental "Concepts" support is turned
off, in the libstdc++ test suite. I also had to remove some obvious
useless local typedef usage in the fortran front-end. Fixed thus.
Bootstrapped and tested on x86_64-unknown-linux-gnu against trunk.
gcc/c-family/
PR c++/53322
* c.opt (Wunused-local-typedefs): Use EnabledBy(Wunused).
libstdc++-v3/
PR c++/53322
* include/bits/stl_algobase.h (lower_bound)
(lexicographical_compare): Do not declare unused local typedefs
here when Concepts are turned off.
gcc/fortran/
PR c++/53322
* f95-lang.c (gfc_init_builtin_functions): Remove the unused
typedef builtin_type.
gcc/testsuite/
PR c++/53322
* g++.dg/warn/Wunused-local-typedefs.C: Adjust to use -Wunused
instead of -Wunused-local-typedefs.
Alan Modra [Mon, 21 May 2012 22:55:09 +0000 (08:25 +0930)]
aix.h (FP_SAVE_INLINE, [...]): Delete.
* aix.h (FP_SAVE_INLINE, GP_SAVE_INLINE): Delete.
* darwin.h (FP_SAVE_INLINE, GP_SAVE_INLINE): Delete.
* sysv4.h (FP_SAVE_INLINE, GP_SAVE_INLINE, V_SAVE_INLINE): Delete.
* config/rs6000/rs6000.c (V_SAVE_INLINE): Delete.
(rs6000_savres_strategy): Reimplement GP/FP/V_SAVE_INLINE logic.
For ELF targets, use out-of-line restores for -Os and any number
of regs if the restore exits, and out-of-line gp save for two or
more regs. Use save_reg_p to test for holes in reg restore set.
Replace "#if" with "if".
Alan Modra [Mon, 21 May 2012 22:51:38 +0000 (08:21 +0930)]
rs6000.c (save_reg_p): New function.
* config/rs6000/rs6000.c (save_reg_p): New function.
(first_reg_to_save, first_fp_reg_to_save): Use it here.
(first_altivec_reg_to_save, restore_saved_cr): Likewise.
(emit_frame_save): Use gen_frame_store.
(gen_frame_mem_offset): Correct SPE condition requiring reg+reg.
(rs6000_emit_prologue): Use save_reg_p. Use gen_frame_store for
vrsave and toc.
(rs6000_emit_epilogue): Use save_reg_p. Use gen_frame_load for
vrsave, toc, gp and fp restores.
* config/rs6000/rs6000.c: Delete unnecessary forward declarations.
Move those with ATTRIBUTE_UNUSED to immediately before definitions.
Move function pointer variables after forward declarations.
(rs6000_builtin_support_vector_misalignment): Make static.
(rs6000_legitimate_address_p, rs6000_gimplify_va_arg): Likewise.
(rs6000_function_value, rs6000_can_eliminate): Likewise.
Bernd Schmidt [Mon, 21 May 2012 21:37:01 +0000 (21:37 +0000)]
re PR rtl-optimization/53373 (ICE on valid code with -mavx)
PR rtl-optimization/53373
* caller-save.c (save_call_clobbered_regs): Look into a possible
PARALLEL manually rather than using single_set on a call insn.
Andreas Schwab [Mon, 21 May 2012 18:43:27 +0000 (18:43 +0000)]
m68k.md (*clzsi2_cf): Renamed from clzsi2.
* config/m68k/m68k.md (*clzsi2_cf): Renamed from clzsi2. Call
CC_STATUS_INIT.
(clzsi2): New expander.
(*clzsi2_68k): New insn.
* config/m68k/m68k.h: Update comment about
CLZ_DEFINED_VALUE_AT_ZERO.
Richard Guenther [Mon, 21 May 2012 14:53:21 +0000 (14:53 +0000)]
tree-dfa.c (add_referenced_var): Do not walk DECL_INITIAL for more referenced vars.
2012-05-21 Richard Guenther <rguenther@suse.de>
* tree-dfa.c (add_referenced_var): Do not walk DECL_INITIAL for
more referenced vars.
* tree-ssa-live.c (mark_all_vars_used_1): Only set the used
flag on variables that have a var-annotation.
Joseph Myers [Mon, 21 May 2012 14:42:26 +0000 (15:42 +0100)]
re PR c/53418 (ICE at gimplify.c:7773)
PR c/53148
* c-typeck.c (build_conditional_expr): Remove C_MAYBE_CONST_EXPR
from folded operands before wrapping another around the
conditional expression.
testsuite:
* gcc.c-torture/compile/pr53418-1.c,
gcc.c-torture/compile/pr53418-2.c: New tests.
Jakub Jelinek [Mon, 21 May 2012 14:29:11 +0000 (16:29 +0200)]
re PR tree-optimization/53366 (wrong code generation by tree vectorizer using AVX)
PR tree-optimization/53366
* tree-vect-slp.c (vect_supported_load_permutation_p): Don't shortcut
tests if complex_numbers == 2, but there are non-complex number loads
too.
* gcc.dg/torture/pr53366-1.c: New test.
* gcc.dg/torture/pr53366-2.c: New test.
* gcc.target/i386/pr53366-1.c: New test.
* gcc.target/i386/pr53366-2.c: New test.
Jakub Jelinek [Mon, 21 May 2012 14:25:03 +0000 (16:25 +0200)]
re PR tree-optimization/53410 (ICE in build_int_cst_wide, at tree.c:1219)
PR tree-optimization/53410
* fold-const.c (fold_binary_loc): Use build_zero_cst (type)
instead of build_int_cst (type, 0) where vector types might be
involved. Instead of build_int_cst (type, 1) convert the original
integer_onep argument to the desired type.
* gcc.c-torture/compile/pr53410-1.c: New test.
* gcc.c-torture/compile/pr53410-2.c: New test.
Michael Matz [Mon, 21 May 2012 13:24:31 +0000 (13:24 +0000)]
genattrtab.c (attr_rtx_cost): Move earlier, start with cost being 1.
* genattrtab.c (attr_rtx_cost): Move earlier, start with cost being 1.
(simplify_test_exp): Handle one more case of distributive law,
decrease cost threshold.
(tests_attr_p, get_attr_order): New functions.
(optimize_attrs): Use topological order, inline only cheap values.
(write_attr_set): Reset our_known_true after some time.
Richard Guenther [Mon, 21 May 2012 12:45:59 +0000 (12:45 +0000)]
re PR middle-end/53408 (ICE in get_initial_def_for_induction, at tree-vect-loop.c:3222)
2012-05-21 Richard Guenther <rguenther@suse.de>
PR tree-optimization/53408
* tree-vect-loop.c (vectorizable_induction): Properly check
the restriction that we cannot handle induction results from
the inner loop outside of the outer loop.
Alan Modra [Sun, 20 May 2012 23:31:35 +0000 (09:01 +0930)]
predicates.md (input_operand): Don't match constant pool addresses.
* config/rs6000/predicates.md (input_operand): Don't match
constant pool addresses. Remove label_ref, high and plus from
match_code list. Remove redundant CONSTANT_P test.
(splat_input_operand): Similarly update match_code list.
(small_toc_ref): New predicate.
* config/rs6000/rs6000-protos.h (toc_relative_expr_p): Update prototype.
* config/rs6000/rs6000.c (tocrel_base, tocrel_offset): Make const.
(legitimate_constant_pool_address_p): Move TARGET_TOC test and
register checks to..
(toc_relative_expr_p): ..here. Add "strict" param. Match new rtl
generated by create_TOC_reference.
(rs6000_legitimize_address): Update cerate_TOC_reference call.
(rs6000_delegitimize_address): Handle new rtl for toc refs.
(rs6000_cannot_force_const_mem, rs6000_find_base_term): Likewise.
(use_toc_relative_ref): New function, split out from..
(rs6000_emit_move): ..here. Remove redundant tests. Update
create_TOC_reference calls.
(rs6000_legitimize_reload_address): Formatting. Handle splitting
of medium/large model toc addresses. Use use_toc_relative_ref.
(print_operand): Formatting, style. Adjust for toc changes.
(print_operand_address): Likewise.
(rs6000_output_addr_const_extra): Likewise.
(create_TOC_reference): Put TOC_REGISTER in UNSPEC_TOCREL rather
than a PLUS. Use this formulation for both high and low part
of -mcmodel=medium/large toc reference too. Before reload,
always use the small model formulation.
* config/rs6000/rs6000.md (tls_gd, tls_gd_high): Similarly avoid
a PLUS in high part of addresses here.
(tls_ld, tls_ld_high, tls_got_dtprel, tls_got_dtprel_high): Likewise.
(tls_got_tprel, tls_got_tprel_high, largetoc_high): Likewise.
(largetoc_high, largetoc_low): Move earlier. Cope when no
base reg available.
(largetoc_high_plus): New insn.
(movsi_internal1, movsi_internal1_single, movsf_softfloat,
movdi_mfpgpr, movdi_internal64): Don't handle 'R' constraint here..
(tocref): ..instead do so here, new insn and split.
Jan Hubicka [Sat, 19 May 2012 09:49:47 +0000 (11:49 +0200)]
cgraphbuild.c (record_reference): Update.
* cgraphbuild.c (record_reference): Update.
* lto-cgraph.c (lto_output_varpool_node): External vars
are not in other partition even if they are not output
in current partition.
* gimple-fold.c (can_refer_decl_in_current_unit_p): Take FROM_DECL
argument; fix.
(canonicalize_constructor_val): Take FROM_DECL argument.
(fold_ctor_reference, fold_string_cst_ctor_reference,
fold_array_ctor_reference, fold_nonarray_ctor_reference,
fold_ctor_reference): Likewise.
(fold_const_aggregate_ref_1, gimple_get_virt_method_for_binfo): Update.
* gimple.h (gimple_fold_builtin): Likewise.
Eric Botcazou [Sat, 19 May 2012 09:32:50 +0000 (09:32 +0000)]
decl.c (Has_Thiscall_Convention): New macro.
* gcc-interface/decl.c (Has_Thiscall_Convention): New macro.
(gnat_to_gnu_entity) <E_Subprogram_Type>: Test it to set the thiscall
calling convention
(get_minimal_subprog_decl): Likewise.
(gnat_first_param_is_class): New predicate.
Eric Botcazou [Fri, 18 May 2012 20:33:49 +0000 (20:33 +0000)]
decl.c (gnat_to_gnu_entity): For an object at global level with unconstrained nominal subtype and a...
* gcc-interface/decl.c (gnat_to_gnu_entity) <object>: For an object at
global level with unconstrained nominal subtype and a non-fixed size,
make a variable for the size.
Richard Guenther [Fri, 18 May 2012 13:10:01 +0000 (13:10 +0000)]
re PR target/53346 (Bad if conversion in cptrf2 of rnflow.f90)
2012-05-18 Richard Guenther <rguenther@suse.de>
PR tree-optimization/53346
* tree-loop-distribution.c (ldist_gen): Make sure to apply
builtin transform even when only a single partition with
all reads/writes exists.
Bill Schmidt [Fri, 18 May 2012 12:02:54 +0000 (12:02 +0000)]
tree-ssa-reassoc.c (bip_map): Remove decl.
2012-05-18 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
* tree-ssa-reassoc.c (bip_map): Remove decl.
(completely_remove_stmt): Remove function.
(remove_def_if_absorbed_call): Remove function.
(remove_visited_stmt_chain): Remove __builtin_powi handling.
(possibly_move_powi): Remove function.
(rewrite_expr_tree): Remove calls to possibly_move_powi.
(rewrite_expr_tree_parallel): Likewise.
(attempt_builtin_powi): Build multiplies explicitly rather than
relying on the ops vector and rank system.
(transform_stmt_to_copy): New function.
(transform_stmt_to_multiply): Likewise.
(reassociate_bb): Handle leftover operations after __builtin_powi
optimization; build a final multiply if necessary.
Richard Guenther [Fri, 18 May 2012 10:19:22 +0000 (10:19 +0000)]
tree-flow.h (mark_symbols_for_renaming): Remove.
2012-05-18 Richard Guenther <rguenther@suse.de>
* tree-flow.h (mark_symbols_for_renaming): Remove.
* tree-dfa.c (mark_symbols_for_renaming): Likewise.
* tree-inline.c (copy_edges_for_bb): Do not mark symbols for
renaming.
(copy_debug_stmt): Likewise.
(expand_call_inline): Likewise.
(declare_return_variable): Mark the return variable for renaming
if necessary.
Paolo Carlini [Thu, 17 May 2012 18:54:37 +0000 (18:54 +0000)]
re PR c++/39681 (Compile error is not descriptive)
/cp
2012-05-17 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/39681
* parser.c (cp_parser_new_type_id): Early return error_mark_node
if the cp_parser_type_specifier_seq call has type_specifier_seq.type
error_mark_node; tidy.
(cp_parser_new_expression): Always initialize nelts to NULL_TREE to
avoid uninitialized warnings.
(cp_parser_init_declarator, cp_parser_late_parse_one_default_arg):
Call cp_parser_skip_to_end_of_statement if cp_parser_initializer
returns error_mark_node.
/testsuite
2012-05-17 Paolo Carlini <paolo.carlini@oracle.com>
Steven Bosscher [Thu, 17 May 2012 17:54:52 +0000 (17:54 +0000)]
re PR rtl-optimization/53125 (Very slow compilation on SPARC)
PR rtl-optimization/53125
* regstat.c (regstat_bb_compute_ri): Take new local_live_last_luid
argument. Simplify calculation of REG_LIVE_LENGTH for regnos that
die in the basic block. Correctly top off REG_FREQ and
REG_FREQ_CALLS_CROSSED.
Remove do_not_gen.
(regstat_compute_ri): Allocate and free local_live_last_luid.
Remove do_not_gen.
(regstat_bb_compute_calls_crossed): Correctly top off
REG_FREQ_CALLS_CROSSED.
Paolo Carlini [Thu, 17 May 2012 15:55:51 +0000 (15:55 +0000)]
re PR c++/53371 (rvalue reference type as exception-declaration)
/cp
2012-05-17 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/53371
* except.c (is_admissible_throw_operand): Rename to
is_admissible_throw_operand_or_catch_parameter and handle
catch parameter too.
(expand_start_catch_block): Use it.
(build_throw): Adjust.
/testsuite
2012-05-17 Paolo Carlini <paolo.carlini@oracle.com>
c.opt (--pedantic-errors,-pedantic-errors): Do not handle here.
2012-05-17 Manuel López-Ibáñez <manu@gcc.gnu.org>
c-family/
* c.opt (--pedantic-errors,-pedantic-errors): Do not handle here.
* c-opts.c (c_common_handle_option): Do not handle explicitly
Wreturn-type, Wwrite-strings, warn_ecpp, and -pedantic-errors.
gcc/
* opts.c (common_handle_option): -pedantic-errors enables -Wpedantic.
(enable_warning_as_error): Do not special case Wuninitialized.
* optc-gen.awk: Add sanity checks.
Jan Hubicka [Thu, 17 May 2012 09:22:02 +0000 (11:22 +0200)]
ipa-reference.c (is_proper_for_analysis): Do not check flags that might change as result of global optimization.
* ipa-reference.c (is_proper_for_analysis): Do not check flags
that might change as result of global optimization.
(analyze_function): Do not check analyzed and externally_visible
flags; be happy about address dereferences.
(propagate): Prune all_module_statics so it really contains just
statics; prune all the local summaries.
(ipa_reference_write_optimization_summary): Simplify.
David S. Miller [Wed, 16 May 2012 20:11:46 +0000 (20:11 +0000)]
Fix var tracking ICE due to reorg.
If during reorg we delete a code label, and as a result we decide to
delete all the code following that label, we hit this condition in
jump.c:delete_related_insns():
if (was_code_label && prev && BARRIER_P (prev))
which passes and then we proceed to delete insns until we hit a
non-deleted code label.
During this traversal, we can end up deleting a CALL, but in doing so
we will leave the var tracking note for the call arguments around.
Later in dwarf2_var_location() we will ICE, because we can't find the
CALL when we search backwards for it.
The note searching scheme in the fix below is cribbed from code in
try_split() which has to handle a similar problem.
gcc/
* jump.c (delete_related_insns): If we remove a CALL, make sure
we delete it's NOTE_INSN_CALL_ARG_LOCATION note too.