gcc.git
9 years agoAdd BUILD_NO_PIE_CFLAGS and BUILD_NO_PIE_FLAG
H.J. Lu [Thu, 29 Oct 2015 12:29:43 +0000 (12:29 +0000)]
Add BUILD_NO_PIE_CFLAGS and BUILD_NO_PIE_FLAG

We shouldn't use NO_PIE_CFLAGS and NO_PIE_FLAG with CXX_FOR_BUILD
when CXX_FOR_BUILD != CXX.  This patch adds BUILD_NO_PIE_CFLAGS
and BUILD_NO_PIE_FLAG to use with CXX_FOR_BUILD.  They are set to
NO_PIE_CFLAGS and NO_PIE_FLAG when build machine == host machine.
Otherwise, they are set to NO_PIE_CFLAGS_FOR_BUILD and
NO_PIE_FLAG_FOR_BUILD.

* Makefile.in (NO_PIE_CFLAGS): New.
(NO_PIE_FLAG): Likewise.
(NO_PIE_CFLAGS_FOR_BUILD): Likewise.
(NO_PIE_FLAG_FOR_BUILD): Likewise.
(BUILD_NO_PIE_CFLAGS): Likewise.
(BUILD_NO_PIE_FLAG): Likewise.
(COMPILER): Replace @NO_PIE_CFLAGS@ with $(NO_PIE_CFLAGS).
(LINKER): Replace @NO_PIE_FLAG@ with $(NO_PIE_FLAG).
(BUILD_CFLAGS): Replace @NO_PIE_CFLAGS@ with
$(BUILD_NO_PIE_CFLAGS).
(BUILD_CXXFLAGS): Likewise.
(BUILD_LDFLAGS ): Replace @NO_PIE_FLAG@ with
$(BUILD_NO_PIE_FLAG).
* configure.ac (BUILD_NO_PIE_CFLAGS): New.  AC_SUBST.
(BUILD_NO_PIE_FLAG): Likewise.
(NO_PIE_CFLAGS_FOR_BUILD): Likewise.
(NO_PIE_FLAG_FOR_BUILD): Likewise.
* configure: Regenerated.

From-SVN: r229522

9 years agoImprove filenames for test cases of OpenACC combined directives
Thomas Schwinge [Thu, 29 Oct 2015 09:03:40 +0000 (10:03 +0100)]
Improve filenames for test cases of OpenACC combined directives

libgomp/
* testsuite/libgomp.oacc-c-c++-common/combdir-1.c: Rename to...
* testsuite/libgomp.oacc-c-c++-common/combined-directives-1.c:
... this.  Add a description of the test at the top of the file.
* testsuite/libgomp.oacc-fortran/combdir-1.f90: Rename file to...
* testsuite/libgomp.oacc-fortran/combined-directives-1.f90:
... this.  Add a description of the test at the top of the file.

Co-Authored-By: Cesar Philippidis <cesar@codesourcery.com>
From-SVN: r229518

9 years agore PR middle-end/56956 (ftrapv traps on valid abs-like code)
Richard Biener [Thu, 29 Oct 2015 08:21:50 +0000 (08:21 +0000)]
re PR middle-end/56956 (ftrapv traps on valid abs-like code)

2015-10-29  Richard Biener  <rguenther@suse.de>

PR middle-end/56956
* fold-const.c (fold_cond_expr_with_comparison): Do not fold
unsigned conditonal negation to ABS_EXPR.

* c-c++-common/ubsan/pr56956.c: New testcase.

From-SVN: r229517

9 years agogimple-match-head.c (gimple_simplify): Remove premature checking of builtin_decl_impl...
Richard Biener [Thu, 29 Oct 2015 08:16:44 +0000 (08:16 +0000)]
gimple-match-head.c (gimple_simplify): Remove premature checking of builtin_decl_implicit of function calls we simplify.

2015-10-29  Richard Biener  <rguenther@suse.de>

* gimple-match-head.c (gimple_simplify): Remove premature checking
of builtin_decl_implicit of function calls we simplify.

fortran/
* f95-lang.c: Properly build variadic types for classification
and comparison builtins.

From-SVN: r229515

9 years agotree-ssa-loop-ivopts.c (split_address_cost): Check depends_on.
Bin Cheng [Thu, 29 Oct 2015 04:40:37 +0000 (04:40 +0000)]
tree-ssa-loop-ivopts.c (split_address_cost): Check depends_on.

* tree-ssa-loop-ivopts.c (split_address_cost): Check depends_on.
(get_computation_cost_at): Ditto.
(determine_use_iv_cost_address): Pass NULL for arguments depends_on
and inv_expr_id.

From-SVN: r229514

9 years agoDaily bump.
GCC Administrator [Thu, 29 Oct 2015 00:16:12 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r229511

9 years ago* gnat.dg/discr44.adb: New test.
Eric Botcazou [Wed, 28 Oct 2015 22:33:46 +0000 (22:33 +0000)]
* gnat.dg/discr44.adb: New test.

From-SVN: r229508

9 years agoRemove superfluous code in intra_create_variable_infos
Tom de Vries [Wed, 28 Oct 2015 21:19:32 +0000 (21:19 +0000)]
Remove superfluous code in intra_create_variable_infos

2015-10-28  Tom de Vries  <tom@codesourcery.com>

* tree-ssa-structalias.c (intra_create_variable_infos): Remove
superfluous code.

From-SVN: r229506

9 years agoFix for ICE with -g on testcase with incomplete types.
Jim Wilson [Wed, 28 Oct 2015 20:02:01 +0000 (20:02 +0000)]
Fix for ICE with -g on testcase with incomplete types.

gcc/c/
PR debug/66068
* c-typeck.c (c_build_qualified_type): Clear C_TYPE_INCOMPLETE_VARS
after calling build_qualified_type.
gcc/testsuite/
PR debug/66068
* gcc.dg/debug/pr66068.c: New test.

From-SVN: r229505

9 years agoMake-lang.in (c.tags): Also include libcpp TAGS.
Jason Merrill [Wed, 28 Oct 2015 19:45:33 +0000 (15:45 -0400)]
Make-lang.in (c.tags): Also include libcpp TAGS.

gcc/c/
* Make-lang.in (c.tags): Also include libcpp TAGS.
gcc/cp/
* Make-lang.in (c++.tags): Also include libcpp TAGS.

From-SVN: r229504

9 years agore PR fortran/67933 (ICE for array of a derived type with allocatable class in derive...
Paul Thomas [Wed, 28 Oct 2015 19:28:54 +0000 (19:28 +0000)]
re PR fortran/67933 (ICE for array of a derived type with allocatable class in derived type object)

2015-01-28  Paul Thomas  <pault@gcc.gnu.org>

PR fortran/67933
* gfortran.dg/allocate_with_source_15.f03: Correct trivial
array bounds error at line 25.

From-SVN: r229503

9 years agoDR 1518
Jason Merrill [Wed, 28 Oct 2015 18:55:38 +0000 (14:55 -0400)]
DR 1518

DR 1518
* class.c (type_has_user_provided_or_explicit_constructor): New.
(check_bases_and_members): Use it.
* cp-tree.h: Declare it.

From-SVN: r229501

9 years ago* c-common.c (pointer_int_sum): Fold the MULT_EXPR.
Jason Merrill [Wed, 28 Oct 2015 18:54:48 +0000 (14:54 -0400)]
* c-common.c (pointer_int_sum): Fold the MULT_EXPR.

From-SVN: r229500

9 years agoomp-low.c (MASK_GANG, [...]): Delete.
Nathan Sidwell [Wed, 28 Oct 2015 18:35:31 +0000 (18:35 +0000)]
omp-low.c (MASK_GANG, [...]): Delete.

* omp-low.c (MASK_GANG, MASK_WORKER, MASK_VECTOR): Delete.
(extract_omp_for_data): Remove OpenACC special handling of
chunking.

From-SVN: r229499

9 years agonvptx.c (nvptx_print_operand): Remove 'd' case.
Nathan Sidwell [Wed, 28 Oct 2015 18:32:07 +0000 (18:32 +0000)]
nvptx.c (nvptx_print_operand): Remove 'd' case.

* config/nvptx/nvptx.c (nvptx_print_operand): Remove 'd' case.
(struct parallel): Update comment.
(nvptx_reorg): Likewise.
(nvptx_neuter): Cleanup whitespace.

From-SVN: r229498

9 years ago* tree-eh.c (mark_reachable_handlers): Fix typo in assert.
Richard Henderson [Wed, 28 Oct 2015 18:15:20 +0000 (11:15 -0700)]
* tree-eh.c (mark_reachable_handlers): Fix typo in assert.

From-SVN: r229497

9 years agooddspreg-3.c: Disable for MIPS16.
Catherine Moore [Wed, 28 Oct 2015 18:09:09 +0000 (14:09 -0400)]
oddspreg-3.c: Disable for MIPS16.

2015-10-28  Catherine Moore  <clm@codesourcery.com>

        * gcc.target/mips/oddspreg-3.c: Disable for MIPS16.
        * gcc.target/mips/oddspreg-6.c: Likewise.
        * gcc.target/mips/oddspreg-1.c: Likewise.
        * gcc.target/mips/oddspreg-2.c: Likewise.

From-SVN: r229496

9 years agore PR target/67839 (Bit addressable instructions generated for invalid memory address)
Senthil Kumar Selvaraj [Wed, 28 Oct 2015 17:35:27 +0000 (17:35 +0000)]
re PR target/67839 (Bit addressable instructions generated for invalid memory address)

gcc/ChangeLog

PR target/67839
* config/avr/predicates.md (low_io_address_operand): Don't
consider MODE when computing upper bound.
(io_address_operand): Likewise.

gcc/testsuite/ChangeLog

PR target/67839
* gcc.target/avr/pr67839.c: New test.

From-SVN: r229495

9 years agofold-const.c (operand_equal_p): Do not verify that types are compatible for MEM_REFs.
Jan Hubicka [Wed, 28 Oct 2015 16:35:15 +0000 (17:35 +0100)]
fold-const.c (operand_equal_p): Do not verify that types are compatible for MEM_REFs.

* fold-const.c (operand_equal_p): Do not verify that types are
compatible for MEM_REFs.

From-SVN: r229494

9 years agogimple-match-head.c (gimple_simplify): Allow VECTOR_CSTs in simplifying VEC_COND_EXPR...
Richard Biener [Wed, 28 Oct 2015 15:28:04 +0000 (15:28 +0000)]
gimple-match-head.c (gimple_simplify): Allow VECTOR_CSTs in simplifying VEC_COND_EXPR conditions.

2015-10-28  Richard Biener  <rguenther@suse.de>

* gimple-match-head.c (gimple_simplify): Allow VECTOR_CSTs
in simplifying VEC_COND_EXPR conditions.

* gcc.dg/tree-ssa/operand-equal-2.c: Adjust.

From-SVN: r229492

9 years agoGenerate constraints only once in intra_create_variable_infos
Tom de Vries [Wed, 28 Oct 2015 15:09:21 +0000 (15:09 +0000)]
Generate constraints only once in intra_create_variable_infos

2015-10-28  Tom de Vries  <tom@codesourcery.com>

* tree-ssa-structalias.c (intra_create_variable_infos): Don't iterate
into vi_next of a full_var.

From-SVN: r229490

9 years agoImprove alias dump info
Tom de Vries [Wed, 28 Oct 2015 15:09:12 +0000 (15:09 +0000)]
Improve alias dump info

2015-10-28  Tom de Vries  <tom@codesourcery.com>

* tree-ssa-structalias.c (new_var_info, make_heapvar)
(make_constraint_from_restrict, make_constraint_from_global_restrict)
(create_function_info_for, create_variable_info_for_1)
(create_variable_info_for): Add and handle add_id parameter.
(get_call_vi, new_scalar_tmp_constraint_exp, handle_rhs_call)
(init_base_vars): Add extra argument to calls to new_var_info.
(get_vi_for_tree): Add extra argument to call to
create_variable_info_for.
(process_constraint, do_deref, process_all_all_constraints): Add extra
argument to calls to new_scalar_tmp_constraint_exp.
(handle_lhs_call, find_func_aliases_for_builtin_call): Add extra
argument to calls to make_heapvar.
(make_restrict_var_constraints): Add extra argument to call to
make_constraint_from_global_restrict.
(intra_create_variable_infos): Add extra argument to call to
create_variable_info_for_1.
(ipa_pta_execute): Add extra argument to call to
create_function_info_for.

* gcc.dg/tree-ssa/pta-callused.c: Update to scan for CALLUSED(id).

From-SVN: r229489

9 years agoHandle noplt in call expanders for AArch64.
Ramana Radhakrishnan [Wed, 28 Oct 2015 14:41:10 +0000 (14:41 +0000)]
Handle noplt in call expanders for AArch64.

2015-10-28  Ramana Radhakrishnan  <ramana.radhakrishnan@arm.com>

* config/aarch64/aarch64.md (call, call_value, sibcall): Handle noplt.
(sibcall_value): Likewise.

From-SVN: r229488

9 years agoloop-g-1.c: New.
Nathan Sidwell [Wed, 28 Oct 2015 14:27:30 +0000 (14:27 +0000)]
loop-g-1.c: New.

* testsuite/libgomp.oacc-c-c++-common/loop-g-1.c: New.
* testsuite/libgomp.oacc-c-c++-common/loop-g-2.c: New.
* testsuite/libgomp.oacc-c-c++-common/loop-gwv-1.c: New.
* testsuite/libgomp.oacc-c-c++-common/loop-v-1.c: New.
* testsuite/libgomp.oacc-c-c++-common/loop-w-1.c: New.
* testsuite/libgomp.oacc-c-c++-common/loop-wv-1.c: New.

From-SVN: r229487

9 years agonvptx.h (struct machine_function): Add axis_predicate.
Nathan Sidwell [Wed, 28 Oct 2015 14:24:39 +0000 (14:24 +0000)]
nvptx.h (struct machine_function): Add axis_predicate.

* config/nvptx/nvptx.h (struct machine_function): Add
axis_predicate.
* config/nvptx/nvptx-protos.h (nvptx_expand_oacc_fork,
nvptx_expand_oacc_join): Declare.
* config/nvptx/nvptx.md (UNSPEC_NTID, UNSPEC_TID): Delete.
(UNSPEC_DIM_SIZE, UNSPEC_SHARED_DATA, UNSPEC_BIT_CONV,
UNSPEC_SHUFFLE, UNSPEC_BR_UNIFIED): New.
(UNSPECV_BARSYNC, UNSPECV_DIM_POS, UNSPECV_FORK, UNSPECV_FORKED,
UNSPECV_JOINING, UNSPECV_JOIN): New.
(BITS, BITD): New mode iterators.
(br_true_uni, br_false_uni): New.
(*oacc_ntid_insn, oacc_ntid, *oacc_tid_insn, oacc_tid): Delete.
(oacc_dim_size, oacc_dim_pos): New.
(nvptx_fork, nvptx_forked, nvptx_joining, nvptx_join): New.
(oacc_fork, oacc_join): New.
(nvptx_shuffle<mode>, unpack<mode>si2, packsi<mode>2): New.
(worker_load<mode>, worker_store<mode>): New.
(nvptx_barsync): New.
* config/nvptx/nvptx.c: Include gimple.h & dumpfile.h.
(SHUFFLE_UP, SHUFFLE_DOWN, SHUFFLE_BFLY, SHUFFLE_IDX): Define.
(worker_bcast_hwm, worker_bcast_align, worker_bcast_name,
worker_bcast_sym): New.
(nvptx_option_override): Initialize worker broadcast buffer.
(nvptx_emit_forking, nvptx_emit_joining): New.
(nvptx_init_axis_predicate): New.
(nvptx_declare_function_name): Init axis predicates.
(nvptx_expand_call): Add fork/join markers around routine call.
(nvptx_expand_oacc_fork, nvptx_expand_oacc_join): New.
(nvptx_gen_unpack, nvptx_gen_pack, nvptx_gen_shuffle): New.
(nvptx_gen_vcast): New.
(struct wcast_data_t): New.
(enum propagate_mask): New.
(nvptx_gen_wcast): New.
(nvptx_print_operand): Add 'S' case.
(struct parallel): New.
(parallel::parallel, parallel::~parallel): New.
(bb_insn_map_t, insn_bb_t, insn_bb_vec_t): New typedefs.
(nvptx_split_blocks, nvptx_discover_pre, nvptx_dump_pars,
nvptx_find_par, nvptx_discover_pars): New.
(nvptx_propagate): New.
(vprop_gen, nvptx_vpropagate): New.
(wprop_gen, nvptx_wpropagate): New.
(nvptx_wsync): New.
(nvptx_single, nvptx_skip_par): New.
(nvptx_process_pars, nvptx_neuter_pars): New.
(ntptx_reorg): Split blocks, generate parallel structure, apply
neutering.
(nvptx_cannot_copy_insn_p): New.
(nvptx_file_end): Emit worker broadcast decl.
(nvptx_goacc_fork_join): New.
(TARGET_CANNOT_COPY_INSN_P): Override.
(TARGET_GOACC_FORK_JOIN): Override.

From-SVN: r229486

9 years agore PR ipa/67600 (Segfault when assigning only one char to ostreambuf_iterator<char...
Richard Biener [Wed, 28 Oct 2015 13:44:18 +0000 (13:44 +0000)]
re PR ipa/67600 (Segfault when assigning only one char to ostreambuf_iterator<char> compiled with -O2 or -O3)

2015-10-28  Richard Biener  <rguenther@suse.de>

PR ipa/67600
* g++.dg/torture/pr67600.C: Remove preprocessed headers in favor
of #includes.

From-SVN: r229485

9 years agofold-const.c (negate_expr_p): Adjust the division case to properly avoid introducing...
Richard Biener [Wed, 28 Oct 2015 13:41:25 +0000 (13:41 +0000)]
fold-const.c (negate_expr_p): Adjust the division case to properly avoid introducing undefined overflow.

2015-10-28  Richard Biener  <rguenther@suse.de>

* fold-const.c (negate_expr_p): Adjust the division case to
properly avoid introducing undefined overflow.
(fold_negate_expr): Likewise.

From-SVN: r229484

9 years agore PR middle-end/65962 (Missed vectorization of strided stores)
Richard Biener [Wed, 28 Oct 2015 10:09:37 +0000 (10:09 +0000)]
re PR middle-end/65962 (Missed vectorization of strided stores)

2015-10-28  Richard Biener  <rguenther@suse.de>

PR tree-optimization/65962
* tree-ssa-pre.c (eliminate_dom_walker::before_dom_children):
Avoid creating loop carried dependences also for outer loops
of the loop a use to replace is in.

* gcc.dg/vect/vect-62.c: Adjust.

From-SVN: r229481

9 years agocommon.opt (fchecking): New flag controlling flag_checking.
Richard Biener [Wed, 28 Oct 2015 10:07:03 +0000 (10:07 +0000)]
common.opt (fchecking): New flag controlling flag_checking.

2015-10-28  Richard Biener  <rguenther@suse.de>

* common.opt (fchecking): New flag controlling flag_checking.
* passes.c (verify_curr_properties): Drop DEBUG_FUNCTION.
* timevar.c (timer::print): Adjust output.
* doc/invoke.texi (fchecking): Document.

From-SVN: r229480

9 years agore PR middle-end/68067 (Wrong constant folding)
Richard Biener [Wed, 28 Oct 2015 10:01:23 +0000 (10:01 +0000)]
re PR middle-end/68067 (Wrong constant folding)

2015-10-28  Richard Biener  <rguenther@suse.de>

PR middle-end/68067
* fold-const.c (negate_expr_p): We cannot negate plus or minus
if overflow is not wrapping.  Likewise multiplication unless
one operand is constant and not power of two.
(fold_negate_expr): Adjust accordingly.

* gcc.dg/torture/pr68067-1.c: New testcase.
* gcc.dg/torture/pr68067-2.c: Likewise.

From-SVN: r229479

9 years agors6000: p8vector-builtin-8.c test requires int128
Segher Boessenkool [Wed, 28 Oct 2015 04:35:25 +0000 (05:35 +0100)]
rs6000: p8vector-builtin-8.c test requires int128

For 32-bit targets p8vector_ok does not imply we have int128.

2015-10-28  Segher Boessenkool  <segher@kernel.crashing.org>

gcc/testsuite/
* gcc.target/powerpc/p8vector-builtin-8.c: Add "target int128".

From-SVN: r229474

9 years agors6000: Fix tests for xvmadd and xvnmsub
Segher Boessenkool [Wed, 28 Oct 2015 04:33:03 +0000 (05:33 +0100)]
rs6000: Fix tests for xvmadd and xvnmsub

The patterns involved can create vmadd resp. vnmsub instructions instead.
This patch changes the testcases to allow those.

2015-10-26  Segher Boessenkool  <segher@kernel.crashing.org>

gcc/testsuite/
* gcc.target/powerpc/vsx-builtin-2.c: Allow vmadd and vnmsub as well
as xvmadd and xvnmsub.
* gcc.target/powerpc/vsx-vector-2.c: Allow vmadd as well as xvmadd.

From-SVN: r229473

9 years agoomp-low.c (struct omp_context): Remove gwv_below, gwv_this fields.
Nathan Sidwell [Wed, 28 Oct 2015 03:00:50 +0000 (03:00 +0000)]
omp-low.c (struct omp_context): Remove gwv_below, gwv_this fields.

* omp-low.c (struct omp_context): Remove gwv_below, gwv_this
fields.
(is_oacc_parallel, is_oacc_kernels): New.
(enclosing_target_ctx): May return NULL.
(ctx_in_oacc_kernels_region): New.
(check_oacc_kernel_gwv): New.
(oacc_loop_or_target_p): Delete.
(scan_omp_for): Don't calculate gwv mask.  Check parallel clause
operands.  Strip reductions fro kernels.
(scan_omp_target): Don't calculate gwv mask.
(lower_oacc_head_mark, lower_oacc_loop_marker,
lower_oacc_head_tail): New.
(struct oacc_collapse): New.
(expand_oacc_collapse_init, expand_oacc_collapse_vars): New.
(expand_omp_for_static_nochunk, expand_omp_for_static_chunk):
Remove OpenACC handling.
(expand_oacc_for): New.
(expand_omp_for): Call expand_oacc_for.
(lower_omp_for): Call lower_oacc_head_tail.

From-SVN: r229472

9 years agoplugin-nvptx.c (nvptx_exec): Remove check on compute dimensions.
Nathan Sidwell [Wed, 28 Oct 2015 03:00:10 +0000 (03:00 +0000)]
plugin-nvptx.c (nvptx_exec): Remove check on compute dimensions.

* plugin/plugin-nvptx.c (nvptx_exec): Remove check on compute
dimensions.

From-SVN: r229471

9 years ago[PATCH 7/9] ENABLE_CHECKING refactoring: middle-end, LTO FE
Mikhail Maltsev [Wed, 28 Oct 2015 01:05:53 +0000 (01:05 +0000)]
[PATCH 7/9] ENABLE_CHECKING refactoring: middle-end, LTO FE

[PATCH 7/9] ENABLE_CHECKING refactoring: middle-end, LTO FE
gcc/lto/ChangeLog:
2015-10-27  Mikhail Maltsev  <maltsevm@gmail.com>

* lto.c (unify_scc): Use flag_checking and remove ENABLE_CHECKING
conditionals.
(lto_fixup_state): Likewise.
(do_whole_program_analysis): Use
symtab_node::checking_verify_symtab_nodes and remove ENABLE_CHECKING
conditionals.

gcc/ChangeLog:

2015-10-27  Mikhail Maltsev  <maltsevm@gmail.com>

* attribs.c (check_attribute_tables): New function, broken out from...
(init_attributes): Use it.
* cfgcleanup.c (try_optimize_cfg): Use flag_checking, CHECKING_P
gcc_checking_assert and checking_* functions to eliminate
ENABLE_CHECKING conditionals.
* cfgexpand.c (expand_goto, expand_debug_expr): Likewise.
(pass_expand::execute): Likewise.
* cgraphclones.c (symbol_table::materialize_all_clones): Likewise.
* cgraphunit.c (mark_functions_to_output): Likewise.
(cgraph_node::expand_thunk): Likewise.
(symbol_table::compile): Likewise.
* ddg.c (add_cross_iteration_register_deps): Likewise.
(create_ddg_all_sccs): Likewise.
* df-core.c (df_finish_pass, df_analyze): Likewise.
* diagnostic-core.h: Likewise.
* diagnostic.c (diagnostic_report_diagnostic): Likewise.
* dominance.c (calculate_dominance_info): Likewise.
* dwarf2out.c (add_AT_die_ref): Likewise.
(const_ok_for_output_1, mem_loc_descriptor): Likewise.
(loc_list_from_tree, gen_lexical_block_die): Likewise.
gen_type_die_with_usage, gen_type_die): Likewise.
(dwarf2out_decl): Likewise.
* emit-rtl.c (verify_rtx_sharing, reorder_insns_nobb): Likewise.
* except.c (duplicate_eh_regions): Likewise.
* fwprop.c (register_active_defs, update_df_init): Likewise.
(fwprop_init, fwprop_done): Likewise.
(update_uses): Likewise.
* ggc-page.c (ggc_grow): Likewise.
* gimplify.c (gimplify_body): Likewise.
(gimplify_hasher::equal): Likewise.
* graphite-isl-ast-to-gimple.c (graphite_verify): Likewise.
* graphite-scop-detection.c (canonicalize_loop_closed_ssa_form):
Likewise.
* graphite-sese-to-poly.c (rewrite_reductions_out_of_ssa): Likewise.
(rewrite_cross_bb_scalar_deps_out_of_ssa): Likwise.
* hash-table.h (::find_empty_slot_for_expand): Likewise.
* ifcvt.c (if_convert): Likewise.
* ipa-cp.c (ipcp_propagate_stage): Likewise.
* ipa-devirt.c (type_in_anonymous_namespace_p): Likewise.
(odr_type_p, odr_types_equivalent_p): Likewise.
(add_type_duplicate, get_odr_type): Likewise.
* ipa-icf.c (sem_item_optimizer::execute): Likewise.
(sem_item_optimizer::subdivide_classes_by_equality): Likewise.
(sem_item_optimizer::verify_classes): Likewise.
(sem_item_optimizer::traverse_congruence_split): Likewise.
(sem_item_optimizer::checking_verify_classes): New.
* ipa-icf.h (sem_item_optimizer::checking_verify_classes): Add new
method.
* cfgrtl.c (commit_edge_insertions): Likewise.
(fixup_reorder_chain, cfg_layout_finalize): Likewise.
(rtl_flow_call_edges_add): Likewise.
* cgraph.c (symbol_table::create_edge): Likewise.
(cgraph_edge::redirect_call_stmt_to_callee): Likewise.
* cgraph.h (symtab_node): Likewise.
(symtab_node::checking_verify_symtab_nodes): Define.
(cgraph_node::checking_verify_cgraph_nodes): Define.
* cfghooks.h (checking_verify_flow_info): Define.
* cfgloop.h (checking_verify_loop_structure): Define.
* dominance.h (checking_verify_dominators): Define.
* et-forest.c: Fix comment.
* ipa-inline-analysis.c (compute_inline_parameters): Use flag_checking,
CHECKING_P gcc_checking_assert and checking_* functions to eliminate
ENABLE_CHECKING conditionals.
* ipa-inline-transform.c (save_inline_function_body): Likewise.
* ipa-inline.c (inline_small_functions): Likewise.
(early_inliner): Likewise.
* ipa-inline.h (estimate_edge_growth): Likewise.
* ipa-visibility.c (function_and_variable_visibility): Likewise.
* ipa.c (symbol_table::remove_unreachable_nodes): Likewise.
(ipa_single_use): Likewise.
* ira-int.h: Likewise.
* ira.c (ira): Likewise.
* loop-doloop.c (doloop_optimize_loops): Likewise.
* loop-init.c (loop_optimizer_init, fix_loop_structure): Likewise.
* loop-invariant.c (move_loop_invariants): Likewise.
* lra-assigns.c (lra_assign): Likewise.
* lra-constraints.c (lra_constraints): Likewise.
* lra-eliminations.c (lra_eliminate): Likewise.
* lra-int.h (struct lra_reg): Likewise.
* lra-lives.c (check_pseudos_live_through_calls): Likewise.
(lra_create_live_ranges_1): Likewise.
* lra-remat.c (create_remat_bb_data): Likewise.
* lra.c (lra_update_insn_recog_data, restore_scratches): Likewise.
(lra): Likewise.
(check_rtl): Always define. Remove incorrect guard around
extract_constrain_insn call.
* lto-cgraph.c (input_cgraph_1: Use flag_checking,
CHECKING_P gcc_checking_assert and checking_* functions to eliminate
ENABLE_CHECKING conditionals.
* lto-streamer-out.c (DFS::DFS): Likewise.
(lto_output): Likewise.
* lto-streamer.c (lto_streamer_init): Likewise.
* omp-low.c (scan_omp_target, expand_omp_taskreg): Likewise.
expand_omp_target, execute_expand_omp): Likewise.
(lower_omp_target): Likewise.
* passes.c (execute_function_todo): Likewise.
(execute_todo, execute_one_pass): Likewise.
(verify_curr_properties): Always define.
* predict.c (tree_estimate_probability: Use flag_checking,
CHECKING_P gcc_checking_assert and checking_* functions to eliminate
ENABLE_CHECKING conditionals.
(propagate_freq): Likewise.
* pretty-print.c (pp_format): Likewise.
* real.c (real_to_decimal_for_mode): Likewise.
* recog.c (split_all_insns): Likewise.
* regcprop.c (kill_value_one_regno): Likewise.
(copy_value): Likewise.
(validate_value_data): Define unconditionally.
* reload.c: Fix comment.
* timevar.c: Include options.h
* tree-ssa.h (checking_verify_ssa): Define.
* tree-ssa-loop-manip.h (checking_verify_loop_closed_ssa): Define.
* sched-deps.c (CHECK): Remove unused macro.
(add_or_update_dep_1, sd_add_dep: Use flag_checking, CHECKING_P
gcc_checking_assert and checking_* functions to eliminate
ENABLE_CHECKING conditionals.
* sel-sched-ir.c (free_regset_pool, tidy_control_flow): Likewise.
* sel-sched.c (struct moveop_static_params): Likewise.
(find_best_reg_for_expr, move_cond_jump): Likewise.
(move_op_orig_expr_not_found): Likewise.
(code_motion_process_successors, move_op): Likewise.
* ssa-iterators.h (first_readonly_imm_use): Likewise.
(next_readonly_imm_use): Likewise.
* store-motion.c (compute_store_table): Likewise.
* symbol-summary.h (function_summary::function_summary): Likewise.
* target.h (cumulative_args_t): Likewise.
(get_cumulative_args, pack_cumulative_args): Likewise.
* timevar.c: (timer::print): Likewise.
* trans-mem.c (ipa_tm_execute): Likewise.
* tree-cfg.c (move_stmt_op): Likewise.
(move_sese_region_to_fn): Likewise.
(gimple_flow_call_edges_add): Likewise.
* tree-cfgcleanup.c (cleanup_tree_cfg_noloop, repair_loop_structures):
Likewise.
* tree-eh.c (remove_unreachable_handlers): Likewise.
* tree-if-conv.c (pass_if_conversion::execute): Likewise.
* tree-inline.c (expand_call_inline, optimize_inline_calls): Likewise.
* tree-into-ssa.c (update_ssa): Likewise.
* tree-loop-distribution.c (pass_loop_distribution::execute): Likewise.
* tree-outof-ssa.c (eliminate_useless_phis, rewrite_trees): Likewise.
* tree-parloops.c (pass_parallelize_loops::execute): Likewise.
* tree-predcom.c (suitable_component_p): Likewise.
* tree-profile.c (gimple_gen_const_delta_profiler): Likewise.
* tree-ssa-alias.c (refs_may_alias_p_1): Likewise.
* tree-ssa-live.c (verify_live_on_entry): Likewise.
* tree-ssa-live.h (register_ssa_partition): Likewise.
* tree-ssa-loop-ivcanon.c (tree_unroll_loops_completely): Likewise.
* tree-ssa-loop-manip.c (add_exit_phi): Likewise.
(tree_transform_and_unroll_loop): Likewise.
* tree-ssa-math-opts.c (pass_cse_reciprocals::execute): Likewise.
* tree-ssa-operands.c (get_expr_operands): Likewise.
* tree-ssa-propagate.c (replace_exp_1): Likewise.
* tree-ssa-structalias.c (rewrite_constraints): Likewise.
* tree-ssa-ter.c (free_temp_expr_table): Likewise.
* tree-ssa-threadupdate.c (duplicate_thread_path): Likewise.
* tree-ssanames.c (release_ssa_name_fn): Likewise.
* tree-stdarg.c (expand_ifn_va_arg): Likewise.
* tree-vect-loop-manip.c
(slpeel_tree_duplicate_loop_to_edge_cfg): Likewise.
(slpeel_checking_verify_cfg_after_peeling): Likewise.
(vect_do_peeling_for_loop_bound): Likewise.
(vect_do_peeling_for_alignment): Likewise.
* tree-vrp.c (supports_overflow_infinity): Likewise.
(set_value_range): Likewise.
* tree.c (free_lang_data_in_cgraph): Likewise.
* value-prof.c (gimple_remove_histogram_value): Likewise.
(free_hist): Likewise.
* var-tracking.c (canonicalize_values_star): Likewise.
(compute_bb_dataflow, vt_find_locations, vt_emit_notes): Likewise.

From-SVN: r229470

9 years agoDaily bump.
GCC Administrator [Wed, 28 Oct 2015 00:16:15 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r229469

9 years agointernal-fn.def (IFN_GOACC_DIM_SIZE, [...]): New.
Nathan Sidwell [Tue, 27 Oct 2015 23:46:39 +0000 (23:46 +0000)]
internal-fn.def (IFN_GOACC_DIM_SIZE, [...]): New.

* internal-fn.def (IFN_GOACC_DIM_SIZE, IFN_GOACC_DIM_POS,
IFN_GOACC_LOOP): New.
* internal-fn.h (enum ifn_unique_kind): Add IFN_UNIQUE_OACC_FORK,
IFN_UNIQUE_OACC_JOIN, IFN_UNIQUE_OACC_HEAD_MARK,
IFN_UNIQUE_OACC_TAIL_MARK.
(enum ifn_goacc_loop_kind): New.
* internal-fn.c (expand_UNIQUE): Add IFN_UNIQUE_OACC_FORK,
IFN_UNIQUE_OACC_JOIN cases.
(expand_GOACC_DIM_SIZE, expand_GOACC_DIM_POS): New.
(expand_GOACC_LOOP): New.
* target-insns.def (oacc_dim_pos, oacc_dim_size): New.
* omp-low.c: Include gimple-pretty-print.h.
(struct oacc_loop): New.
(enum oacc_loop_flags): New.
(oacc_thread_numbers): New.
(oacc_xform_loop): New.
(new_oacc_loop_raw, new_oacc_loop_outer, new_oacc_loop,
new_oacc_loop_routine, finish_oacc_loop, free_oacc_loop): New,
(dump_oacc_loop_part, dump_oacc_loop, debug_oacc_loop): New,
(oacc_loop_discover_walk, oacc_loop_sibling_nrevers,
oacc_loop_discovery): New.
(oacc_loop_xform_head_tail, oacc_loop_xform_loop,
oacc_loop_process): New.
(oacc_loop_fixed_partitions, oacc_loop_partition): New.
(execute_oacc_device_lower): Discover & process loops.  Process
internal fns.
* target.def (goacc.fork_join): Change sense of hook, clarify
documentation.
* doc/tm.texi: Regenerated.

From-SVN: r229466

9 years agotarget-insns.def (oacc_fork, oacc_join): Define.
Nathan Sidwell [Tue, 27 Oct 2015 22:16:19 +0000 (22:16 +0000)]
target-insns.def (oacc_fork, oacc_join): Define.

* target-insns.def (oacc_fork, oacc_join): Define.
* target.def (goacc.validate_dims): Adjust doc to avoid warning.
(goacc.fork_join): New GOACC hook.
* targhooks.h (default_goacc_fork_join): Declare.
* omp-low.c (default_goacc_forkjoin): New.
* doc/tm.texi.in (TARGET_GOACC_FORK_JOIN): Add.
* doc/tm.texi: Regenerate.

From-SVN: r229465

9 years agoomp-low.c (oacc_init_rediction_array): New.
Nathan Sidwell [Tue, 27 Oct 2015 22:12:19 +0000 (22:12 +0000)]
omp-low.c (oacc_init_rediction_array): New.

* omp-low.c (oacc_init_rediction_array): New.
(oacc_initialize_reduction_data): Initialize array.

From-SVN: r229464

9 years ago* omp-low.c (pass_oacc_device_lower::execute): Ignore errors.
Nathan Sidwell [Tue, 27 Oct 2015 20:22:50 +0000 (20:22 +0000)]
* omp-low.c (pass_oacc_device_lower::execute): Ignore errors.

From-SVN: r229462

9 years agoc-parser.c (c_parser_oacc_shape_clause): New.
Cesar Philippidis [Tue, 27 Oct 2015 20:21:31 +0000 (13:21 -0700)]
c-parser.c (c_parser_oacc_shape_clause): New.

gcc/c/
* c-parser.c (c_parser_oacc_shape_clause): New.
(c_parser_oacc_simple_clause): New.
(c_parser_oacc_all_clauses): Add auto, gang, seq, vector, worker.
(OACC_LOOP_CLAUSE_MASK): Add gang, worker, vector, auto, seq.

gcc/testsuite/
* c-c++-common/goacc/loop-shape.c: New test.

Co-Authored-By: Bernd Schmidt <bernds@redhat.com>
Co-Authored-By: James Norris <jnorris@codesourcery.com>
Co-Authored-By: Joseph Myers <joseph@codesourcery.com>
Co-Authored-By: Julian Brown <julian@codesourcery.com>
Co-Authored-By: Thomas Schwinge <thomas@codesourcery.com>
From-SVN: r229461

9 years agoparser.c (cp_parser_omp_clause_name): Add auto, gang, seq, vector, worker.
Nathan Sidwell [Tue, 27 Oct 2015 20:19:24 +0000 (20:19 +0000)]
parser.c (cp_parser_omp_clause_name): Add auto, gang, seq, vector, worker.

gcc/cp/
* parser.c (cp_parser_omp_clause_name): Add auto, gang, seq,
vector, worker.
(cp_parser_oacc_simple_clause): New.
(cp_parser_oacc_shape_clause): New.
(cp_parser_oacc_all_clauses): Add auto, gang, seq, vector, worker.
(OACC_LOOP_CLAUSE_MASK): Likewise.
* semantics.c (finish_omp_clauses): Add auto, gang, seq, vector,
worker. Unify the handling of teams, tasks and vector_length with
the other loop shape clauses.

gcc/testsuite/
* g++.dg/g++.dg/gomp/pr33372-1.C: Adjust diagnostic.
* gcc/testsuite/g++.dg/gomp/pr33372-3.C: Likewise.

From-SVN: r229460

9 years agointernal-fn.c (expand_UNIQUE): New.
Nathan Sidwell [Tue, 27 Oct 2015 20:16:04 +0000 (20:16 +0000)]
internal-fn.c (expand_UNIQUE): New.

* internal-fn.c (expand_UNIQUE): New.
* internal-fn.h (enum ifn_unique_kind): New.
* internal-fn.def (IFN_UNIQUE): New.
* target-insns.def (unique): Define.
* gimple.h (gimple_call_internal_unique_p): New.
* gimple.c (gimple_call_same_target_p): Check internal fn
uniqueness.
* tracer.c (ignore_bb_p): Check for IFN_UNIQUE call.
* tree-ssa-threadedge.c
(record_temporary_equivalences_from_stmts): Likewise.
* tree-cfg.c (gmple_call_initialize_ctrl_altering): Likewise.

From-SVN: r229459

9 years agore PR rtl-optimization/67609 (Generates wrong code for SSE2 _mm_load_pd)
Richard Henderson [Tue, 27 Oct 2015 19:59:41 +0000 (12:59 -0700)]
re PR rtl-optimization/67609 (Generates wrong code for SSE2 _mm_load_pd)

PR rtl-opt/67609

* config/i386/i386.c (ix86_cannot_change_mode_class): Disallow
narrowing subregs on SSE and MMX registers.
* doc/tm.texi.in (CANNOT_CHANGE_MODE_CLASS): Clarify when subregs that
appear to be sub-words of multi-register pseudos must be rejected.
* doc/tm.texi: Regenerate.
testsuite/
* gcc.target/i386/pr67609-2.c: New test.

From-SVN: r229458

9 years ago[AArch64] PR 68102: Check that operand is REG before checking the REGNO in mov-immedi...
Kyrylo Tkachov [Tue, 27 Oct 2015 18:32:37 +0000 (18:32 +0000)]
[AArch64] PR 68102: Check that operand is REG before checking the REGNO in mov-immediate splitters

PR target/68102
* config/aarch64/aarch64.md (*movsi_aarch64): Check that
operands[0] is a reg before taking its REGNO in split condition.
(*movdi_aarch64): Likewise.

* gcc.target/aarch64/pr68102_1.c: New test.

From-SVN: r229455

9 years ago[AArch64] Handle vector float modes properly in aarch64_output_simd_mov_immediate
Kyrylo Tkachov [Tue, 27 Oct 2015 18:30:55 +0000 (18:30 +0000)]
[AArch64] Handle vector float modes properly in aarch64_output_simd_mov_immediate

* config/aarch64/aarch64.c (aarch64_output_simd_mov_immediate):
Handle floating point inner modes properly.

From-SVN: r229454

9 years agore PR fortran/67933 (ICE for array of a derived type with allocatable class in derive...
Paul Thomas [Tue, 27 Oct 2015 18:03:18 +0000 (18:03 +0000)]
re PR fortran/67933 (ICE for array of a derived type with allocatable class in derived type object)

2015-01-27  Paul Thomas  <pault@gcc.gnu.org>

PR fortran/67933
* gfortran.dg/allocate_with_source_15.f03: New test

From-SVN: r229452

9 years ago[PR fortran/63865] OpenACC cache directive: match Fortran support with C/C++
Thomas Schwinge [Tue, 27 Oct 2015 16:54:52 +0000 (17:54 +0100)]
[PR fortran/63865] OpenACC cache directive: match Fortran support with C/C++

gcc/fortran/
PR fortran/63865
* openmp.c (resolve_oacc_cache): Remove function.
(gfc_match_oacc_cache): Enable array sections.
(resolve_omp_clauses, gfc_resolve_oacc_directive): Change
accordingly.
* trans-openmp.c (gfc_trans_omp_clauses): Likewise.
gcc/testsuite/
PR fortran/63865
* gfortran.dg/goacc/coarray.f95: Expect the OpenACC cache
directive to work.
* gfortran.dg/goacc/loop-1.f95: Likewise.
* gfortran.dg/goacc/cache-1.f95: Likewise, and extend testing.
* gfortran.dg/goacc/cray.f95: Likewise.
* gfortran.dg/goacc/parameter.f95: Likewise.

Co-Authored-By: James Norris <jnorris@codesourcery.com>
From-SVN: r229448

9 years ago2015-10-27 Alan Hayward <alan.hayward@arm.com>
Alan Hayward [Tue, 27 Oct 2015 16:43:13 +0000 (16:43 +0000)]
2015-10-27  Alan Hayward  <alan.hayward@arm.com>

* tree-vect-looop.c
(vectorizable_live_operation): Change iterator.

From-SVN: r229447

9 years agore PR fortran/68108 (erroneous error message 'scalar integer expression expected')
Steven G. Kargl [Tue, 27 Oct 2015 16:42:24 +0000 (16:42 +0000)]
re PR fortran/68108 (erroneous error message 'scalar integer expression expected')

2015-10-27  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/68108
* decl.c (char_len_param_value): Check for REF_ARRAY.

2015-10-27  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/68108
* gfortran.dg/pr67805_2.f90: New test.

From-SVN: r229446

9 years agoisl schedule tree
Abderrazek Zaafrani [Tue, 27 Oct 2015 15:58:05 +0000 (15:58 +0000)]
isl schedule tree

Use isl_schedule_node instead of isl_band_list for isl-0.15.
Passes regtest and bootstrap for isl-0.15 and isl-0.12.2 on x86_64-linux.

gcc/ChangeLog:

        * graphite-optimize-isl.c (get_schedule_for_node_st): New callback
          function to schedule based on isl_schedule_node.
        (get_schedule_map_st): New schedule optimizer based on isl_schedule_node.
        (scop_get_domains): New. Return the isl_union_set containing the domains of all the pbbs.
        (optimize_isl): Call the new function get_schedule_map_st for isl-0.15

gcc/testsuite/ChangeLog:

        * gcc.dg/graphite/block-0.c: Changed to match pattern.
        * gcc.dg/graphite/interchange-1.c: Same.
        * gcc.dg/graphite/interchange-10.c: Same.
        * gcc.dg/graphite/interchange-11.c: Same.
        * gcc.dg/graphite/interchange-13.c: Same.
        * gcc.dg/graphite/interchange-3.c: Same.
        * gcc.dg/graphite/interchange-4.c: Same.
        * gcc.dg/graphite/interchange-7.c: Same.
        * gcc.dg/graphite/interchange-9.c: Same.
        * gcc.dg/graphite/uns-interchange-9.c: Same.
        * gfortran.dg/graphite/interchange-3.f90: Same.

Co-Authored-By: Aditya Kumar <aditya.k7@samsung.com>
From-SVN: r229445

9 years agoProperly handle -fno-plt in ix86_expand_call
H.J. Lu [Tue, 27 Oct 2015 14:29:31 +0000 (14:29 +0000)]
Properly handle -fno-plt in ix86_expand_call

prepare_call_address in calls.c is the wrong place to handle -fno-plt.
We shoudn't force function address into register and hope that load
function address via GOT and indirect call via register will be folded
into indirect call via GOT, which doesn't always happen.  Also non-PIC
case can only be handled in backend.  Instead, backend should expand
external function call into indirect call via GOT for -fno-plt.

This patch reverts -fno-plt in prepare_call_address and handles it in
ix86_expand_call.  Other backends may need similar changes to support
-fno-plt.  Alternately, we can introduce a target hook to indicate
whether an external function should be called via register for -fno-plt
so that i386 backend can disable it in prepare_call_address.

gcc/

PR target/67215
* calls.c (prepare_call_address): Don't handle -fno-plt here.
* config/i386/i386.c (ix86_expand_call): Generate indirect call
via GOT for -fno-plt.  Support indirect call via GOT for x32.
* config/i386/predicates.md (sibcall_memory_operand): Allow
GOT memory operand.

gcc/testsuite/

PR target/67215
* gcc.target/i386/pr67215-1.c: New test.
* gcc.target/i386/pr67215-2.c: Likewise.
* gcc.target/i386/pr67215-3.c: Likewise.

From-SVN: r229444

9 years agore PR tree-optimization/68104 (ice in vect_update_misalignment_for_peel with -O3)
Richard Biener [Tue, 27 Oct 2015 13:48:15 +0000 (13:48 +0000)]
re PR tree-optimization/68104 (ice in vect_update_misalignment_for_peel with -O3)

2015-10-27  Richard Biener  <rguenther@suse.de>

PR tree-optimization/68104
* tree-vect-data-refs.c (vect_compute_data_ref_alignment): Move
strided access check ...
(vect_compute_data_refs_alignment): ... here.

* gcc.dg/torture/pr68104.c: New testcase.

From-SVN: r229440

9 years agoconfig.gcc: Handle --enable-fdpic.
Daniel Jacobowitz [Tue, 27 Oct 2015 13:36:47 +0000 (13:36 +0000)]
config.gcc: Handle --enable-fdpic.

gcc/ChangeLog
* config.gcc: Handle --enable-fdpic.
* config/sh/constraints.md (Ccl): New constraint.
* config/sh/linux.h (SUBTARGET_LINK_EMUL_SUFFIX): Handle -mfdpic.
* config/sh/sh-c.c (sh_cpu_cpp_builtins): Add __FDPIC__ and
__SH_FDPIC__.
* config/sh/sh-mem.cc (expand_block_move): Support FDPIC for calls to
library functions.
* config/sh/sh-protos.h (function_symbol_result): New struct.
(function_symbol): Return function_symbol_result.
(sh_get_fdpic_reg_initial_val, sh_load_function_descriptor): New
declarations.
* config/sh/sh.c (TARGET_ASM_INTEGER, sh_assemble_integer): Implement
target hook.
(TARGET_CANNOT_FORCE_CONST_MEM, sh_cannot_force_const_mem_p): Likewise.
(sh_option_override): Force -fPIC if FDPIC is in effect.
(sh_asm_output_addr_const_extra): Add UNSPEC_GOTFUNCDESC and
UNSPEC_GOTOFFFUNCDESC cases.
(prepare_move_operands): Use FDPIC initial GOT register for
TLS-related GOT access; inhibit cross-section address offset constants
for FDPIC.
(sh_assemble_integer): New function.
(sh_cannot_copy_insn_p): Inhibit copying insns that are FDPIC
PC-relative call sites.
(expand_ashiftrt): Adapt invocation of function_symbol.
(sh_expand_prologue): Inhibit PC-relative GOT address load for FDPIC.
(nonpic_symbol_mentioned_p): Add cases for UNSPEC_GOTFUNCDESC and
UNSPEC_GOTOFFFUNCDESC.
(legitimize_pic_address): Resolve function symbols to function
descriptors for FDPIC.  Do not use GOT-relative addressing for local
data that may be read-only on FDPIC.
(sh_emit_storesi, sh_emit_storehi): New functions.
(sh_trampoline_init): Generate FDPIC trampolines.
(sh_function_ok_for_sibcall): Add TARGET_FDPIC check.
(sh_expand_sym_label2reg): Don't assume sibcalls are local.
(sh_output_mi_thunk): Generate FDPIC call.
(function_symbol): Return function_symbol_result.  For SFUNC_STATIC on
FDPIC, generate call site labels to use PC-relative addressing rather
than GOT-relative addressing.
(sh_conditional_register_usage): Make PIC register fixed and call used
when FDPIC is in effect.
(sh_legitimate_constant_p): Impose FDPIC constant constraints.
(sh_cannot_force_const_mem_p, sh_load_function_descriptor,
sh_get_fdpic_reg_initial_val): New functions.
* config/sh/sh.h (SUBTARGET_ASM_SPEC, SUBTARGET_LINK_EMUL_SUFFIX):
Handle -mfdpic.
(FDPIC_SELF_SPECS, SUBTARGET_DRIVER_SELF_SPECS,
PIC_OFFSET_TABLE_REG_CALL_CLOBBERED,
SH_OFFSETS_MUST_BE_WITHIN_SECTIONS_P): New macros.
(DRIVER_SELF_SPECS): Add SUBTARGET_DRIVER_SELF_SPECS and
FDPIC_SELF_SPECS.
(TRAMPOLINE_SIZE): Select trampoline size for FDPIC.
(ASM_PREFERRED_EH_DATA_FORMAT): Add EH format constraints for FDPIC.
(ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): Handle FDPIC case.
* config/sh/sh.md (UNSPEC_GOTFUNCDESC, UNSPEC_GOTOFFFUNCDESC): New
constants.
(calli_fdpic, call_valuei_fdpic, sibcalli_fdpic, sibcalli_pcrel_fdpic,
sibcall_pcrel_fdpic, sibcall_valuei_fdpic, sibcall_valuei_pcrel_fdpic,
sibcall_value_pcrel_fdpic, sym2GOTFUNCDESC, symGOTFUNCDESC2reg,
sym2GOTOFFFUNCDESC, symGOTOFFFUNCDESC2reg): New patterns.
(udivsi3_i1, udivsi3_i4, udivsi3_i4_single, udivsi3,
*divsi_inv_call_combine, divsi3_i4, divsi3_i4_single, divsi3, ashlsi3,
ashlsi3_d_call, ashrsi3_n, lshrsi3, lshrsi3_d_call, calli, call_valuei,
call, call_value, sibcalli, sibcalli_pcrel, sibcall_pcrel, sibcall,
sibcall_valuei, sibcall_valuei_pcrel, sibcall_value_pcrel,
sibcall_value, GOTaddr2picreg, symGOT_load, symGOTOFF2reg,
block_move_real, block_lump_real, block_move_real_i4,
block_lump_real_i4): Add support for FDPIC calls.
(mulsi3, ic_invalidate_line, initialize_trampoline, call_pop,
call_value_pop): Adjust for new function_symbol signature.
* config/sh/sh.opt (-mfdpic): New option.
* doc/install.texi (Options specification): Document --enable-fdpic.
* doc/invoke.texi (SH Options): Document -mfdpic.

include/ChangeLog:
* longlong.h (udiv_qrnnd): Add FDPIC compatible version for SH.

libitm/ChangeLog:
* config/sh/sjlj.S (_ITM_beginTransaction): Bypass PLT calling
GTM_begin_transaction for compatibility with FDPIC.

Co-Authored-By: Andrew Stubbs <ams@codesourcery.com>
Co-Authored-By: Joseph Myers <joseph@codesourcery.com>
Co-Authored-By: Mark Shinwell <shinwell@codesourcery.com>
Co-Authored-By: Rich Felker <dalias@libc.org>
From-SVN: r229438

9 years agotree-scalar-evolution.c: Handle LSHIFT by constant
Alan Lawrence [Tue, 27 Oct 2015 12:36:55 +0000 (12:36 +0000)]
tree-scalar-evolution.c: Handle LSHIFT by constant

gcc/:

tree-scalar-evolution.c (interpret_rhs_expr): Handle some LSHIFT_EXPRs
as equivalent MULT_EXPRs.

gcc/testsuite/:

gcc.dg/vect/vect-strided-shift.c: New.

From-SVN: r229437

9 years ago[ARM] PR target/67929 Tighten vfp3_const_double_for_bits checks
Kyrylo Tkachov [Tue, 27 Oct 2015 12:23:51 +0000 (12:23 +0000)]
[ARM] PR target/67929 Tighten vfp3_const_double_for_bits checks

PR target/67929
* config/arm/arm.c (vfp3_const_double_for_bits): Rewrite.
* config/arm/constraints.md (Dp): Update callsite.
* config/arm/predicates.md (const_double_vcvt_power_of_two): Likewise.

* gcc.target/arm/pr67929_1.c: New test.

From-SVN: r229436

9 years agoMove ldexp, scalbn and scalbln folds to match.pd
Richard Sandiford [Tue, 27 Oct 2015 12:00:34 +0000 (12:00 +0000)]
Move ldexp, scalbn and scalbln folds to match.pd

Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi.

gcc/
* builtins.c (fold_builtin_load_exponent): Rename to...
(fold_const_builtin_load_exponent): ...this and only handle
constant arguments.
(fold_builtin_2): Update accordingly.
* match.pd: Add rules previously handled by fold_builtin_load_exponent.

gcc/testsuite/
* gcc.dg/torture/builtin-ldexp-1.c: Skip at -O9,

From-SVN: r229434

9 years agoRename logb and significand folds
Richard Sandiford [Tue, 27 Oct 2015 11:59:21 +0000 (11:59 +0000)]
Rename logb and significand folds

fold_builtin_logb and fold_builtin_significand now only handle
constant arguments, so this patch renames them to fold_const...,
to match fold_const_builtin_pow.  The idea is to differentiate
constant-only folds so that they can be moved to a const_binop-like
function in future.

The functions also had some unnecessary calls to STRIP_NOPS, which
I think are left over from code that has already moved to match.pd.

Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi.

gcc/
* builtins.c (fold_builtin_logb): Rename to...
(fold_const_builtin_logb): ...this and remove STRIP_NOPS call.
(fold_builtin_significand): Rename to...
(fold_const_builtin_significand): ...this and remove STRIP_NOPS call.
(fold_builtin_1): Update accordingly.

From-SVN: r229433

9 years agoMove fmin and fmax folds to match.pd
Richard Sandiford [Tue, 27 Oct 2015 11:57:34 +0000 (11:57 +0000)]
Move fmin and fmax folds to match.pd

Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi.

gcc/
* builtins.c (fold_builtin_fmin_fmax): Delete.
(fold_builtin_2): Handle constant fmin and fmax arguments here.
* match.pd: Add rules previously handled by fold_builtin_fmin_fmax.

From-SVN: r229432

9 years ago[PATCH] [AArch64] Distinct costs for sign and zero extension
Evandro Menezes [Tue, 27 Oct 2015 11:57:01 +0000 (11:57 +0000)]
[PATCH] [AArch64] Distinct costs for sign and zero extension

gcc/

* config/aarch64/aarch64-protos.h (cpu_addrcost_table): Split member
for register extension into sign and zero register extension.
* config/aarch64/aarch64.c (generic_addrcost_table): Infer values
for sign and zero register extension.
(cortexa57_addrcost_table): Likewise.
(xgene1_addrcost_table): Likewise.

From-SVN: r229431

9 years agoMove min(max...) and max(min...) folds to match.pd
Richard Sandiford [Tue, 27 Oct 2015 11:56:18 +0000 (11:56 +0000)]
Move min(max...) and max(min...) folds to match.pd

This handles both integer and floating-point arguments.  It's needed
for the follow-on patch to move fmin and fmax to match.pd.

Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi.

gcc/
* fold-const.c (fold_minmax): Delete.
(fold_binary_loc): Don't call it.
* match.pd: Add rules previously handled by fold_minmax.

From-SVN: r229430

9 years ago[multiple changes]
Arnaud Charlet [Tue, 27 Oct 2015 11:56:12 +0000 (12:56 +0100)]
[multiple changes]

2015-10-27  Tristan Gingold  <gingold@adacore.com>

* bindgen.adb (System_BB_CPU_Primitives_Multiprocessors_Used):
New variable.
(Gen_Adainit): Call Start_All_CPUs if the above
variable is set to true.

2015-10-27  Emmanuel Briot  <briot@adacore.com>

* adaint.c, s-os_lib.adb, s-os_lib.ads (Copy_File_Attributes): New
subprogram.

From-SVN: r229429

9 years agoSplit constant handling out of fold_builtin_fma
Richard Sandiford [Tue, 27 Oct 2015 11:55:38 +0000 (11:55 +0000)]
Split constant handling out of fold_builtin_fma

Just makes an upcoming patch a bit clearer.

Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi.

gcc/
* builtins.c (fold_builtin_fma): Remove constant handling.
(fold_builtin_3): Handle constant fma arguments here.

From-SVN: r229428

9 years agoRemove constant handling from fold_builtin_{,f}abs
Richard Sandiford [Tue, 27 Oct 2015 11:54:51 +0000 (11:54 +0000)]
Remove constant handling from fold_builtin_{,f}abs

fold_builtin_fabs and fold_builtin_abs had code to handle constant
arguments, but this simply duplicated what the following fold_build1_loc
would do for ABS_EXPR.

Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi.

gcc/
* builtins.c (fold_builtin_fabs): Remove constant handling.
(fold_builtin_abs): Likewise.

From-SVN: r229427

9 years agonamet.adb, namet.ads: Minor reformatting.
Hristian Kirtchev [Tue, 27 Oct 2015 11:54:29 +0000 (11:54 +0000)]
namet.adb, namet.ads: Minor reformatting.

2015-10-27  Hristian Kirtchev  <kirtchev@adacore.com>

* namet.adb, namet.ads: Minor reformatting.

From-SVN: r229426

9 years agoMove copysign folds to match.pd
Richard Sandiford [Tue, 27 Oct 2015 11:53:45 +0000 (11:53 +0000)]
Move copysign folds to match.pd

Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi.

gcc/
* builtins.c (fold_builtin_copysign): Delete.
(fold_builtin_2): Handle constant copysign arguments here.
* match.pd: Add rules previously handled by fold_builtin_copysign.

From-SVN: r229425

9 years ago[multiple changes]
Arnaud Charlet [Tue, 27 Oct 2015 11:53:08 +0000 (12:53 +0100)]
[multiple changes]

2015-10-27  Ed Schonberg  <schonberg@adacore.com>

* sem_ch4.adb (Analyze_Allocator): Do not perform legality check
on allocators for limited objects in a qualified expression,
because expression has not been resolved.
* sem_res.adb (Resolve_Allocator): Perform check on legality of
limited objects after resolution.  Add sem_ch3.adb to context.

2015-10-27  Hristian Kirtchev  <kirtchev@adacore.com>

* sem_prag.adb (Analyze_Refined_Global_In_Decl_Part): Add variable
States.
(Check_Refined_Global_Item): An object or state acts as a
constituent only when the corresponding encapsulating state
appears in pragma Global.
(Collect_Global_Item): Add a state with non-null visible refinement to
list States.

2015-10-27  Gary Dismukes  <dismukes@adacore.com>

* sem_util.ads, par.adb, sem_ch6.adb: Minor reformatting and a few
typo corrections.

2015-10-27  Pierre-Marie de Rodat  <derodat@adacore.com>

* namet.ads, namet.adb (Name_Equals): New function.
* namet.h (Name_Equals): New macro.

2015-10-27  Arnaud Charlet  <charlet@adacore.com>

* exp_ch6.adb (Build_Procedure_Form): Use 'RESULT' for the extra
parameter, to avoid ambiguity when generating tmps using _xxx which
might end up reusing _result.

From-SVN: r229424

9 years agoMove signbit folds to match.pd
Richard Sandiford [Tue, 27 Oct 2015 11:52:54 +0000 (11:52 +0000)]
Move signbit folds to match.pd

Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi.

gcc/
* builtins.c (fold_builtin_signbit): Delete.
(fold_builtin_2): Handle constant signbit arguments here.
* match.pd: Add rules previously handled by fold_builtin_signbit.

gcc/testsuite/
PR tree-optimization/68097
* gcc.dg/torture/builtin-nonneg-1.c: Skip at -O0.  Add
--param max-ssa-name-query-depth=3 to dg-options.

From-SVN: r229423

9 years agoFold comparisons between sqrt and zero
Richard Sandiford [Tue, 27 Oct 2015 11:51:43 +0000 (11:51 +0000)]
Fold comparisons between sqrt and zero

The expression:

      signbit(sqrt(x))

is always 0 for -ffast-math.  The signbit fold first converts it to:

      sqrt(x) < 0

and whether we realise that this is false depends on a race between two
folders: the sqrt comparison folder, which wants to convert it to

      x < 0*0

and the generic tree_expr_nonnegative_p rule for ... < 0, which would
give the hoped-for 0.

The sqrt code already handles comparisons with negative values specially,
so this patch simply extends that idea to comparisons with zero.

Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi.

gcc/
* match.pd: Handle sqrt(x) cmp 0 specially.

gcc/testsuite/
* gcc.dg/torture/builtin-sqrt-cmp-1.c: New test.

From-SVN: r229422

9 years ago[multiple changes]
Arnaud Charlet [Tue, 27 Oct 2015 11:50:29 +0000 (12:50 +0100)]
[multiple changes]

2015-10-27  Javier Miranda  <miranda@adacore.com>

* sem_util.ads, sem_util.adb (Defining_Identifier): Adding a formal to
indicate the needed behavior in case of nodes with errors.

2015-10-27  Ed Schonberg  <schonberg@adacore.com>

* sem_attr.adb (Eval_Attribute): If the prefix of attribute
Enum_Rep is an object that is a generated loop variable for an
element iterator, no folding is possible.
* sem_res.adb (Resolve_Entity_Name): Do not check for a missing
initialization in the case of a constant that is an object
renaming.
* exp_attr.adb (Expand_N_Attribute_Reference, case Enum_Rep):
If the prefix is a constant that renames an expression there is
nothing to evaluate statically.

2015-10-27  Vincent Celier  <celier@adacore.com>

* gnatlink.adb: Always delete the response file, even when the
invocation of gcc to link failed.

2015-10-27  Hristian Kirtchev  <kirtchev@adacore.com>

* sem_ch6.adb (Analyze_Subprogram_Body_Helper):
Do not inherit the SPARK_Mode from the context if it has been
set already.
(Build_Subprogram_Declaration): Relocate relevant
pragmas from the subprogram body to the generated corresponding
spec. Do not copy aspect SPARK_Mode as this leads to circularity
in Copy_Separate_Tree. Inherit the attributes that describe
pragmas Ghost and SPARK_Mode.
(Move_Pragmas): New routine.

From-SVN: r229421

9 years agoinline.adb (Is_Expression_Function): Removed.
Hristian Kirtchev [Tue, 27 Oct 2015 11:46:38 +0000 (11:46 +0000)]
inline.adb (Is_Expression_Function): Removed.

2015-10-27  Hristian Kirtchev  <kirtchev@adacore.com>

* inline.adb (Is_Expression_Function): Removed.
* sem_ch6.adb (Analyze_Subprogram_Body_Helper): An internally
generated subprogram body that completes an expression function
inherits the SPARK_Mode from the spec.
* sem_res.adb (Resolve_Call): Update all calls to
Is_Expression_Function.
* sem_util.ads, sem_util.adb (Is_Expression_Function): Reimplemented.
(Is_Expression_Function_Or_Completion): New routine.

From-SVN: r229420

9 years agolib-xref-spark_specific.adb, [...]: Minor reformatting.
Hristian Kirtchev [Tue, 27 Oct 2015 11:23:07 +0000 (11:23 +0000)]
lib-xref-spark_specific.adb, [...]: Minor reformatting.

2015-10-27  Hristian Kirtchev  <kirtchev@adacore.com>

* lib-xref-spark_specific.adb, a-dirval-mingw.adb, exp_ch6.adb,
sem_ch8.adb, s-os_lib.adb: Minor reformatting.

From-SVN: r229419

9 years ago[multiple changes]
Arnaud Charlet [Tue, 27 Oct 2015 11:21:23 +0000 (12:21 +0100)]
[multiple changes]

2015-10-27  Yannick Moy  <moy@adacore.com>

* lib-xref-spark_specific.adb
(Enclosing_Subprogram_Or_Library_Package): detect library-level
subprograms and handle entries as subprograms, i.e. now both
library-level subprograms and entry bodies act as enclosing
scopes.
(Traverse_Declarations_Or_Statements): process entry bodies just
like subprogram bodies.
* lib-xref.ads (Enclosing_Subprogram_Or_Library_Package): comment
simplified while keeping its the meaning and minor typo fixed
("of" -> "or").
* spark_xrefs.ads (Xref Section): fix in description of the ALI
line for subprogram calls; such lines start with captial "F"
followed by a space.

2015-10-27  Ed Schonberg  <schonberg@adacore.com>

* sem_ch8.adb (Find_Direct_Name): A parameter association is
a legal context for applying an implicit dereference.
(Analyze_Expanded_Name): Minor code cleanup.

From-SVN: r229418

9 years agosinput.ads, [...]: Fix typos.
Arnaud Charlet [Tue, 27 Oct 2015 11:20:01 +0000 (11:20 +0000)]
sinput.ads, [...]: Fix typos.

2015-10-27  Arnaud Charlet  <charlet@adacore.com>

* sinput.ads, spark_xrefs.ads, lib-xref.adb: Fix typos.

From-SVN: r229417

9 years ago[multiple changes]
Arnaud Charlet [Tue, 27 Oct 2015 11:15:27 +0000 (12:15 +0100)]
[multiple changes]

2015-10-27  Pascal Obry  <obry@adacore.com>

* a-dirval-mingw.adb: Remove some characters from Invalid_Character set.

2015-10-27  Ed Schonberg  <schonberg@adacore.com>

* exp_ch6.adb (Rewrite_Function_Call_For_C): Use a named
associaion for the added actual in the call because previous
actuals may also have been given by explicit associations.
* lib-xref.adb: Minor style fixes.

From-SVN: r229416

9 years ago[multiple changes]
Arnaud Charlet [Tue, 27 Oct 2015 11:13:20 +0000 (12:13 +0100)]
[multiple changes]

2015-10-27  Arnaud Charlet  <charlet@adacore.com>

* gnat1drv.adb: Remove hard coded restrictions.

2015-10-27  Pascal Obry  <obry@adacore.com>

* a-dirval-mingw.adb: Minor reformatting.

From-SVN: r229415

9 years ago[multiple changes]
Arnaud Charlet [Tue, 27 Oct 2015 11:12:14 +0000 (12:12 +0100)]
[multiple changes]

2015-10-27  Javier Miranda  <miranda@adacore.com>

* sem_ch6.adb (Analyze_Subprogram_Body_Helper): Improve previous patch.

2015-10-27  Hristian Kirtchev  <kirtchev@adacore.com>

* sem_ch12.adb (Analyze_Formal_Package_Declaration): Code cleanup. Set
and restore the value of global flag Ignore_Pragma_SPARK_Mode. A
formal package declaration acts as a package instantation with
respect to SPARK_Mode legality.

2015-10-27  Hristian Kirtchev  <kirtchev@adacore.com>

* sem_prag.adb (Check_Constituent_Usage): Use
logical operators rather than short circuit operators. Emit an
error when a state with visible refinement is not refined.
* snames.ads-tmpl: Add names for detecting
predefined potentially blocking subprograms.

2015-10-27  Arnaud Charlet  <charlet@adacore.com>

* exp_aggr.adb (Aggr_Assignment_OK_For_Backend): Revert previous
change.
(Expand_Array_Aggregate): Rewrite previous change here
as done for other non GCC back-ends.
(Build_Record_Aggr_Code): Add special case.

From-SVN: r229414

9 years agotree-vect-generic.c (expand_vector_operations_1): Check optab type before using it.
Ilya Enkovich [Tue, 27 Oct 2015 11:08:16 +0000 (11:08 +0000)]
tree-vect-generic.c (expand_vector_operations_1): Check optab type before using it.

gcc/

* tree-vect-generic.c (expand_vector_operations_1): Check
optab type before using it.

From-SVN: r229413

9 years ago[AArch64] Enable autoprefetcher modelling in the scheduler
Kyrylo Tkachov [Tue, 27 Oct 2015 10:57:32 +0000 (10:57 +0000)]
[AArch64] Enable autoprefetcher modelling in the scheduler

* config/aarch64/aarch64-protos.h
(struct tune_params): Add autoprefetcher_model field.
* config/aarch64/aarch64.c: Include params.h
(generic_tunings): Specify autoprefetcher_model value.
(cortexa53_tunings): Likewise.
(cortexa57_tunings): Likewise.
(cortexa72_tunings): Likewise.
(thunderx_tunings): Likewise.
(xgene1_tunings): Likewise.
(aarch64_first_cycle_multipass_dfa_lookahead_guard): New function.
(TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD): Define.
(aarch64_override_options_internal): Set
PARAM_SCHED_AUTOPREF_QUEUE_DEPTH param.

From-SVN: r229412

9 years ago[PR testsuite/68063] Add missing private clause in libgomp.c++/member-1.C
Thomas Schwinge [Tue, 27 Oct 2015 10:32:32 +0000 (11:32 +0100)]
[PR testsuite/68063] Add missing private clause in libgomp.c++/member-1.C

PR testsuite/68063
* testsuite/libgomp.c++/member-1.C (A::m1): Add missing private clause.

From-SVN: r229411

9 years agoMove expN folds to match.pd
Richard Sandiford [Tue, 27 Oct 2015 09:32:11 +0000 (09:32 +0000)]
Move expN folds to match.pd

Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi.

gcc/
* builtins.c (fold_builtin_exponent): Delete.
(fold_builtin_2): Handle constant expN arguments here.
* match.pd: Fold expN(logN(x)) -> x.

From-SVN: r229410

9 years agoMove powi folds to match.pd
Richard Sandiford [Tue, 27 Oct 2015 09:31:28 +0000 (09:31 +0000)]
Move powi folds to match.pd

Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi.

gcc/
* builtins.c (fold_builtin_powi): Delete.
(fold_builtin_2): Handle constant powi arguments here.
* match.pd: Add rules previously handled by fold_builtin_powi.

gcc/testsuite/
* gcc.dg/builtins-52.c: Add -O to dg-options.

From-SVN: r229409

9 years agoMove pow folds to match.pd
Richard Sandiford [Tue, 27 Oct 2015 09:30:32 +0000 (09:30 +0000)]
Move pow folds to match.pd

Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi.

gcc/
* builtins.c (fold_builtin_pow): Delete in favor of...
(fold_const_builtin_pow): ...this new function.  Only handle constant
arguments.
(fold_builtin_2): Update accordingly.
* match.pd: Add rules previously handled by fold_builtin_pow.

gcc/testsuite/
* gcc.dg/torture/builtin-math-1.c: Skip at -O0.

From-SVN: r229408

9 years agoMove hypot folds to match.pd
Richard Sandiford [Tue, 27 Oct 2015 09:29:40 +0000 (09:29 +0000)]
Move hypot folds to match.pd

Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi.

gcc/
* builtins.c (fold_builtin_hypot): Delete.
(fold_builtin_2): Handle constant hypot arguments here.
* match.pd: Fold hypot(x, 0) and hypot(0, x) to x.  Canonicalize
hypot(x, x) to fabs(x)*sqrt(2).

From-SVN: r229407

9 years agoDon't create SSA names until in SSA form
Richard Sandiford [Tue, 27 Oct 2015 09:07:44 +0000 (09:07 +0000)]
Don't create SSA names until in SSA form

An upcoming patch adds a fold from hypot(x,x) to fabs(x)*sqrt(2).
This is unusual in that it could trigger in the gimplifier but would
require new SSA names to be created.  This patch makes sure that we
use the usual:

  if (gimple_in_ssa_p (cfun))
    res = make_ssa_name (type);
  else
    res = create_tmp_reg (type);

formula to cope with cases where we're not yet in SSA form.

Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi.

gcc/
* gimple-match-head.c (maybe_push_res_to_seq): Use create_tmp_reg
instead of make_ssa_name if not yet in SSA form.

From-SVN: r229406

9 years agocfg.c (free_edge): Add function argument and use it instead of cfun.
Richard Biener [Tue, 27 Oct 2015 08:56:03 +0000 (08:56 +0000)]
cfg.c (free_edge): Add function argument and use it instead of cfun.

2015-10-27  Richard Biener  <rguenther@suse.de>

* cfg.c (free_edge): Add function argument and use it instead of cfun.
(clear_edges): Likewise.
* cfg.h (clear_edges): Adjust prototype.
* cfgexpand.c (pass_expand::execute): Adjust.
* cfgloop.c (release_recorded_exits): Add function argument and use
it instead of cfun.
* cfgloop.h (release_recorded_exits): Adjust prototype.
(loops_state_satisfies_p): Add overload with function argument.
(loops_state_set): Likewise.
(loops_state_clear): Likewise.
(struct loop_iterator): Add function argument to constructor
and iterator and use it instead of cfun.
(FOR_EACH_LOOP_FN): New macro.
(loop_optimizer_finalize): Add overload with function argument.
* loop-init.c (loop_optimizer_init): Adjust.
(fix_loop_structure): Likewise.
(loop_optimizer_finaliz): Add function argument and use it
instead of cfun.
* tree-cfg.c (delete_tree_cfg_annotations): Likewise.
* tree-cfg.h (delete_tree_cfg_annotations): Adjust prototype.
* cgraph.c (release_function_body): Do not push/pop cfun.
* final.c (rest_of_clean_state): Adjust.
* graphite.c (graphite_finalize): Likewise.
* tree-ssa-copy.c (fini_copy_prop): Likewise.
* tree-ssa-dce.c (perform_tree_ssa_dce): Likewise.
* tree-ssa-loop-ivcanon.c (canonicalize_induction_variables): Likewise.
(tree_unroll_loops_completely): Likewise.
(pass_complete_unrolli::execute): Likewise.
* tree-ssa-loop-niter.c (free_numbers_of_iterations_estimates):
Add function argument and use it instead of cfun.
* tree-ssa-loop-niter.h (free_numbers_of_iterations_estimates):
Adjust prototype.
* tree-ssa-loop.c (tree_ssa_loop_done): Adjust.
* tree-ssa.c (delete_tree_ssa): Add function argument and use it
instead of cfun.
* tree-ssa.h (delete_tree_ssa): Adjust prototype.
* tree-ssanames.c (fini_ssanames): Add function argument and use it
instead of cfun.
* tree-ssanames.c (fini_ssanames): Adjust prototype.
* tree-vrp.c (execute_vrp): Adjust.
* value-prof.c (free_histograms): Add function argument and use it
instead of cfun.
* value-prof.h (free_histograms): Adjust prototype.

From-SVN: r229405

9 years ago[PR c/64765, c/64880] Support OpenACC Combined Directives in C, C++
Thomas Schwinge [Tue, 27 Oct 2015 08:39:15 +0000 (09:39 +0100)]
[PR c/64765, c/64880] Support OpenACC Combined Directives in C, C++

gcc/c-family/
PR c/64765
PR c/64880
* c-common.h (c_oacc_split_loop_clauses): Declare function.
* c-omp.c (c_oacc_split_loop_clauses): New function.
gcc/c/
PR c/64765
PR c/64880
* c-parser.c (c_parser_oacc_loop): Add mask, cclauses formal
parameters, and handle these.  Adjust all users.
(c_parser_oacc_kernels, c_parser_oacc_parallel): Merge functions
into...
(c_parser_oacc_kernels_parallel): ... this new function.  Adjust
all users.
* c-tree.h (c_finish_oacc_parallel, c_finish_oacc_kernels): Don't
declare functions.
(c_finish_omp_construct): Declare function.
* c-typeck.c (c_finish_oacc_parallel, c_finish_oacc_kernels):
Merge functions into...
(c_finish_omp_construct): ... this new function.
gcc/cp/
PR c/64765
PR c/64880
* cp-tree.h (finish_oacc_kernels, finish_oacc_parallel): Don't
declare functions.
(finish_omp_construct): Declare function.
* parser.c (cp_parser_oacc_loop): Add p_name, mask, cclauses
formal parameters, and handle these.  Adjust all users.
(cp_parser_oacc_kernels, cp_parser_oacc_parallel): Merge functions
into...
(cp_parser_oacc_kernels_parallel): ... this new function.  Adjust
all users.
* semantics.c (finish_oacc_kernels, finish_oacc_parallel): Merge functions into...
(finish_omp_construct): ... this new function.
gcc/
* tree.h (OACC_PARALLEL_BODY, OACC_PARALLEL_CLAUSES)
(OACC_KERNELS_BODY, OACC_KERNELS_CLAUSES, OACC_KERNELS_COMBINED)
(OACC_PARALLEL_COMBINED): Don't define macros.  Adjust all users.
gcc/testsuite/
PR c/64765
PR c/64880
* c-c++-common/goacc/loop-1.c: Don't skip for C++.  Don't prune
sorry message.
(PR64765): New function.
* gfortran.dg/goacc/coarray_2.f90: XFAIL.
* gfortran.dg/goacc/combined_loop.f90: Extend.  Don't prune
sorry message.
* gfortran.dg/goacc/cray.f95: Refine prune directive.
* gfortran.dg/goacc/parameter.f95: Likewise.
libgomp/
* testsuite/libgomp.oacc-c-c++-common/combdir-1.c: New file.
* testsuite/libgomp.oacc-fortran/combdir-1.f90: Likewise.

From-SVN: r229404

9 years agoAdd var in push_fields_onto_fieldstack
Tom de Vries [Tue, 27 Oct 2015 07:09:58 +0000 (07:09 +0000)]
Add var in push_fields_onto_fieldstack

2015-10-27  Tom de Vries  <tom@codesourcery.com>

* tree-ssa-structalias.c (push_fields_onto_fieldstack): Add and use var
field_type.

From-SVN: r229403

9 years agoloop-invariant.c (struct def): New field can_prop_to_addr_uses.
Bin Cheng [Tue, 27 Oct 2015 05:26:27 +0000 (05:26 +0000)]
loop-invariant.c (struct def): New field can_prop_to_addr_uses.

* loop-invariant.c (struct def): New field can_prop_to_addr_uses.
(inv_can_prop_to_addr_use): New function.
(record_use): Call can_prop_to_addr_uses, set the new field.
(get_inv_cost): Count cost if inv can't be propagated into its
address uses.

From-SVN: r229402

9 years agore PR libffi/65441 (FAIL: libffi.call/float2.c -W -Wall -Wno-psabi (test for excess...
John David Anglin [Tue, 27 Oct 2015 00:39:32 +0000 (00:39 +0000)]
re PR libffi/65441 (FAIL: libffi.call/float2.c -W -Wall -Wno-psabi (test for excess errors))

PR libffi/65441
* testsuite/lib/libffi.exp: Load target-supports-dg.exp.
* testsuite/libffi.call/float2.c: Don't run on hppa*-*-hpux*.

From-SVN: r229400

9 years agoDaily bump.
GCC Administrator [Tue, 27 Oct 2015 00:16:12 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r229399

9 years agoDR 2179
Jason Merrill [Mon, 26 Oct 2015 21:17:50 +0000 (17:17 -0400)]
DR 2179

DR 2179
* pt.c (process_partial_specialization): Handle error_mark_node
from most_specialized_partial_spec.

From-SVN: r229395

9 years ago* config/linux.h (INCLUDE_DEFAULTS): Add INCLUDE_DEFAULTS_MUSL_LOCAL.
Doug Evans [Mon, 26 Oct 2015 20:07:43 +0000 (20:07 +0000)]
* config/linux.h (INCLUDE_DEFAULTS): Add INCLUDE_DEFAULTS_MUSL_LOCAL.

From-SVN: r229392

9 years agore PR fortran/66056 (ICEs and endless compilation for lonely labels/numbers in type)
Louis Krupp [Mon, 26 Oct 2015 19:18:08 +0000 (19:18 +0000)]
re PR fortran/66056 (ICEs and endless compilation for lonely labels/numbers in type)

2015-10-26  Louis Krupp  <louis.krupp@zoho.com>

PR fortran/66056
* fortran.h: Include namespace pointer in statement label
structure.
* symbol.c (gfc_get_st_label): Store pointer to namespace
that owns the statement label tree in each label.
(gfc_free_st_label): Use namespace owning statement label
tree when deleting statement label.
* io.c: Initialize format_asterisk with NULL namespace pointer.

2015-10-26  Louis Krupp  <louis.krupp@zoho.com>

PR fortran/66056
* gfortran.dg/empty_label_typedecl.f90: New test

From-SVN: r229390

9 years agolibjava: fix locale handling when sorting JNI methods
Mike Frysinger [Mon, 26 Oct 2015 18:32:41 +0000 (18:32 +0000)]
libjava: fix locale handling when sorting JNI methods

When building under LANG=cs_CZ.UTF-8, the JNI method check fails:

/bin/bash ../../scripts/check_jni_methods.sh
Found a problem with the JNI methods declared and implemented.
(<) missing in implementation, (>) missing in header files
> Java_gnu_java_awt_peer_gtk_GtkClipboard_advertiseContent
> Java_gnu_java_awt_peer_gtk_GtkClipboard_initNativeState
... lots more ...

While the sed commands are run under LC_ALL=C, the two sort commands are
not, and they end up producing unexpected output (for the test).  Once we
run both under LC_ALL=C, the check passes.  While we're here, we can also
combine latter the `sort|uniq` into `sort -u` to match the earlier code.

URL: https://bugs.gentoo.org/563710
Reported-by: Miroslav Ć ulc <fordfrog@gentoo.org>
From-SVN: r229388

9 years agore PR fortran/36192 (ICE with wrong index types and bad parens)
Steven G. Kargl [Mon, 26 Oct 2015 17:39:07 +0000 (17:39 +0000)]
re PR fortran/36192 (ICE with wrong index types and bad parens)

2015-10-26  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/36192
* array.c (gfc_ref_dimen_size): Check for BT_INTEGER before calling
mpz_set.

2015-10-26  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/36192
* gfortran.dg/pr36192.f90: New test.

From-SVN: r229387

9 years agomatch.pd (fold_widened_comparison): Apply simplifications to all integral types.
Eric Botcazou [Mon, 26 Oct 2015 17:02:48 +0000 (17:02 +0000)]
match.pd (fold_widened_comparison): Apply simplifications to all integral types.

* match.pd (fold_widened_comparison): Apply simplifications to all
integral types.

From-SVN: r229384

9 years agotarget.def (TARGET_NO_SPECULATION_IN_DELAY_SLOTS_P): New hook.
Simon Dardis [Mon, 26 Oct 2015 16:29:31 +0000 (16:29 +0000)]
target.def (TARGET_NO_SPECULATION_IN_DELAY_SLOTS_P): New hook.

gcc/
* target.def (TARGET_NO_SPECULATION_IN_DELAY_SLOTS_P): New hook.
* doc/tm.texi.in (TARGET_NO_SPECULATION_IN_DELAY_SLOTS_P): Document.
* doc/tm.texi: Regenerated.
* reorg.c (dbr_schedule): Use new hook.
* config/mips/mips.c (mips_no_speculation_in_delay_slots_p): New.

testsuite/
* gcc.target/mips/ds-schedule-1.c: New.
* gcc.target/mips/ds-schedule-2.c: New.

From-SVN: r229383

9 years agoabort might not flush all open streams before process termination
Thomas Schwinge [Mon, 26 Oct 2015 16:25:04 +0000 (17:25 +0100)]
abort might not flush all open streams before process termination

libgomp/
* testsuite/libgomp.oacc-c-c++-common/abort-1.c: Print to stderr.
* testsuite/libgomp.oacc-c-c++-common/abort-3.c: Likewise.

From-SVN: r229382

9 years agolibgomp testsuite: Remove some explicit acc_device_nvidia usage.
Thomas Schwinge [Mon, 26 Oct 2015 16:24:54 +0000 (17:24 +0100)]
libgomp testsuite: Remove some explicit acc_device_nvidia usage.

libgomp/
* testsuite/libgomp.oacc-c-c++-common/lib-1.c: Remove explicit
acc_device_nvidia usage.
* testsuite/libgomp.oacc-c-c++-common/lib-10.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/lib-2.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/lib-9.c: Likewise.

From-SVN: r229381