2015-12-02 Tom de Vries <tom@codesourcery.com>
* omp-low.c (install_var_field, scan_sharing_clauses): Add and handle
parameter base_pointers_restrict.
(omp_target_base_pointers_restrict_p): New function.
(scan_omp_target): Call scan_sharing_clauses with base_pointers_restrict
arg.
* c-c++-common/goacc/kernels-alias-2.c: New test.
* c-c++-common/goacc/kernels-alias-3.c: New test.
* c-c++-common/goacc/kernels-alias-4.c: New test.
* c-c++-common/goacc/kernels-alias-5.c: New test.
* c-c++-common/goacc/kernels-alias-6.c: New test.
* c-c++-common/goacc/kernels-alias-7.c: New test.
* c-c++-common/goacc/kernels-alias-8.c: New test.
* c-c++-common/goacc/kernels-alias.c: New test.
From-SVN: r231182
2015-12-02 Richard Biener <rguenther@suse.de>
* tree.h (tree_invariant_p): Declare.
* tree.c (tree_invariant_p): Export.
* genmatch.c (dt_simplify::gen_1): For GENERIC code-gen never
create SAVE_EXPRs but reject patterns if we would need to.
From-SVN: r231178
On 64-bit we can do comparisons of 32-bit values by extending those
values to 64-bit, subtracting them, and then getting the high bit of
the result. For registers this is always cheaper than using the carry
bit sequence; and if the comparison involves a constant, this is cheaper
than the sequence we previously generated in half of the cases (and the
same cost in the other cases).
After this, the only sequence left that is using the mfcr insn is the
one doing signed comparison of Pmode registers.
From-SVN: r231165
2015-12-02 Richard Biener <rguenther@suse.de>
PR tree-optimization/68625
* tree-cfgcleanup.c (cleanup_tree_cfg_bb): Do not call
cleanup_control_flow_bb.
(cleanup_tree_cfg_1): First perform cleanup_control_flow_bb
on all BBs, then cleanup_tree_cfg_bb and finally iterate
over the worklist doing both.
* gcc.dg/torture/pr68625.c: New testcase.
From-SVN: r231162
The problem in the PR is that some i386 optabs FAIL when
optimising for size rather than speed. The gimple level generally
needs access to this information before calling the generator,
so this patch adds a new hook to say whether an optab should
be used when optimising for size or speed. It also has a "both"
option for cases where we want code that is optimised for both
size and speed.
I've passed the optab to the target hook because I think in most
cases that's more useful than the instruction code. We could pass
both if there's a use for it though.
At the moment the match-and-simplify code doesn't have direct access
to the target block, so for now I've used "both" there.
Tested on x86_64-linux-gnu and powerpc64-linux-gnu.
gcc/
PR tree-optimization/68432
* coretypes.h (optimization_type): New enum.
* doc/tm.texi.in (TARGET_OPTAB_SUPPORTED_P): New hook.
* doc/tm.texi: Regenerate.
* target.def (optab_supported_p): New hook.
* targhooks.h (default_optab_supported_p): Declare.
* targhooks.c (default_optab_supported_p): New function.
* predict.h (function_optimization_type): Declare.
(bb_optimization_type): Likewise.
* predict.c (function_optimization_type): New function.
(bb_optimization_type): Likewise.
* optabs-query.h (convert_optab_handler): Define an overload
that takes an optimization type.
(direct_optab_handler): Likewise.
* optabs-query.c (convert_optab_handler): Likewise.
(direct_optab_handler): Likewise.
* internal-fn.h (direct_internal_fn_supported_p): Take an
optimization_type argument.
* internal-fn.c (direct_optab_supported_p): Likewise.
(multi_vector_optab_supported_p): Likewise.
(direct_internal_fn_supported_p): Likewise.
* builtins.c (replacement_internal_fn): Update call to
direct_internal_fn_supported_p.
* gimple-match-head.c (build_call_internal): Likewise.
* tree-vect-patterns.c (vect_recog_pow_pattern): Likewise.
* tree-vect-stmts.c (vectorizable_internal_function): Likewise.
* tree.c (maybe_build_call_expr_loc): Likewise.
* config/i386/i386.c (ix86_optab_supported_p): New function.
(TARGET_OPTAB_SUPPORTED_P): Define.
* config/i386/i386.md (asinxf2): Remove optimize_insn_for_size_p check.
(asin<mode>2, acosxf2, acos<mode>2, log1pxf2, log1p<mode>2)
(expNcorexf3, expxf2, exp<mode>2, exp10xf2, exp10<mode>2, exp2xf2)
(exp2<mode>2, expm1xf2, expm1<mode>2, ldexpxf3, ldexp<mode>3)
(scalbxf3, scalb<mode>3, rint<mode>2, round<mode>2)
(<rounding_insn>xf2, <rounding_insn><mode>2): Likewise.
gcc/testsuite/
* gcc.target/i386/pr68432-1.c: New test.
* gcc.target/i386/pr68432-2.c: Likewise.
* gcc.target/i386/pr68432-3.c: Likewise.
From-SVN: r231161
This patch makes it a compile-time error for an internal-fn optab
to FAIL. There are certainly other optabs and patterns besides these
that aren't allowed to fail, but this at least deals with the immediate
point of controversy.
Tested normally on x86_64-linux-gnu. Also tested by building one
configuration per cpu directory. arc-elf and pdp11 didn't build
for unrelated reasons, but I checked that insn-emit.o built for
both without error.
gcc/
* Makefile.in (GENSUPPORT_H): New macro.
(build/gensupport.o, build/read-rtl.o, build/genattr.o)
(build/genattr-common.o, build/genattrtab.o, build/genautomata.o)
(build/gencodes.o, build/genconditions.o, build/genconfig.o)
(build/genconstants.o, build/genextract.o, build/genflags.o)
(build/gentarget-def.o): Use it.
(build/genemit.o): Likewise. Depend on internal-fn.def.
* genopinit.c: Move block comment to optabs.def.
(optab_tag, optab_def): Move to gensupport.h
(pattern): Likewise, renaming to optab_pattern.
(match_pattern): Move to gensupport.c
(gen_insn): Use find_optab.
(patterns, pattern_cmp): Replace pattern with optab_pattern.
(main): Likewise. Use num_optabs.
* optabs.def: Add comment that was previously in genopinit.c.
* gensupport.h (optab_tag): Moved from genopinit.c
(optab_def): Likewise, expanding commentary.
(optab_pattern): Likewise, after renaming from pattern.
(optabs, num_optabs, find_optab): Declare.
* gensupport.c (optabs): Moved from genopinit.c.
(num_optabs): New variable.
(match_pattern): Moved from genopinit.c.
(find_optab): New function, extracted from genopinit.c:gen_insn.
* genemit.c (nofail_optabs): New variable.
(emit_c_code): New function.
(gen_expand): Check whether the instruction is an optab that isn't
allowed to fail. Call emit_c_code.
(gen_split): Call emit_c_code here too.
(main): Initialize nofail_optabs. Don't emit FAIL and DONE here.
From-SVN: r231160
gcc/ChangeLog:
2015-12-02 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
* config/s390/predicates.md (const_mask_operand): New predicate.
* config/s390/s390-builtins.def: Set a smaller bitmask for a few builtins.
* config/s390/vector.md: Change predicate from immediate_operand
to either const_int_operand or const_mask_operand. Add special
insn conditions on patterns which have to exclude certain values.
* config/s390/vx-builtins.md: Likewise.
From-SVN: r231159
gcc/ChangeLog:
2015-12-02 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
* config/s390/vector.md ("*vec_set<mode>"): Change shift count
mode from DI to SI.
From-SVN: r231158
gcc/testsuite/ChangeLog:
2015-12-02 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
* gcc.target/s390/zvector/vec-splat-2.c: New test.
gcc/ChangeLog:
2015-12-02 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
* config/s390/s390-builtin-types.def: New builtin types added.
* config/s390/s390-builtins.def: Add s390_vec_splat_* definitions.
* config/s390/s390.c (s390_expand_builtin): Always truncate
constants to the mode in the pattern.
* config/s390/vecintrin.h: Let the vec_splat_* macros point to the
respective builtin __builtin_s390_vec_splat_*.
From-SVN: r231157
gcc/ChangeLog:
2015-12-02 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
* config/s390/s390-c.c (s390_get_vstring_flags): Invert the
condition for the RT flag.
From-SVN: r231155
gcc/testsuite/ChangeLog:
2015-12-02 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
* gcc.target/s390/vector/vec-vrepi-1.c: New test.
gcc/ChangeLog:
2015-12-02 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
* config/s390/constraints.md ("jKK"): New constraint.
* config/s390/s390.c (tm-constrs.h): Include for
satisfies_constraint_*.
(s390_legitimate_constant_p): Allow jKK constants. Use
satisfies_constraint_* also for the others.
(legitimate_reload_vector_constant_p): Likewise.
(print_operand): Allow h output modifier on vectors.
* config/s390/vector.md ("mov<mode>"): Add vrepi.
From-SVN: r231154
gcc/ChangeLog:
2015-12-02 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
* config/s390/s390.md ("bswap<mode>2"): Add support for strv and
strvg.
("bswaphi2"): New pattern.
New splitter for HI reg-reg bswap.
gcc/testsuite/ChangeLog:
2015-12-02 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
* gcc.target/s390/bswap-1.c (foo64c, foo32a, foo32c): New functions.
* gcc.target/s390/bswaphi-1.c: New test.
From-SVN: r231152
gcc/testsuite/ChangeLog:
2015-12-02 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
* lib/target-supports.exp: Add s390 and s390x to the list of long
long atomic targets.
From-SVN: r231151
gcc/testsuite/ChangeLog:
2015-12-02 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
* gcc.dg/optimize-bswapdi-1.c: Force using -mzarch on s390 and
s390x to enable 64 bit bswap patterns.
* gcc.dg/optimize-bswapdi-2.c: Likewise.
* gcc.dg/optimize-bswapdi-3.c: Likewise.
* lib/target-supports.exp: Add a comment for s390.
From-SVN: r231149
gcc/testsuite/ChangeLog:
2015-12-02 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
* gcc.dg/builtin-bswap-6a.c: Add -march=z900 for s390 and s390x in
order to make -m31 work.
* gcc.dg/optimize-bswapsi-1.c: Likewise.
* gcc.dg/optimize-bswapsi-2.c: Likewise.
From-SVN: r231148
SVN commit r230979 always associates a loop's back-jump with the start
of the loop body. This caused a regression for gcov with conditional
loops, because then the loop body appears to be covered twice per
iteration.
2015-12-02 Andreas Arnez <arnez@linux.vnet.ibm.com>
PR gcov-profile/68603
* cp-gimplify.c (genericize_cp_loop): For the back-jump's location
use the start of the loop body only if the loop is unconditional.
From-SVN: r231146
This patch adds support for simple cases where a vector
internal function returns wider results than the scalar
equivalent. It punts on other cases.
Tested on powerpc64-linux-gnu and x86_64-linux-gnu.
gcc/
PR tree-optimization/68577
* tree-vect-stmts.c (simple_integer_narrowing): New function.
(vectorizable_call): Restrict internal function handling
to NONE and NARROW cases, using simple_integer_narrowing
to test for the latter. Add cost of narrowing operation
and insert it where necessary.
gcc/testsuite/
PR tree-optimization/68577
* gcc.dg/vect/pr68577.c: New test.
From-SVN: r231131
2015-12-01 Andreas Tobler <andreast@gcc.gnu.org>
* config/rs6000/freebsd64.h (ELFv2_ABI_CHECK): Add new macro.
(SUBSUBTARGET_OVERRIDE_OPTIONS): Use it to decide whether to set
rs6000_current_abi to ABI_AIX or ABI_ELFv2.
From-SVN: r231129
* lto-streamer-out.c (hash_tree): Do not stream TYPE_ALIAS_SET.
* tree-streamer-out.c (pack_ts_type_common_value_fields): Do not
stream TYPE_ALIAS_SET.
* tree-streamer-in.c (unpack_ts_type_common_value_fields): Do not
stream TYPE_ALIAS_SET.
* lto.c (compare_tree_sccs_1): Do not compare TYPE_ALIAS_SET.
From-SVN: r231124
[gcc]
2015-12-01 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
* config/rs6000/rs6000.c (const_load_sequence_p): Handle extra
indirection for large and small code models.
(adjust_vperm): Likewise.
[gcc/testsuite]
2015-12-01 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
* gcc.target/powerpc/swaps-p8-22.c: New.
From-SVN: r231119
PR middle-end/68582
* cgraphunit.c (check_global_declaration): Only depend on TREE_THIS_VOLATILE
for VAR_DECLs.
* c-c++-common/pr68582.c: New test.
From-SVN: r231116
We'd call gen_shrink_wrap_conditions for functions that it can't handle
but edom_only_function can.
Tested on x86_64-linux-gnu.
gcc/
PR tree-optimization/68474
* tree-call-cdce.c (use_internal_fn): Protect call to
gen_shrink_wrap_conditions.
gcc/testsuite/
PR tree-optimization/68474
* gcc.dg/pr68474.c: New test.
From-SVN: r231115
gcc/fortran/
* dump-parse-tree.c (show_omp_clauses): Handle optional num and static
arguments for the gang clause.
* gfortran.h (gfc_omp_clauses): Rename gang_expr as gang_num_expr.
Add gang_static_expr.
* openmp.c (gfc_free_omp_clauses): Update to free gang_num_expr and
gang_static_expr.
(match_oacc_clause_gang): Update to support both num and static in
the same clause.
(resolve_omp_clauses): Formatting. Also handle gang_num_expr and
gang_static_expr.
(resolve_oacc_params_in_parallel): New const char arg argument.
Use it to report more accurate gang, worker and vector clause errors.
(resolve_oacc_loop_blocks): Update calls to
resolve_oacc_params_in_parallel.
* trans-openmp.c (gfc_trans_omp_clauses): Update the gimplification of
the gang clause.
(gfc_trans_oacc_combined_directive): Make use of gang_num_expr and
gang_static_expr. Remove OMP_LIST_REDUCTION from construct_clauses.
gcc/testsuite/
* gfortran.dg/goacc/gang-static.f95: Add tests for gang num arguments.
* gfortran.dg/goacc/loop-2.f95: Update expected diagnostics.
* gfortran.dg/goacc/loop-6.f95: Likewise.
* gfortran.dg/goacc/loop-7.f95: New test.
* gfortran.dg/goacc/reduction-2.f95: New test.
From-SVN: r231112
2015-12-01 Richard Biener <rguenther@suse.de>
PR tree-optimization/68379
* tree-vect-stmts.c (vectorizable_load): For BB vectorization
always base loads on the first used DR of a group.
* tree-vect-data-refs.c (vect_slp_analyze_and_verify_node_alignment):
Compute alignment of the first scalar element unconditionally.
* gcc.dg/torture/pr68379.c: New testcase.
* gfortran.dg/pr68379-1.f90: Likewise.
* gfortran.dg/pr68379-2.f: Likewise.
From-SVN: r231111
2015-12-01 Richard Biener <rguenther@suse.de>
PR middle-end/68590
* genmatch.c (struct capture_info): Add match_use_count.
(capture_info::walk_match): Increment match_use_count.
(dt_simplify::gen_1): For GENERIC, only wrap multi-use
replacements in a save_expr if they occur more often than
in the original expression.
From-SVN: r231110
2015-12-01 Richard Biener <rguenther@suse.de>
PR ipa/68470
* ipa-split.c (split_function): Handle main part not returning.
* g++.dg/torture/pr68470.C: New testcase.
From-SVN: r231108