* gcc.target/i386/rotate-3.c: New test.
* gcc.target/i386/rotate-3a.c: New test.
* gcc.target/i386/rotate-4.c: New test.
* gcc.target/i386/rotate-4a.c: New test.
* gcc.target/i386/rotate-5.c: New test.
* gcc.target/i386/rotate-5a.c: New test.
Jakub Jelinek [Thu, 16 May 2013 10:43:33 +0000 (12:43 +0200)]
omp-low.c (extract_omp_for_data): For collapsed loops...
* omp-low.c (extract_omp_for_data): For collapsed loops,
if at least one of the loops is known at compile time to
iterate zero times, set count to 0.
(expand_omp_regimplify_p): New function.
(expand_omp_for_generic): For collapsed loops, if at least
one of the loops isn't known to iterate at least once,
add runtime check with setting count to 0.
(expand_omp_for_static_nochunk, expand_omp_for_static_chunk):
For unsigned types if it isn't known at compile time that
the loop will iterate at least once, add runtime check to bypass
the whole loop if initial condition isn't true.
* testsuite/libgomp.c/loop-13.c: New test.
* testsuite/libgomp.c/loop-14.c: New test.
* testsuite/libgomp.c/loop-15.c: New test.
* testsuite/libgomp.c++/loop-13.C: New test.
* testsuite/libgomp.c++/loop-14.C: New test.
* testsuite/libgomp.c++/loop-15.C: New test.
Marc Glisse [Thu, 16 May 2013 10:26:51 +0000 (12:26 +0200)]
re PR middle-end/57286 (infinite recursion in fold-const.c:10037)
2013-05-16 Marc Glisse <marc.glisse@inria.fr>
PR middle-end/57286
gcc/
* fold-const.c (fold_ternary_loc) <VEC_COND_EXPR>: Disable some
transformations to avoid an infinite loop.
gcc/testsuite/
* gcc.dg/pr57286.c: New testcase.
* gcc.dg/vector-shift-2.c: Don't assume int has size 4.
* g++.dg/ext/vector22.C: Comment out transformations not
performed anymore.
Dodji Seketeli [Thu, 16 May 2013 06:14:49 +0000 (06:14 +0000)]
PR c++/56782 - Regression with empty pack expansions
In the example of the patch below, during the instantiation of
is_convertible at #1, we see at some point Tuple<>. (Let's note '{}'
an empty argument pack.) In that context, during the partial
specialization the member template
template<class... U>
Tuple<>::Tuple<U,
typename enable_if<and_<is_convertible<U, {}>...
>::value,
int
>::type
>
Let's look at what happens to the expansion "is_convertible<U, {}>...."
To express the result of that expansion tsubst_pack_expansion receives
the expansion is_convertible<U, T>, with the argument list [{}]. This
function should detect that we have an empty argument pack for the
parameter pack T and no argument pack for the parameter pack U. It
should thus return a pack expansion "is_convertible<U,T>..." that has this
information: "I have gotten an argument list, that is not complete
because U doesn't have any argument pack; the argument pack for T is
'{}', so I'll wait for the next time I am passed to
tsubst_pack_expansion with enough additional argument packs, to really
perform the substitution". That information is conveyed by attaching
the the '{}' to the PACK_EXPANSION_EXTRA property of the pack expansion
returned by tsubst_pack_expansion.
The problem in this report is that we are not setting
PACK_EXPANSION_EXTRA when the non-complete argument pack list is made
of an empty argument pack, because use_pack_expansion_extra_args_p
doesn't detect this case.
Fixed thus.
gcc/cp/
* pt.c (use_pack_expansion_extra_args_p): When at least a
parameter pack has an empty argument pack, and another parameter
pack has no argument pack at all, use the PACK_EXPANSION_EXTRA
mechanism.
re PR target/57260 (Generated R_MIPS_GOT_MIPS relocation for direct function call while compiling with -O2 on MIPS N64)
gcc/
PR target/57260
* config/mips/mips.c (mips_function_ok_for_sibcall): Don't allow
sibling calls to functions that would normally be lazily bound,
unless $gp is call-clobbered.
gcc/testsuite/
PR target/57260
* gcc.target/mips/call-1.c: Restrict to o32.
* gcc.target/mips/call-5.c, gcc.target/mips/call-6.c: New test.
Uros Bizjak [Wed, 15 May 2013 17:48:26 +0000 (19:48 +0200)]
i386.c (iy86_option_override_internal): Update processor_alias_table for missing PTA_PRFCHW and PTA_FXSR flags.
* config/i386/i386.c (iy86_option_override_internal): Update
processor_alias_table for missing PTA_PRFCHW and PTA_FXSR flags. Add
PTA_POPCNT to corei7 entry and remove PTA_SSE from athlon-4 entry.
Do not enable SSE prefetch on non-SSE 3dNow! targets. Enable
TARGET_PRFCHW for TARGET_3DNOW targets.
* config/i386/i386.md (prefetch): Enable for TARGET_PRFCHW instead
of TARGET_3DNOW.
(*prefetch_3dnow): Enable for TARGET_PRFCHW only.
Teresa Johnson [Wed, 15 May 2013 14:14:15 +0000 (14:14 +0000)]
function.h (has_bb_partition): New rtl_data flag.
2013-05-15 Teresa Johnson <tejohnson@google.com>
* function.h (has_bb_partition): New rtl_data flag.
(bb_reorder_complete): Ditto.
* cfgcleanup.c (try_crossjump_to_edge): Check for has_bb_partition
instead of flag_reorder_blocks_and_partition.
* cfgrtl.c (verify_hot_cold_block_grouping): Moved from bb-reorder.c,
with some enhancements.
(rtl_verify_flow_info_1): Call verify_hot_cold_block_grouping.
* bb-reorder.c (connect_traces): Check for has_bb_partition
instead of flag_reorder_blocks_and_partition.
(verify_hot_cold_block_grouping): Moved to cfgrtl.c.
(reorder_basic_blocks): Set bb_reorder_complete flag, remove call to
verify_hot_cold_block_grouping.
(partition_hot_cold_basic_blocks): Set has_bb_partition.
PR target/19599
* config/arm/predicates.md (call_insn_operand): New predicate.
* config/arm/constraints.md ("Cs", "Ss"): New constraints.
* config/arm/arm.md (*call_insn, *call_value_insn): Match only
if insn is not a tail call.
(*sibcall_insn, *sibcall_value_insn): Adjust for tailcalling through
registers.
* config/arm/arm.h (enum reg_class): New caller save register class.
(REG_CLASS_NAMES): Likewise.
(REG_CLASS_CONTENTS): Likewise.
* config/arm/arm.c (arm_function_ok_for_sibcall): Allow tailcalling
without decls.
Martin Jambor [Wed, 15 May 2013 10:39:28 +0000 (12:39 +0200)]
ipa-prop.c (ipa_make_edge_direct_to_target): Redirect calls to non-functions to builtin_unreachable.
2013-05-15 Martin Jambor <mjambor@suse.cz>
* ipa-prop.c (ipa_make_edge_direct_to_target): Redirect calls to
non-functions to builtin_unreachable.
* ipa-inline-transform.c (inline_call): Do not assert estimates were
correct when new direct edges were discovered.
Martin Jambor [Wed, 15 May 2013 10:35:59 +0000 (12:35 +0200)]
ipa-prop.c (ipa_print_node_jump_functions): Print symbol order in header...
2013-05-15 Martin Jambor <mjambor@suse.cz>
* ipa-prop.c (ipa_print_node_jump_functions): Print symbol order in
header, print symbol order instead of node uid, print more information
about indirect edge targets.
(ipa_make_edge_direct_to_target): Print symbol order instead of node
uids.
(ipa_make_edge_direct_to_target): Likewise.
(remove_described_reference): Likewise.
(propagate_controlled_uses): Likewise.
(ipa_print_node_params): Also print symbol order.
(ipcp_transform_function): Print symbol order instead of node uids.
* cgraph.c (cgraph_redirect_edge_call_stmt_to_callee): Likewise.
(cgraph_get_create_real_symbol_node): Likewise.
* ipa-cp.c (print_lattice): Likewise.
(print_all_lattices): Likewise.
(determine_versionability): Likewise.
(initialize_node_lattices): Likewise.
(estimate_local_effects): Likewise.
(update_profiling_info): Likewise.
(create_specialized_node): Likewise.
(perhaps_add_new_callers): Likewise.
(decide_about_value): Likewise.
(decide_whether_version_node): Likewise.
(identify_dead_nodes): Likewise.
* ipa-inline-analysis.c (dump_inline_edge_summary): Likewise.
(dump_inline_summary): Likewise.
(estimate_node_size_and_time): Likewise.
(inline_analyze_function): Likewise.
* ipa-inline.c (report_inline_failed_reason): Likewise.
(want_early_inline_function_p): Likewise.
(edge_badness): Likewise.
(update_edge_key): Likewise.
(inline_small_functions): Likewise. Add dumping of order to two other
dumps.
* ipa-pure-const.c (pure_const_read_summary): Print symbol order
instead of node uids.
(propagate_pure_const): Likewise.
(propagate_pure_const): Likewise.
* ipa-utils.c (dump_cgraph_node_set): Likewise.
* lto-cgraph.c (input_node): Explicitly specify we dump uid.
* lto-symtab.c (lto_cgraph_replace_node): Print symbol order instead
of node uids.
* tree-pretty-print.c (dump_function_header): Likewise.
* tree-sra.c (convert_callers_for_node): Dump in traditional format.
Print symbol order instead of node uids.
lto/
* lto-partition.c (lto_balanced_map): Print symbol order instead
of node uids.
Richard Biener [Wed, 15 May 2013 08:12:49 +0000 (08:12 +0000)]
re PR tree-optimization/57275 (Error in data dependence analysis during gather vectorization)
2013-05-15 Richard Biener <rguenther@suse.de>
PR tree-optimization/57275
* tree-vect-data-refs.c (vect_analyze_data_ref_dependence): Fix
return value for fail to do runtime alias checks for gather loads.
Jan Hubicka [Wed, 15 May 2013 08:09:26 +0000 (10:09 +0200)]
re PR c++/57038 (Latest libreoffice compilation fails with enabled LTO)
PR lto/57038
PR lto/47375
* lto-symtab.c (lto_symtab_symbol_p): Add external symbol; weakrefs are
not external.
(lto_symtab_merge_decls): Fix thinko when dealing with non-lto_symtab decls.
(lto_symtab_merge_cgraph_nodes): Use lto_symtab_symbol_p.
(lto_symtab_prevailing_decl): Get int sync with lto_symtab_symbol_p.
* varpool.c (dump_varpool_node): Dump more flags.
Jakub Jelinek [Tue, 14 May 2013 19:41:13 +0000 (21:41 +0200)]
tree.c (warn_deprecated_use): Print file:line using locus color.
* tree.c (warn_deprecated_use): Print file:line using locus color.
* diagnostic.c (diagnostic_report_current_module): Print file:line
and file:line:column using locus color.
Steven Bosscher [Tue, 14 May 2013 17:20:08 +0000 (17:20 +0000)]
rtl.h (next_label, [...]): Remove prototypes.
* rtl.h (next_label, skip_consecutive_labels, link_cc0_insns):
Remove prototypes.
* emit-rtl.c (next_label): Remove unused function.
(skip_consecutive_labels, link_cc0_insns): Move to ...
* reorg.c (skip_consecutive_labels, link_cc0_insns): ... here, the
only place where these functions are used, and make them static.
James Greenhalgh [Tue, 14 May 2013 14:56:13 +0000 (14:56 +0000)]
[AArch64] Fix vcond where comparison and result have different types.
gcc/
* config/aarch64/aarch64-simd.md
(aarch64_vcond_internal<mode>): Rename to...
(aarch64_vcond_internal<mode><mode>): ...This, for integer modes.
(aarch64_vcond_internal<VDQF_COND:mode><VDQF:mode>): ...This for
float modes. Clarify all iterator modes.
(vcond<mode><mode>): Use new name for vcond expanders.
(vcond<v_cmp_result><mode>): Likewise.
(vcondu<mode><mode>: Likewise.
* config/aarch64/iterators.md (VDQF_COND): New.
Jason Merrill [Tue, 14 May 2013 12:49:08 +0000 (08:49 -0400)]
re PR c++/56998 (ICE in value_dependent_expression_p, at cp/pt.c:19598)
PR c++/56998
* semantics.c (potential_constant_expression_1): Make sure the
called function is potentially constant.
* call.c (null_ptr_cst_p): Revert earlier change.
Marc Glisse [Tue, 14 May 2013 12:06:27 +0000 (14:06 +0200)]
re PR bootstrap/57266 (comparison between signed and unsigned integer expressions in fold_binary_loc breaks m68k bootstrap)
2013-05-14 Marc Glisse <marc.glisse@inria.fr>
PR bootstrap/57266
* fold-const.c (fold_binary_loc) <shift>: Use an unsigned
variable for the shift amount. Check that we shift by non-negative
amounts.
Joern Rennecke [Tue, 14 May 2013 11:15:08 +0000 (11:15 +0000)]
avr.c (avr_encode_section_info): Bail out if the type is error_mark_node.
gcc:
* config/avr/avr.c (avr_encode_section_info): Bail out if the type
is error_mark_node.
gcc/testsuite:
* testsuite/gcc.c-torture/compile/limits-externdecl.c [target avr-*-*]:
Expect "size of array is too large" error.
Jakub Jelinek [Tue, 14 May 2013 08:55:34 +0000 (10:55 +0200)]
expmed.c (expand_shift_1): Canonicalize rotates by constant bitsize / 2 to bitsize - 1.
* expmed.c (expand_shift_1): Canonicalize rotates by
constant bitsize / 2 to bitsize - 1.
* simplify-rt.x (simplify_binary_operation_1) <case ROTATE,
case ROTATERT>: Likewise.
Revert:
2013-05-10 Jakub Jelinek <jakub@redhat.com>
* config/i386/i386.md (rotateinv): New code attr.
(*<rotate_insn><mode>3_1, *<rotate_insn>si3_1_zext,
*<rotate_insn>qi3_1_slp): Emit rorl %eax instead of
roll $31, %eax, etc.
Jakub Jelinek [Mon, 13 May 2013 11:04:26 +0000 (13:04 +0200)]
re PR tree-optimization/45216 (Rotate expressions not recognized at tree level)
PR tree-optimization/45216
PR tree-optimization/57157
* tree-ssa-forwprop.c (simplify_rotate): Only recognize
the (-Y) & (B - 1) variant if OP is |.
* expmed.c (expand_shift_1): For rotations by const0_rtx just
return shifted. Use (-op1) & (prec - 1) as other_amount
instead of prec - op1.
* c-c++-common/rotate-1.c: Add 32 tests with +.
* c-c++-common/rotate-1a.c: Adjust.
* c-c++-common/rotate-2.c: Add 32 tests with +, expect
only 48 rotates.
* c-c++-common/rotate-2b.c: New test.
* c-c++-common/rotate-3.c: Add 32 tests with +.
* c-c++-common/rotate-4.c: Add 32 tests with +, expect
only 48 rotates.
* c-c++-common/rotate-4b.c: New test.
* c-c++-common/rotate-5.c: New test.
Martin Jambor [Mon, 13 May 2013 10:16:09 +0000 (12:16 +0200)]
re PR middle-end/42371 (dead code not eliminated during folding with whole-program)
2013-05-13 Martin Jambor <mjambor@suse.cz>
PR middle-end/42371
* ipa-prop.h (IPA_UNDESCRIBED_USE): New macro.
(ipa_constant_data): New type.
(ipa_jump_func): Use ipa_constant_data to hold information about
constant jump functions.
(ipa_get_jf_constant): Adjust to jump function type changes.
(ipa_get_jf_constant_rdesc): New function.
(ipa_param_descriptor): New field controlled_uses.
(ipa_get_controlled_uses): New function.
(ipa_set_controlled_uses): Likewise.
* ipa-ref.h (ipa_find_reference): Declare.
* ipa-prop.c (ipa_cst_ref_desc): New type.
(ipa_print_node_jump_functions_for_edge): Adjust for jump function type
changes.
(ipa_set_jf_constant): Likewise. Also create reference descriptions.
New parameter cs. Adjust all callers.
(ipa_analyze_params_uses): Detect uncontrolled and controlled uses.
(remove_described_reference): New function.
(jfunc_rdesc_usable): Likewise.
(try_make_edge_direct_simple_call): Decrement controlled use count,
attempt to remove reference if it hits zero.
(combine_controlled_uses_counters): New function.
(propagate_controlled_uses): Likewise.
(ipa_propagate_indirect_call_infos): Call propagate_controlled_uses.
(ipa_edge_duplication_hook): Duplicate reference descriptions.
(ipa_print_node_params): Print described use counter.
(ipa_write_jump_function): Adjust to jump function type changes.
(ipa_read_jump_function): New parameter CS, pass it to
ipa_set_jf_constant. Adjust caller.
(ipa_write_node_info): Stream controlled use count
(ipa_read_node_info): Likewise.
* cgraph.c (cgraph_mark_address_taken_node): Bail out instead of
asserting.
* ipa-cp.c (ipcp_discover_new_direct_edges): Decrement controlled use
count. Remove cloning-added reference if it reaches zero.
* ipa-ref.c (ipa_find_reference): New function.