* config/rs6000/e5500.md: New file.
* config/rs6000/e6500.md: New file.
* config/rs6000/rs6000.c (processor_costs): Add new costs for
e5500 and e6500.
(rs6000_option_override_internal): Altivec and Spe options not
allowed with e5500. Spe options not allowed with e6500. Increase
move inline limit for e5500 and e6500. Disable string instructions
for e5500 and e6500. Enable branch targets alignment for e5500 and
e6500. Initialize rs6000_cost for e5500 and e6500.
(rs6000_adjust_cost): Add extra scheduling cycles between compare
and brnach for e5500 and e6500.
(rs6000_issue_rate): Set issue rate for e5500 and e6500.
* config/rs6000/rs6000-cpus.def: Add cpu definitions for e5500 and
e6500.
* config/rs6000/rs6000.h (ASM_CPU_SPEC): Add e5500 and e6500.
* config/rs6000/rs6000.md (define_attr "cpu"): Add ppce5500 and
ppce6500.
Include e5500.md and e6500.md.
* config/rs6000/rs6000-opt.h (processor_type): Add
PROCESSOR_PPCE5500 and PROCESSOR_PPCE6500.
* config.gcc (cpu_is_64bit): Add new cores e5500, e6500.
(powerpc*-*-*): Add new cores e5500, e6500.
* doc/invoke.texi: (item -mcpu): Add e5500 and e6500 to list of cpus.
line-map.c (linemap_enter_macro): Don't zero max_column_hint in every macro.
* line-map.c (linemap_enter_macro): Don't zero max_column_hint in
every macro. This improves performance by reducing the number of
reallocations when track-macro-expansion is on.
re PR middle-end/30442 (Expanded array initialization can use memset builtin function)
2012-06-05 Richard Guenther <rguenther@suse.de>
PR tree-optimization/30442
* tree-vect-data-refs.c (vect_analyze_data_refs): For basic-block
vectorization stop analysis at the first stmt we cannot compute
a data-reference for instead of giving up completely.
re PR tree-optimization/53081 (memcpy/memset loop recognition)
2012-06-05 Richard Guenther <rguenther@suse.de>
PR tree-optimization/53081
* tree-loop-distribution.c (generate_memset_builtin): Handle all
kinds of byte-sized stores.
(classify_partition): Likewise.
(tree_loop_distribution): Adjust seed statements used for
!flag_tree_loop_distribution.
* gcc.dg/tree-ssa/ldist-19.c: New testcase.
* gcc.c-torture/execute/builtins/builtins.exp: Always pass
-fno-tree-loop-distribute-patterns.
Alan Modra [Tue, 5 Jun 2012 01:59:14 +0000 (11:29 +0930)]
rs6000.c (ptr_regno_for_savres): Comment.
gcc/
* config/rs6000/rs6000.c (ptr_regno_for_savres): Comment.
(rs6000_emit_prologue): Ensure register used for inline saves
of vector regs is not the static chain register. Revise comment.
gcc/testsuite/
* gcc.target/powerpc/savres.c: Add -mdynamic-no-pic for darwin.
Check static chain in nested funcs.
Diego Novillo [Tue, 5 Jun 2012 00:28:56 +0000 (20:28 -0400)]
Extend validate_failures.py to run outside the build directory.
This patch adds three new arguments to validate_failures.py so
it can be used outside the build directory:
--ignore_missing_failures
When a failure is expected in the manifest but it is not found in
the actual results, the script produces a note alerting to this
fact. This means that the expected failure has been fixed, or it
did not run, or it may simply be flaky.
With this option, one can ask the script not to show the missing
failures.
--manifest
Name of the manifest file to use. By default, the script will
look for the manifest file in the source directory associated with
this build. With this option, one can point to any arbitrary
manifest file. I renamed the old --manifest flag to
--produce_manifest.
--results
Space-separated list of .sum files with the testing results to
check. The only content needed from these files are the lines
starting with FAIL, XPASS or UNRESOLVED.
Dodji Seketeli [Mon, 4 Jun 2012 19:19:58 +0000 (19:19 +0000)]
PR preprocessor/53463 - Fix system header detection for built-in macro tokens
The location for a built-in macro token is BUILTIN_LOCATION. When we
see that location value, we cannot know if that token was used in a
system header or not. And that can trigger some unwanted warnings on
e.g, the use of __LONG_LONG_MAX__ built-in macro in system headers
when we compile with -pedantic, like in the test case accompanying
this patch.
In that case, I think we ought to step-up to see where the built-in
macro has been expanded, until we see a location that is not for a
built-in macro. Then we can check if the resulting location is in a
system header or not.
Now that we step up to the location of first non-built-in-macro token,
it appeared that for
testsuite/c-c++-common/dfp/convert-int-saturate.c, G++ then fails to
emit the warning in:
volatile unsigned int usi;
int
main ()
{
usi = DEC32_MAX; /* { dg-warning "overflow in implicit constant conversion" } */
...
}
Because DEC32_MAX is defined in the system header float.h as a
built-in macro:
#define DEC32_MAX __DEC32_MAX__
And during the parsing of the assignment expression that should have
led to the warning above, input_location is set to the location for
the DEC32_MAX, which is actually the location for the built-in
__DECL32_MAX_EXP.
A possible fix is to use the location of the "=" operator as the
default location for assignment expressions. This is what the patch
does.
I had to adjust a couple of tests to arrange for this.
Bootstrapped and tested on x86_64-unknown-linux-gnu against trunk.
libcpp/
PR preprocessor/53463
* line-map.c (linemap_location_in_system_header_p): For built-in
macro tokens, check the first expansion point location for that is
not for a token coming from a built-in macro.
gcc/cp/
PR preprocessor/53463
* parser.c (cp_parser_assignment_expression): Use the location
for the LHS as the default location for the expression.
ira-int.h (struct target_ira_int): Add member x_ira_uniform_class_p.
2012-06-04 Vladimir Makarov <vmakarov@redhat.com>
* ira-int.h (struct target_ira_int): Add member
x_ira_uniform_class_p.
(ira_uniform_class_p): New macro.
* ira.c (setup_uniform_class_p): New function.
(setup_allocno_and_important_classes): Call the function.
(print_unform_and_important_classes): New function.
(print_classes): Rename to print_translated_classes.
(ira_debug_allocno_classes): Add call of
print_unform_and_important_classes.
* ira-costs.c (setup_regno_cost_classes_by_aclass): Use uniform
classes instead of pressure classes.
* gcc/c-family/c-pretty-print.h (pp_c_flag_gnu_v3): New enumerator.
* gcc/c-family/c-pretty-print.c (pp_c_specifier_qualifier_list): Check
it at both the start and end of the function.
* gcc/cp/error.c (dump_decl): Check pp_c_flag_gnu_v3.
(decl_as_dwarf_string, lang_decl_dwarf_name): New functions.
(lang_decl_name): Handle namespace decls.
* gcc/cp/cp-tree.h: Declare decl_as_dwarf_string, lang_decl_dwarf_name.
* gcc/cp/cp-lang.c: Call them.
* tree-data-ref.c (stores_from_loop): Remove.
(stmt_with_adjacent_zero_store_dr_p): Likewise.
(stores_zero_from_loop): Likewise.
* tree-data-ref.h (stores_from_loop, stores_zero_from_loop,
stmt_with_adjacent_zero_store_dr_p, stride_of_unit_type_p): Remove.
(adjacent_store_dr_p): New function.
* tree-loop-distribution.c (generate_memset_builtin): Pass
the RDG, use the already available data-reference.
(generate_code_for_partition): Pass down RDG.
(classify_partition): Inline parts of the former
stmt_with_adjacent_zero_store_dr_p here and use adjacent_store_dr_p.
(ldist_gen): Remember if there was any detected builtin and
do less work if not and flag_tree_loop_distribution is not set.
(tree_loop_distribution): Inline and fuse stores_from_loop
and stores_zero_from_loop here.
* tree-data-ref.c (have_similar_memory_accesses_1): Remove.
(ref_base_address_1): Likewise.
(remove_similar_memory_refs): Likewise.
* tree-data-ref.h (remove_similar_memory_refs): Remove.
* tree-loop-distribution.c (classify_partition): Do not classify
as builtin if -ftree-loop-distribute-patterns is not enabled.
(fuse_partitions_with_similar_memory_accesses): Inline ...
(ldist_gen): ... here. Fuse all non-builtin partitions if
-ftree-loop-distribution is not enabled. Properly return
the number of created partitions. Do not update SSA form here
but ...
(tree_loop_distribution): ... once here for the whole function.
Only walk innermost loops, constrain loops we consider here
further. Do not call remove_similar_memory_refs.
(distribute_loop): Do not check number of loop nodes here.
Martin Jambor [Sun, 3 Jun 2012 22:10:19 +0000 (00:10 +0200)]
ipa-prop.h (ipa_get_jf_known_type_offset): New function.
2012-06-03 Martin Jambor <mjambor@suse.cz>
* ipa-prop.h (ipa_get_jf_known_type_offset): New function.
(ipa_get_jf_known_type_base_type): Likewise.
(ipa_get_jf_known_type_component_type): Likewise.
(ipa_get_jf_constant): Likewise.
(ipa_get_jf_pass_through_formal_id): Likewise.
(ipa_get_jf_pass_through_operation): Likewise.
(ipa_get_jf_ancestor_offset): Likewise.
(ipa_get_jf_ancestor_type): Likewise.
(ipa_get_jf_ancestor_formal_id): Likewise.
(ipa_get_jf_member_ptr_pfn): Likewise.
* ipa-prop.c (ipa_set_jf_known_type): New function.
(ipa_set_jf_constant): Likewise.
(ipa_set_jf_simple_pass_through): Likewise.
(ipa_set_jf_arith_pass_through): Likewise.
(ipa_set_ancestor_jf): Likewise.
(fill_member_ptr_cst_jump_function): Moved up and renamed to
ipa_set_jf_member_ptr_cst.
(detect_type_change_1): Use the new jump function creation functions.
(compute_complex_assign_jump_func): Likewise.
(compute_complex_ancestor_jump_func): Likewise.
(compute_known_type_jump_func): Likewise.
(compute_scalar_jump_functions): Likewise.
(compute_pass_through_member_ptrs): Likewise.
(determine_cst_member_ptr): Likewise.
(combine_known_type_and_ancestor_jfs): Likewise.
(try_make_edge_direct_simple_call): Likewise.
(try_make_edge_direct_virtual_call): Likewise.
(update_indirect_edges_after_inlining): Likewise.
* ipa-cp.c (ipa_get_jf_pass_through_result): Use jump function
access functions. Incorporat NOP_EXPR and BINFO handling from its
callers.
(ipa_get_jf_ancestor_result): Likewise. Incorporate handling BINFOs
which was in its callers.
(ipa_value_from_jfunc): Use jump function access functions. Some
functionality moved to functions above.
(propagate_vals_accross_ancestor): Likewise.
(propagate_vals_accross_pass_through): Use jump function access
functions.
(propagate_accross_jump_function): Likewise.
* ipa-inline-analysis.c (remap_edge_change_prob): Use jump function
access functions.
(inline_merge_summary): Likewise.
PR fortran/48831
* gfortran.h (gfc_check_init_expr): Add prototype declaration
of function.
* check.c (kind_check): Change if condition to use
to gfc_check_init_expr.
* expr.c (check_init_expr): Remove forward declaration
and static keyword. Change name in gfc_check_init_expr.
Oleg Endo [Sun, 3 Jun 2012 11:26:54 +0000 (11:26 +0000)]
re PR target/53512 (SH Target: Allow fsca and fsrra for non-SH4A)
PR target/53512
* sh.opt (mfsca, mfsrra): New options.
* sh.md (rsqrtsf2): Use TARGET_FPU_ANY and TARGET_FSRRA condition.
(fsca): Use TARGET_FPU_ANY and TARGET_FSCA condition.
(sinssf2, cossf2): Fold expanders to ...
(sincossf3): ... this new expander. Use TARGET_FPU_ANY and
TARGET_FSCA condition.
* sh.c (sh_option_override): Handle TARGET_FSRRA and TARGET_FSCA.
* doc/invoke.texi (SH Options): Add descriptions for -mfsca,
-mno-fsca, -mfsrra, -mno-fsrra.
Steven Bosscher [Sat, 2 Jun 2012 21:51:18 +0000 (21:51 +0000)]
Restore Sparc build.
gcc/
* config/sparc/sparc.h (INITIAL_ELIMINATION_OFFSET): Split out to
new function sparc_initial_elimination_offset.
* config/sparc/sparc.c (sparc_initial_elimination_offset): New
function.
* config/sparc/sparc-protos.h (sparc_initial_elimination_offset):
Prototype it.
Jason Merrill [Fri, 1 Jun 2012 16:55:17 +0000 (12:55 -0400)]
re PR c++/53137 (g++ segfault)
PR c++/53137
* pt.c (instantiate_class_template_1): Set LAMBDA_EXPR_THIS_CAPTURE.
(instantiate_decl): Don't push_to_top_level for local class methods.
(instantiate_class_template_1): Or for local classes.
tree-loop-distribution.c (enum partition_kind): New enum.
2012-06-01 Richard Guenther <rguenther@suse.de>
* tree-loop-distribution.c (enum partition_kind): New enum.
(struct partition_s): Add kind and main_stmt members.
(partition_alloc): Initialize kind to PKIND_NORMAL.
(partition_builtin_p): New function.
(copy_loop_before): Remove failure path and assert instead.
(generate_loops_for_partition): Likewise.
(generate_memset_zero): Fold into ...
(generate_memset_builtin): ... this.
(classify_partition): New function with code from
can_generate_builtin and generate_builtin.
(generate_builtin): Remove.
(can_generate_builtin): Likewise.
(fuse_partitions_with_similar_memory_accesses): Call
partition_builtin_p instead of can_generate_builtin.
(rdg_build_partitions): Do not call
fuse_partitions_with_similar_memory_accesses here...
(ldist_gen): ... but here after classifying all partitions.
Remove failure path of generate_code_for_partition.
(generate_code_for_partition): Generate code according
to partition classification.
Tobias Burnus [Fri, 1 Jun 2012 05:53:31 +0000 (07:53 +0200)]
chmod.c (chmod_func): On MinGW, don't set is_dir
2012-06-01 Tobias Burnus <burnus@net-b.de>
* intrinsics/chmod.c (chmod_func): On MinGW, don't set is_dir
* and
fix octal-mode handling.
* io/unit.c (get_internal_unit): Add cast.
* io/unix.c (min): Undef "min" before defining it.
* runtime/backtrace.c (show_backtrace): Move label into
ifndef __MINGW__ block.
* config/cris/cris.c (cris_emit_trap_for_misalignment): New function.
* config/cris/cris-protos.h: Declare it.
* config/cris/cris.h [!TARGET_DEFAULT, TARGET_CPU_DEFAULT == 32]
(TARGET_DEFAULT): Add alignment by 32.
[!TARGET_DEFAULT, TARGET_CPU_DEFAULT == 10] (TARGET_DEFAULT): New
case, as TARGET_CPU_DEFAULT == 0 but with alignment as for
TARGET_CPU_DEFAULT == 32.
(TARGET_TRAP_UNALIGNED_ATOMIC): New macro.
* config/cris/cris.md: Include sync.md. Avoid allocating specific
numbers by replacing the define_constants for all UNSPECs with the
equivalent define_c_enum construct.
* config/cris/cris.opt (mtrap-unaligned-atomic): New option.
* config/cris/sync.md: New file.
David S. Miller [Fri, 1 Jun 2012 00:12:22 +0000 (00:12 +0000)]
Sparc longlong.h enhancements.
libgcc/
* longlong.h [SPARC] (umul_ppmm, udiv_qrnnd): Use hardware integer multiply
and divide instructions on 32-bit when V9.
(add_ssaaaa, sub_ddmmss): Convert to branchless code on 64-bit.
Steven Bosscher [Thu, 31 May 2012 20:19:00 +0000 (20:19 +0000)]
output.h (__gcc_host_wide_int__): Move to hwint.h.
* output.h (__gcc_host_wide_int__): Move to hwint.h.
(decl_default_tls_model): Move to tree.h
(dump_file): Move to system.h.
(default_stabs_asm_out_destructor, default_stabs_asm_out_constructor,
dbxout_int, dbxout_stabd, dbxout_begin_stabn, dbxout_begin_stabn_sline,
dbxout_begin_empty_stabs, dbxout_begin_simple_stabs,
dbxout_begin_simple_stabs_desc, dbxout_stab_value_zero,
dbxout_stab_value_zero, dbxout_stab_value_label_diff,
dbxout_stab_value_internal_label,
dbxout_stab_value_internal_label_diff): Move from here ...
* dbxout.h: ... to here.
* system.h (dump_file): Moved here from output.h.
* hwint.h (__gcc_host_wide_int__): Moved here from output.h.
* tree.h (decl_default_tls_model): Moved here from output.h.
* varasm.c (default_stabs_asm_out_destructor,
default_stabs_asm_out_constructor): Move from here ...
* dbxout.c: ... to here.
* gcov-dump.c (dump_file): Rename to dump_gcov_file. Update callers.
Diego Novillo [Thu, 31 May 2012 18:01:15 +0000 (14:01 -0400)]
Add new skeleton ChangeLog file generator to contrib/
This script analyzes a .diff file and generates a skeleton ChangeLog
entry for it. It tries fairly hard to find function names, so it's
important to use the -p switch with diff.
I wrote the initial code a while ago. Cary added a bunch of smarts to
make it understand C++ and guess the function names better than the
original version.
2012-05-31 Diego Novillo <dnovillo@google.com>
Cary Coutant <ccoutant@google.com>
Diego Novillo [Thu, 31 May 2012 17:25:41 +0000 (13:25 -0400)]
Fix compilation of build/*.o when using C++.
Found this while testing the C++ conversion for vec.[ch] on the
cxx-conversion branch. We do not build the build/*.o files with g++,
so I was getting lots of syntax errors while compiling build/vec.o.
2012-05-31 Diego Novillo <dnovillo@google.com>
* configure.ac (CXX_FOR_BUILD): Define and substitute.
(BUILD_CXXFLAGS): Define and substitute.
* Makefile.in (BUILD_CXXFLAGS): Define.
(CXX_FOR_BUILD): Define.
(COMPILER_FOR_BUILD): Set to CXX_FOR_BUILD if building with C++.
(LINKER_FOR_BUILD): Likewise.
(BUILD_COMPILERFLAGS): Set to BUILD_CXXFLAGS if building with C++.
(BUILD_LINKERFLAGS): Likewise.
* configure: Regenerate.
Georg-Johann Lay [Thu, 31 May 2012 15:01:03 +0000 (15:01 +0000)]
t-avr: Correct avr-mmcu.texi dependencies.
* config/avr/t-avr: Correct avr-mmcu.texi dependencies.
(s-avr-mmcu-texi): Don't sed on gen-avr-mmcu-texi output.
* doc/avr-mmcu.texi (svn:eol-style): Set to native.
Eric Botcazou [Thu, 31 May 2012 13:40:03 +0000 (13:40 +0000)]
tree-dfa.c (get_ref_base_and_extent): Compute the offset using double ints throughout.
* tree-dfa.c (get_ref_base_and_extent): Compute the offset using
double ints throughout.
* tree-sra.c (build_user_friendly_ref_for_offset) <RECORD_TYPE>:
Check that the position of the field is representable as an integer.
Greta Yorsh [Thu, 31 May 2012 09:57:17 +0000 (10:57 +0100)]
target-supports.exp (check_effective_target_vect_char_mult): Add arm32 to targets.
gcc/testsuite
2012-05-31 Greta Yorsh <Greta.Yorsh@arm.com>
* lib/target-supports.exp (check_effective_target_vect_char_mult): Add
arm32 to targets.
* gcc.dg/vect/slp-perm-8.c (main): Prevent vectorization
of the initialization loop.
(dg-final): Adjust the expected number of vectorized loops depending
on vect_char_mult target selector.
cris.h (CC1_SPEC): Pass through all -march= and -mcpu= options.
* config/cris/cris.h (CC1_SPEC): Pass through all -march=
and -mcpu= options.
(ASM_SPEC): Ditto, not just -march=v32, but translate non-v10,
non-v32 into --march=v0_v0_v10.
ira-int.h (target_ira_int): Rename x_move_cost to x_ira_register_move_cost...
gcc/
* ira-int.h (target_ira_int): Rename x_move_cost to
x_ira_register_move_cost, x_may_move_in_cost to
x_ira_may_move_in_cost and x_may_move_out_cost to
x_ira_may_move_out_cost. Delete the old fields with
those names and also x_ira_max_register_move_cost,
x_ira_max_may_move_in_cost and x_ira_max_may_move_out_cost.
(move_cost, may_move_in_cost, may_move_out_cost)
(ira_max_register_move_cost, ira_max_may_move_in_cost)
(ira_max_may_move_out_cost): Delete.
* ira.c (init_move_cost): Rename to...
(ira_init_register_move_cost): ...this, deleting the old
function with that name. Apply above variable renamings.
Retain asserts for null fields.
(ira_init_once): Don't initialize register move costs here.
(free_register_move_costs): Apply above variable renamings.
Remove code for deleted fields.
ira.c (init_move_cost): Adjust choice of subclasses to match the current ira_init_register_move_cost choice.
gcc/
* ira.c (init_move_cost): Adjust choice of subclasses to match
the current ira_init_register_move_cost choice. Use
ira_class_subset_p instead of reg_class_subset_p.
(ira_init_register_move_cost): Assert that move_cost,
may_move_in_cost and may_move_out_cost already hold the desired
values for their ira_* equivalents. For the latter two,
ignore classes that can't store a register of the given mode.
ira.c (setup_allocno_and_important_classes): Use ira_class_hard_regs_num to check whether a class has any allocatable registers.
gcc/
* ira.c (setup_allocno_and_important_classes): Use
ira_class_hard_regs_num to check whether a class has any
allocatable registers.
(ira_init_register_move_cost): Likewise.