gcc.git
6 years agore PR tree-optimization/84339 (Wrong-code with optimizing strlen)
Jakub Jelinek [Tue, 13 Feb 2018 08:35:53 +0000 (09:35 +0100)]
re PR tree-optimization/84339 (Wrong-code with optimizing strlen)

PR tree-optimization/84339
* gimple-fold.c (get_range_strlen): Set *FLEXP to true when handling
ARRAY_REF where first operand is array_at_struct_end_p COMPONENT_REF.
Formatting fixes.

* gcc.c-torture/execute/pr84339.c: New test.

From-SVN: r257618

6 years agore PR middle-end/84309 (Wrong-code with -ffast-math)
Jakub Jelinek [Tue, 13 Feb 2018 08:34:42 +0000 (09:34 +0100)]
re PR middle-end/84309 (Wrong-code with -ffast-math)

PR middle-end/84309
* match.pd (pow(C,x) -> exp(log(C)*x)): Optimize instead into
exp2(log2(C)*x) if C is a power of 2 and c99 runtime is available.
* generic-match-head.c (canonicalize_math_after_vectorization_p): New
inline function.
* gimple-match-head.c (canonicalize_math_after_vectorization_p): New
inline function.
* omp-simd-clone.h: New file.
* omp-simd-clone.c: Include omp-simd-clone.h.
(expand_simd_clones): No longer static.
* tree-vect-patterns.c: Include fold-const-call.h, attribs.h,
cgraph.h and omp-simd-clone.h.
(vect_recog_pow_pattern): Optimize pow(C,x) to exp(log(C)*x).
(vect_recog_widen_shift_pattern): Formatting fix.
(vect_pattern_recog_1): Don't check optab for calls.

* gcc.dg/pr84309.c: New test.
* gcc.target/i386/pr84309.c: New test.

From-SVN: r257617

6 years agore PR target/84336 (ICE in extract_insn, at recog.c:2304)
Jakub Jelinek [Tue, 13 Feb 2018 08:31:58 +0000 (09:31 +0100)]
re PR target/84336 (ICE in extract_insn, at recog.c:2304)

PR target/84336
* config/i386/sse.md (<avx512>_vpermi2var<mode>3_mask): Force
operands[2] into a REG before using gen_lowpart on it.

* gcc.target/i386/pr84336.c: New test.

From-SVN: r257616

6 years agoMake module files reproducible
Alastair McKinstry [Tue, 13 Feb 2018 07:59:10 +0000 (07:59 +0000)]
Make module files reproducible

Using lbasename ensures that the build path does not end up in the
module file.

Regtested on x86_64-pc-linux-gnu, committed to trunk. Will shortly
backport to the 6 and 7 branches as well.

2018-02-13  Alastair McKinstry  <alastair.mckinstry@sceal.ie>
    Janne Blomqvist  <jb@gcc.gnu.org>

* module.c (dump_module): Use lbasename to ensure that module
files are reproducible.

Co-Authored-By: Janne Blomqvist <jb@gcc.gnu.org>
From-SVN: r257613

6 years agore PR target/83760 ([SH] ICE in maybe_record_trace_start building glibc tst-copy_file...
Jeff Law [Tue, 13 Feb 2018 03:07:04 +0000 (20:07 -0700)]
re PR target/83760 ([SH] ICE in maybe_record_trace_start building glibc tst-copy_file_range.c)

PR target/83760
* config/sh/sh.c (find_barrier): Consider a sibling call
a barrier as well.

From-SVN: r257611

6 years agoDaily bump.
GCC Administrator [Tue, 13 Feb 2018 00:16:21 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r257610

6 years agore PR c++/84341 (ICE with #pragma omp atomic)
Jakub Jelinek [Mon, 12 Feb 2018 22:25:41 +0000 (23:25 +0100)]
re PR c++/84341 (ICE with #pragma omp atomic)

PR c++/84341
* parser.c (cp_parser_binary_expression): Use build_min instead of
build2_loc to build the no_toplevel_fold_p toplevel binary expression.

* c-c++-common/gomp/pr84341.c: New test.

From-SVN: r257607

6 years ago* sv.po: Update.
Joseph Myers [Mon, 12 Feb 2018 21:31:23 +0000 (21:31 +0000)]
* sv.po: Update.

From-SVN: r257606

6 years agore PR fortran/68746 (FAIL: gfortran.dg/read_dir.f90 -O0 execution test)
Thomas Koenig [Mon, 12 Feb 2018 20:51:16 +0000 (20:51 +0000)]
re PR fortran/68746 (FAIL: gfortran.dg/read_dir.f90   -O0  execution test)

2018-02-12  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/68746
* gfortran.dg/read_dir.f90: Re-add dg-do run.

From-SVN: r257605

6 years agore PR fortran/68746 (FAIL: gfortran.dg/read_dir.f90 -O0 execution test)
Thomas Koenig [Mon, 12 Feb 2018 20:48:32 +0000 (20:48 +0000)]
re PR fortran/68746 (FAIL: gfortran.dg/read_dir.f90   -O0  execution test)

2018-02-12  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/68746
* gfortran.dg/read_dir.f90: Remove xfails. Also allow iostat
of zero for read.

From-SVN: r257604

6 years agolibgfortran.h (GFC_ARRAY_DESCRIPTOR): Remove dimension of descriptor to use vaiable...
Thomas Koenig [Mon, 12 Feb 2018 19:53:17 +0000 (19:53 +0000)]
libgfortran.h (GFC_ARRAY_DESCRIPTOR): Remove dimension of descriptor to use vaiable members for dim.

2018-02-12  Thomas Koenig  <tkoenig@gcc.gnu.org>

* libgfortran.h (GFC_ARRAY_DESCRIPTOR): Remove dimension
of descriptor to use vaiable members for dim.
Change usage of GFC_ARRAY_DESCRIPTOR accordingly.
(GFC_FILL_ARRAY_DESCRIPTOR): New macro.
(gfc_full_array_i4): New type.
* intrinsics/date_and_time.c (secnds): Use sizeof
(gfc_array_i4) + sizeof (descriptor_dimension) for memory
allocation.
* intrinsics/reshape_generic.c: Use GFC_FULL_ARRAY_DESCRIPTOR.
* io/format.c: Use sizeof (gfc_array_i4) + sizeof
(descriptor_dimension) for memoy allocation.
* io/list_read.c (list_formatted_read_scalar): Use
gfc_full_array_i4 for variable.
(nml_read_obj): Likewise.
* io/write.c (list_formatted_write_scalar): Likewise.
(nml_write_obj): Likewise.
* m4/reshape.m4: Use GFC_FULL_ARRAY_DESCRIPTOR.
* generated/reshape_c10.c: Regenerated.
* generated/reshape_c16.c: Regenerated.
* generated/reshape_c4.c: Regenerated.
* generated/reshape_c8.c: Regenerated.
* generated/reshape_i16.c: Regenerated.
* generated/reshape_i4.c: Regenerated.
* generated/reshape_i8.c: Regenerated.
* generated/reshape_r10.c: Regenerated.
* generated/reshape_r16.c: Regenerated.
* generated/reshape_r4.c: Regenerated.
* generated/reshape_r8.c: Regenerated.

From-SVN: r257601

6 years agocompiler: error on func declaration/definition
Ian Lance Taylor [Mon, 12 Feb 2018 19:29:52 +0000 (19:29 +0000)]
compiler: error on func declaration/definition

    Long long long ago Go permitted writing
        func F()
    in one file and writing
        func F() {}
    in another file.  This was removed from the language, and that is now
    considered to be a multiple definition error.  Gccgo never caught up
    to that, and it has been permitting this invalid code for some time.

    Stop permitting it, so that we give correct errors.  Since we've
    supported it for a long time, the compiler uses it in a couple of
    cases: it predeclares the hash/equal methods if it decides to create
    them while compiling another function, and it predeclares main.main as
    a mechanism for getting the right warning if a program uses the wrong
    signature for main.  For simplicity, keep those existing uses.

    This required a few minor changes in libgo which were relying,
    unnecessarily, on the current behavior.

    Reviewed-on: https://go-review.googlesource.com/93083

From-SVN: r257600

6 years agore PR go/84215 (Random results in go/libgo tests)
Ian Lance Taylor [Mon, 12 Feb 2018 18:50:16 +0000 (18:50 +0000)]
re PR go/84215 (Random results in go/libgo tests)

PR go/84215
    runtime, sync/atomic: use write barrier for atomic pointer functions

    This copies atomic_pointer.go from 1.10rc2.  It was omitted during the
    transition of the runtime from C to Go, and I forgot about it.

    This may help with https://gcc.gnu.org/PR84215.

    Reviewed-on: https://go-review.googlesource.com/93197

From-SVN: r257599

6 years agocse.c (try_back_substitute_reg): Move any REG_ARGS_SIZE note when successfully back...
Jeff Law [Mon, 12 Feb 2018 18:32:18 +0000 (11:32 -0700)]
cse.c (try_back_substitute_reg): Move any REG_ARGS_SIZE note when successfully back substituting a reg.

* cse.c (try_back_substitute_reg): Move any REG_ARGS_SIZE note when
successfully back substituting a reg.

* gcc.c-torture/compile/reg-args-size.c: New test.

From-SVN: r257598

6 years agobuiltins-4-runnable.c (main): Move int128 and uint128 tests to new testfile.
Carl Love [Mon, 12 Feb 2018 17:21:28 +0000 (17:21 +0000)]
builtins-4-runnable.c (main): Move int128 and uint128 tests to new testfile.

gcc/testsuite/ChangeLog:

2018-02-12  Carl Love  <cel@us.ibm.com>

* gcc.target/powerpc/builtins-4-runnable.c (main): Move int128 and
uint128 tests to new testfile.
* gcc.target/powerpc/builtins-4-int128-runnable.c: New testfile for
int128 and uint128 tests.
* gcc.target/powerpc/powerpc.exp: Add builtins-4-int128-runnable.c to
list of torture tests.

From-SVN: r257591

6 years agore PR fortran/84273 ([F03] Reject allocatable passed-object dummy argument (proc_ptr_...
Janus Weil [Mon, 12 Feb 2018 17:11:58 +0000 (18:11 +0100)]
re PR fortran/84273 ([F03] Reject allocatable passed-object dummy argument (proc_ptr_47.f90))

2018-02-12  Janus Weil  <janus@gcc.gnu.org>

PR fortran/84273
* resolve.c (resolve_component): Fix checks of passed argument in
procedure-pointer components.

2018-02-12  Janus Weil  <janus@gcc.gnu.org>

PR fortran/84273
* gfortran.dg/proc_ptr_47.f90: Fix invalid test case.
* gfortran.dg/proc_ptr_comp_pass_4.f90: Fix and extend test case.

From-SVN: r257590

6 years agore PR tree-optimization/84037 (Speed regression of polyhedron benchmark since r256644)
Richard Biener [Mon, 12 Feb 2018 13:55:04 +0000 (13:55 +0000)]
re PR tree-optimization/84037 (Speed regression of polyhedron benchmark since r256644)

2018-02-12  Richard Biener  <rguenther@suse.de>

PR tree-optimization/84037
* tree-vect-slp.c (vect_analyze_slp_cost): Add visited
parameter, move visited init to caller.
(vect_slp_analyze_operations): Separate cost from validity
check, initialize visited once for all instances.
(vect_schedule_slp): Analyze map to CSE vectorized nodes once
for all instances.
* tree-vect-stmts.c (vect_model_simple_cost): Make early
out an assert.
(vect_model_promotion_demotion_cost): Likewise.
(vectorizable_bswap): Guard cost modeling with !slp_node
instead of !PURE_SLP_STMT to avoid double-counting on hybrid
SLP stmts.
(vectorizable_call): Likewise.
(vectorizable_conversion): Likewise.
(vectorizable_assignment): Likewise.
(vectorizable_shift): Likewise.
(vectorizable_operation): Likewise.
(vectorizable_store): Likewise.
(vectorizable_load): Likewise.
(vectorizable_condition): Likewise.
(vectorizable_comparison): Likewise.

From-SVN: r257588

6 years agoCorrected mistakes in ChangeLog spotted by Jakub Jelinek.
Sebastian Perta [Mon, 12 Feb 2018 13:49:22 +0000 (13:49 +0000)]
Corrected mistakes in ChangeLog spotted by Jakub Jelinek.

From-SVN: r257587

6 years agore PR target/82641 (Unable to enable crc32 for a certain function with target attribu...
Tamar Christina [Mon, 12 Feb 2018 12:52:29 +0000 (12:52 +0000)]
re PR target/82641 (Unable to enable crc32 for a certain function with target attribute on ARM (aarch32))

2018-02-12  Tamar Christina  <tamar.christina@arm.com>

PR target/82641
* gcc.target/arm/pragma_arch_switch_2.c: Use armv5te.

From-SVN: r257586

6 years agore PR sanitizer/84307 (asan blocks dead-store elimination)
Paolo Bonzini [Mon, 12 Feb 2018 12:47:56 +0000 (12:47 +0000)]
re PR sanitizer/84307 (asan blocks dead-store elimination)

gcc:
2018-02-12  Paolo Bonzini <bonzini@gnu.org>

PR sanitizer/84307
* internal-fn.def (ASAN_CHECK): Fix fnspec to account for return value.
(ASAN_MARK): Fix fnspec to account for return value, change pointer
argument from 'R' to 'W' so that the pointed-to datum is clobbered.

gcc/testsuite:
2018-02-12  Paolo Bonzini  <bonzini@gnu.org>

PR sanitizer/84307
* gcc.dg/asan/pr84307.c: New test.

From-SVN: r257585

6 years ago[PR c++/84263] GC ICE with decltype
Nathan Sidwell [Mon, 12 Feb 2018 11:58:40 +0000 (11:58 +0000)]
[PR c++/84263] GC ICE with decltype

https://gcc.gnu.org/ml/gcc-patches/2018-02/msg00435.html
PR c++/84263
* parser.c (cp_parser_decltype): Push and pop
deferring_access_checks.  Reorganize to avoid goto.

* g++.dg/parse/pr84263.C: New.

From-SVN: r257584

6 years agore PR c++/79626 (ICE on invalid code in build_temp (call.c:6489))
Paolo Carlini [Mon, 12 Feb 2018 11:16:33 +0000 (11:16 +0000)]
re PR c++/79626 (ICE on invalid code in build_temp (call.c:6489))

2018-02-12  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/79626
* g++.dg/template/crash129.C: New.

From-SVN: r257583

6 years agore PR middle-end/83665 (Big code size regression and some code quality improvement...
Jan Hubicka [Mon, 12 Feb 2018 09:48:06 +0000 (10:48 +0100)]
re PR middle-end/83665 (Big code size regression and some code quality improvement at Jan 2 2018)

PR middle-end/83665
* params.def (inline-min-speedup): Increase from 8 to 15.
(max-inline-insns-auto): Decrease from 40 to 30.
* ipa-split.c (consider_split): Add some buffer for function to
be considered inlining candidate.
* invoke.texi (max-inline-insns-auto, inline-min-speedup): UPdate
default values.

From-SVN: r257582

6 years agore PR tree-optimization/84037 (Speed regression of polyhedron benchmark since r256644)
Richard Biener [Mon, 12 Feb 2018 08:54:28 +0000 (08:54 +0000)]
re PR tree-optimization/84037 (Speed regression of polyhedron benchmark since r256644)

2018-02-12  Richard Biener  <rguenther@suse.de>

PR tree-optimization/84037
* tree-vect-slp.c (vect_build_slp_tree_2): Try swapping the
matched stmts if we cannot swap the non-matched ones.

From-SVN: r257581

6 years agore PR c++/84281 (Heap grows indefinitely)
Richard Biener [Mon, 12 Feb 2018 07:31:56 +0000 (07:31 +0000)]
re PR c++/84281 (Heap grows indefinitely)

2018-02-12  Richard Biener  <rguenther@suse.de>

PR c++/84281
* constexpr.c (cxx_eval_vec_init_1): Use a RANGE_EXPR to compact
uniform constructors and delay allocating them fully.

From-SVN: r257580

6 years agoFix AVX-512 popcnt and bitalg tests.
Olga Makhotina [Mon, 12 Feb 2018 06:14:15 +0000 (06:14 +0000)]
Fix AVX-512 popcnt and bitalg tests.

gcc/testsuite/
PR target/83828
* gcc.target/i386/avx512bitalg-vpopcntb-1.c: Fix test.
* gcc.target/i386/avx512bitalg-vpopcntw-1.c: Ditto.
* gcc.target/i386/avx512bitalg-vpshufbitqmb-1.c: Ditto.
* gcc.target/i386/avx512vpopcntdq-vpopcntd-1.c: Ditto.
* gcc.target/i386/avx512vpopcntdq-vpopcntq-1.c: Ditto.

From-SVN: r257579

6 years agoAdd missing mask[z]_scalef_round_s[d,s] intrinsics
Olga Makhotina [Mon, 12 Feb 2018 06:09:20 +0000 (06:09 +0000)]
Add missing mask[z]_scalef_round_s[d,s] intrinsics

gcc/
* config/i386/avx512fintrin.h (_mm_mask_scalef_round_sd,
_mm_maskz_scalef_round_sd, _mm_mask_scalef_round_ss,
_mm_maskz_scalef_round_ss): New intrinsics.
(__builtin_ia32_scalefsd_round, __builtin_ia32_scalefss_round): Fix.
* config/i386/i386-builtin.def (__builtin_ia32_scalefsd_round,
__builtin_ia32_scalefss_round): Remove.
(__builtin_ia32_scalefsd_mask_round,
__builtin_ia32_scalefss_mask_round): New intrinsics.
* config/i386/sse.md (vmscalef<mode><round_name>): Renamed to ...
(vmscalef<mode><mask_scalar_name><round_scalar_name>): ... this.
((match_operand:VF_128 2 "<round_nimm_predicate>"
"<round_constraint>")): Changed to ...
((match_operand:VF_128 2 "<round_scalar_nimm_predicate>"
"<round_scalar_constraint>")): ... this.
("vscalef<ssescalarmodesuffix>\t{<round_op3>%2, %1, %0|
%0, %1, %2<round_op3>}"): Changed to ...
("vscalef<ssescalarmodesuffix>\t{<round_scalar_mask_op3>%2, %1,
%0<mask_scalar_operand3>|%0<mask_scalar_operand3>, %1,
%2<round_scalar_mask_op3>}"): ... this.
* config/i386/subst.md (round_scalar_nimm_predicate): New.

gcc/testsuite/
* gcc.target/i386/avx512f-vscalefsd-1.c (_mm_mask_scalef_round_sd,
_mm_maskz_scalef_round_sd): Test new intrinsics.
* gcc.target/i386/avx512f-vscalefsd-2.c (_mm_scalef_round_sd,
_mm_mask_scalef_round_sd, _mm_maskz_scalef_round_sd): Test new
intrinsics.
* gcc.target/i386/avx512f-vscalefss-1.c (_mm_mask_scalef_round_ss,
_mm_maskz_scalef_round_ss): Test new intrinsics.
* gcc.target/i386/avx512f-vscalefss-2.c (_mm_scalef_round_ss,
_mm_mask_scalef_round_ss, _mm_maskz_scalef_round_ss): Test new
intrinsics.
* gcc.target/i386/avx-1.c (__builtin_ia32_scalefsd_round,
__builtin_ia32_scalefss_round): Remove builtin.
(__builtin_ia32_scalefsd_mask_round,
__builtin_ia32_scalefss_mask_round): Test new builtin.
* gcc.target/i386/sse-13.c: Ditto.
* gcc.target/i386/sse-23.c: Ditto.

From-SVN: r257578

6 years agoAdd missing ChangeLog entry for previous patch.
Olga Makhotina [Mon, 12 Feb 2018 05:45:38 +0000 (05:45 +0000)]
Add missing ChangeLog entry for previous patch.

From-SVN: r257577

6 years agoAdd missing intrinsics for _mm_mask[z]_sqrt_round_[sd,ss]
Olga Makhotina [Mon, 12 Feb 2018 05:44:29 +0000 (05:44 +0000)]
Add missing intrinsics for _mm_mask[z]_sqrt_round_[sd,ss]

gcc/
* config/i386/avx512fintrin.h (_mm_mask_sqrt_round_sd)
(_mm_maskz_sqrt_round_sd, _mm_mask_sqrt_round_ss)
(_mm_maskz_sqrt_round_ss): New intrinsics.
(__builtin_ia32_sqrtsd_round, __builtin_ia32_sqrtss_round): Remove.
(__builtin_ia32_sqrtsd_mask_round)
(__builtin_ia32_sqrtss_mask_round): New builtins.
* config/i386/i386-builtin.def (__builtin_ia32_sqrtsd_round)
(__builtin_ia32_sqrtss_round): Remove.
(__builtin_ia32_sqrtsd_mask_round)
(__builtin_ia32_sqrtss_mask_round): New builtins.
* config/i386/sse.md (vmsqrt<mode>2<round_name>): Renamed to ...
(vmsqrt<mode>2<mask_scalar_name><round_scalar_name>): ... this.
((match_operand:VF_128 1 "vector_operand"
"xBm,<round_constraint>")): Changed to ...
((match_operand:VF_128 1 "vector_operand"
"xBm,<round_scalar_constraint>")): ... this.
(vsqrt<ssescalarmodesuffix>\t{<round_op3>%1, %2, %0|
%0, %2, %<iptr>1<round_op3>}): Changed to ...
(vsqrt<ssescalarmodesuffix>\t{<round_scalar_mask_op3>%1, %2,
%0<mask_scalar_operand3>|%0<mask_scalar_operand3>, %2,
%<iptr>1<round_scalar_mask_op3>}): ... this.
((set_attr "prefix" "<round_prefix>")): Changed to ...
((set_attr "prefix" "<round_scalar_prefix>")): ... this.

gcc/testsuite/
* gcc.target/i386/avx512f-vsqrtsd-1.c (_mm_mask_sqrt_round_sd)
(_mm_maskz_sqrt_round_sd): Test new intrinsics.
* gcc.target/i386/avx512f-vsqrtsd-2.c (_mm_sqrt_round_sd)
(_mm_mask_sqrt_round_sd, _mm_maskz_sqrt_round_sd): Test new intrinsics.
* gcc.target/i386/avx512f-vsqrtss-1.c (_mm_mask_sqrt_round_ss)
(_mm_maskz_sqrt_round_ss): Test new intrinsics.
* gcc.target/i386/avx512f-vsqrtss-2.c (_mm_sqrt_round_ss)
(_mm_mask_sqrt_round_ss,      _mm_maskz_sqrt_round_ss): Test new
intrinsics.
* gcc.target/i386/avx-1.c (__builtin_ia32_sqrtsd_round)
(__builtin_ia32_sqrtss_round): Remove builtins.
(__builtin_ia32_sqrtsd_mask_round)
(__builtin_ia32_sqrtss_mask_round): Test new builtins.
* gcc.target/i386/sse-13.c: Ditto.
* gcc.target/i386/sse-23.c: Ditto.

From-SVN: r257576

6 years agoPR c++/84036 - ICE with variadic capture.
Jason Merrill [Mon, 12 Feb 2018 01:21:39 +0000 (20:21 -0500)]
PR c++/84036 - ICE with variadic capture.

Handle variadic capture proxies more like non-variadic.
* lambda.c (build_capture_proxy): Remove workaround.
* pt.c (find_parameter_packs_r): The proxy is a pack.
(instantiate_class_template_1): Remove dead lambda code.
(extract_fnparm_pack): Don't make_pack_expansion.
(extract_locals_r): Don't strip a pack expansion.
(tsubst_pack_expansion): Handle proxy packs.  Use
PACK_EXPANSION_EXTRA_ARGS less.
(tsubst_decl) [FIELD_DECL]: Don't register_specialization.
(tsubst_copy) [FIELD_DECL]: Don't retrieve*_specialization.
[VAR_DECL]: Handle ARGUMENT_PACK_SELECT.
(tsubst_expr) [DECL_EXPR]: Handle proxy packs.
(tsubst_copy_and_build) [VAR_DECL]: Handle proxy packs normally.

From-SVN: r257575

6 years agoDaily bump.
GCC Administrator [Mon, 12 Feb 2018 00:16:14 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r257574

6 years agore PR target/84266 (mmintrin.h intrinsic headers for PowerPC code fails on power9)
Steven Munroe [Sun, 11 Feb 2018 21:45:39 +0000 (21:45 +0000)]
re PR target/84266 (mmintrin.h intrinsic headers for PowerPC code fails on power9)

Fix PR 84266

From-SVN: r257571

6 years agoCommit ChangeLog entries forgotten in r257566.
Francois-Xavier Coudert [Sun, 11 Feb 2018 19:07:55 +0000 (19:07 +0000)]
Commit ChangeLog entries forgotten in r257566.

2018-02-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

PR fortran/35299
ChangeLog for r257566
* gfortran.dg/statement_function_3.f: New test.

2018-02-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

PR fortran/35299
ChangeLog for r257566
* resolve.c (resolve_formal_arglist): Update error message.

From-SVN: r257568

6 years agogfortran.texi: Fix typos in documentation of caf_register ().
Andre Vehreschild [Sun, 11 Feb 2018 18:59:59 +0000 (19:59 +0100)]
gfortran.texi: Fix typos in documentation of caf_register ().

gcc/fortran/ChangeLog:

2018-02-11  Andre Vehreschild  <vehre@gcc.gnu.org>

* gfortran.texi: Fix typos in documentation of caf_register ().
* trans-array.c (structure_alloc_comps): Only register a component of
a derived typed corray, not of an ultimate component coarray.

From-SVN: r257567

6 years agore PR fortran/35299 (scope of variables in statement function do not acquire rank...
Francois-Xavier Coudert [Sun, 11 Feb 2018 18:55:31 +0000 (18:55 +0000)]
re PR fortran/35299 (scope of variables in statement function do not acquire rank from host)

2018-02-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

PR fortran/35299
* gfortran.dg/statement_function_3.f: New test.

2018-02-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

PR fortran/35299
* resolve.c (resolve_formal_arglist): Update error message.

From-SVN: r257566

6 years agore PR fortran/54223 (Statement function statement with dummy arguments that are also...
Steven G. Kargl [Sun, 11 Feb 2018 18:44:05 +0000 (18:44 +0000)]
re PR fortran/54223 (Statement function statement with dummy arguments that are also OPTIONAL may crash in wrong calls)

2018-02-11  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/54223
PR fortran/84276
* interface.c (compare_actual_formal): Add in_statement_function
bool parameter.  Skip check of INTENT attribute for statement
functions.  Arguments to a statement function cannot be optional,
issue error for missing argument.
(gfc_procedure_use, gfc_ppc_use, gfc_arglist_matches_symbol): Use
in_statement_function.

2018-02-11  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/54223
PR fortran/84276
* gfortran.dg/statement_function_1.f90: New test.
* gfortran.dg/statement_function_2.f90: New test.

From-SVN: r257565

6 years agore PR fortran/84074 (Incorrect indexing of array when actual argument is an array...
Paul Thomas [Sun, 11 Feb 2018 18:22:24 +0000 (18:22 +0000)]
re PR fortran/84074 (Incorrect indexing of array when actual argument is an array expression and dummy is polymorphic)

2018-02-11  Paul Thomas  <pault@gcc.gnu.org>

PR fortran/84074
* trans-expr.c (gfc_conv_derived_to_class): Set the use_offset
flag. If the is a vector subscript or the expression is not a
variable, make the descriptor one-based.

2018-02-11  Paul Thomas  <pault@gcc.gnu.org>

PR fortran/84074
* gfortran.dg/type_to_class_5.f03: New test.

From-SVN: r257564

6 years ago[LVU] deal with md final_scan_insn
Alexandre Oliva [Sun, 11 Feb 2018 15:26:11 +0000 (15:26 +0000)]
[LVU] deal with md final_scan_insn

Ports call final_scan_insn with seen == NULL, and then
maybe_output_next_view crashes because it assumes it's
non-NULL.  Oops.  Fixed.

for  gcc/ChangeLog

* final.c (final_scan_insn_1): Renamed from...
(final_scan_insn): ... this.  New wrapper, to recover
seen from the outermost call in recursive ones.
* config/sparc/sparc.c (output_return): Drop seen from call.
(output_sibcall): Likewise.
* config/visium/visium.c (output_branch): Likewise.

From-SVN: r257562

6 years agoDaily bump.
GCC Administrator [Sun, 11 Feb 2018 00:16:13 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r257559

6 years agopa.c (hppa_profile_hook): Mark SYMBOL_REF for _mcount as function label.
John David Anglin [Sat, 10 Feb 2018 23:15:53 +0000 (23:15 +0000)]
pa.c (hppa_profile_hook): Mark SYMBOL_REF for _mcount as function label.

* config/pa/pa.c (hppa_profile_hook): Mark SYMBOL_REF for _mcount as
function label.

From-SVN: r257554

6 years agore PR fortran/84141 (Internal error: type_name(): Bad type)
Paul Thomas [Sat, 10 Feb 2018 18:16:14 +0000 (18:16 +0000)]
re PR fortran/84141 (Internal error: type_name(): Bad type)

2018-02-10  Paul Thomas  <pault@gcc.gnu.org>

PR fortran/84141
PR fortran/84155
* trans-array.c (gfc_array_init_size): Revert the change made
in revision 257356 setting the dtype.
* trans-types.c (gfc_get_dtype): Do not use the cached dtype.
Call gfc_get_dtype_rank_type every time.

PR fortran/56691
* trans-array.c (gfc_conv_expr_descriptor): If the source array
is a descriptor type, use its offset, removing the condition
that is be a class expression.

2018-02-10  Paul Thomas  <pault@gcc.gnu.org>

PR fortran/56691
* gfortran.dg/type_to_class_4.f03: New test.

From-SVN: r257550

6 years agoPR84300, ICE in dwarf2cfi on ppc64le with -fsplit-stack -fno-omit-frame-pointer
Alan Modra [Sat, 10 Feb 2018 04:49:15 +0000 (15:19 +1030)]
PR84300, ICE in dwarf2cfi on ppc64le with -fsplit-stack -fno-omit-frame-pointer

PR target/84300
gcc/
* config/rs6000/rs6000.md (split_stack_return): Remove (use ..).
Specify LR as an input.
gcc/testsuite/
* gcc.dg/pr84300.c: New.

From-SVN: r257549

6 years agoDaily bump.
GCC Administrator [Sat, 10 Feb 2018 00:16:12 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r257548

6 years agore PR sanitizer/83987 (ICE with OpenMP, sanitizer and virtual bases)
Jakub Jelinek [Fri, 9 Feb 2018 23:22:43 +0000 (00:22 +0100)]
re PR sanitizer/83987 (ICE with OpenMP, sanitizer and virtual bases)

PR sanitizer/83987
* omp-low.c (maybe_remove_omp_member_access_dummy_vars,
remove_member_access_dummy_vars): New functions.
(lower_omp_for, lower_omp_taskreg, lower_omp_target,
lower_omp_1, execute_lower_omp): Use them.

* tree.c (cp_free_lang_data): Revert 2018-01-23 change.

* g++.dg/ubsan/pr83987-2.C: New test.

From-SVN: r257545

6 years agore PR rtl-optimization/84308 (Memory leak in spread_components)
Jakub Jelinek [Fri, 9 Feb 2018 23:21:35 +0000 (00:21 +0100)]
re PR rtl-optimization/84308 (Memory leak in spread_components)

PR rtl-optimization/84308
* shrink-wrap.c (spread_components): Release todo vector.

From-SVN: r257544

6 years agore PR target/83926 (ICE during RTL pass: ira, in elimination_costs_in_insn, at reload...
Peter Bergner [Fri, 9 Feb 2018 22:03:43 +0000 (16:03 -0600)]
re PR target/83926 (ICE during RTL pass: ira, in elimination_costs_in_insn, at reload1.c:3633)

PR target/83926
* gcc.target/powerpc/pr83926.c: Filter out gimple folding disabled
message.

From-SVN: r257543

6 years agoPR c++/81917 - ICE with void_t and partial specialization.
Jason Merrill [Fri, 9 Feb 2018 21:01:49 +0000 (16:01 -0500)]
PR c++/81917 - ICE with void_t and partial specialization.

* pt.c (instantiate_class_template_1): Set TYPE_BEING_DEFINED before
calling most_specialized_partial_spec.

From-SVN: r257542

6 years agovsx-vector-6-le.c: Update CPU target.
Will Schmidt [Fri, 9 Feb 2018 20:59:40 +0000 (20:59 +0000)]
vsx-vector-6-le.c: Update CPU target.

[testsuite]

2018-02-07  Will Schmidt  <will_schmidt@vnet.ibm.com>

* gcc.target/powerpc/vsx-vector-6-le.c:  Update CPU target.
* gcc.target/powerpc/vsx-vector-6-le.p9.c:  New.

From-SVN: r257541

6 years agocompiler: track //go:nointerface in export data
Ian Lance Taylor [Fri, 9 Feb 2018 19:39:14 +0000 (19:39 +0000)]
compiler: track //go:nointerface in export data

    The magic //go:nointerface comment, used for field tracking, was only
    implemented for conversions to interface types in the same package.
    Record it in the export data, so that it works as expected for types
    imported from a different package.

    Reviewed-on: https://go-review.googlesource.com/93075

From-SVN: r257540

6 years ago[PR c/84293] Unexpected strict-alias warning
Nathan Sidwell [Fri, 9 Feb 2018 19:31:10 +0000 (19:31 +0000)]
[PR c/84293] Unexpected strict-alias warning

https://gcc.gnu.org/ml/gcc-patches/2018-02/msg00510.html
PR c/84293
gcc/c/
* c-typeck.c (build_indirect_ref, build_c_cast): Pass expr location
to strict_aliasing_warning.

gcc/c-family/
* c-common.h (strict_aliasing_warning): Drop OTYPE arg, insert LOC
arg.
* c-warn.c (strict_aliasing_warning): Drop OTYPE arg, require LOC
arg.  Adjust.

gcc/cp/
* typeck.c (cp_build_indirect_ref_1, build_reinterpret_cast_1):
Pass expr location to strict_aliasing_warning.

gcc/testsuite/
* c-c++-common/pr84293.h: New.
* c-c++-common/pr84293.c: New.

From-SVN: r257539

6 years agoPR c++/84296 - ICE with qualified-id in template.
Jason Merrill [Fri, 9 Feb 2018 19:10:42 +0000 (14:10 -0500)]
PR c++/84296 - ICE with qualified-id in template.

PR c++/83714
* pt.c (unknown_base_ref_p): New.
(instantiation_dependent_scope_ref_p): Use it instead of
any_dependent_bases_p.

From-SVN: r257538

6 years agore PR rtl-optimization/57193 (suboptimal register allocation for SSE registers)
Vladimir Makarov [Fri, 9 Feb 2018 18:23:58 +0000 (18:23 +0000)]
re PR rtl-optimization/57193 (suboptimal register allocation for SSE registers)

2018-02-09  Vladimir Makarov  <vmakarov@redhat.com>

PR rtl-optimization/57193
* ira-color.c (struct allocno_color_data): Add member
conflict_allocno_hard_prefs.
(update_conflict_allocno_hard_prefs): New.
(bucket_allocno_compare_func): Add a preference based on
conflict_allocno_hard_prefs.
(push_allocno_to_stack): Update conflict_allocno_hard_prefs.
(color_allocnos): Remove a dead code.  Initiate
conflict_allocno_hard_prefs.  Call update_costs_from_prefs.

2018-02-09  Vladimir Makarov  <vmakarov@redhat.com>

PR rtl-optimization/57193
* gcc.target/i386/57193.c: New.

From-SVN: r257537

6 years agore PR target/84226 (ICE in simplify_const_unary_operation, at simplify-rtx.c:1974...
Jakub Jelinek [Fri, 9 Feb 2018 18:19:08 +0000 (19:19 +0100)]
re PR target/84226 (ICE in simplify_const_unary_operation, at simplify-rtx.c:1974 on ppc64le)

PR target/84226
* config/rs6000/vsx.md (p9_xxbrq_v16qi): Change input operand
constraint from =wa to wa.  Avoid a subreg on the output operand,
instead use a pseudo and subreg it in a move.
(p9_xxbrd_<mode>): Changed to ...
(p9_xxbrd_v2di): ... this insn, without VSX_D iterator.
(p9_xxbrd_v2df): New expander.
(p9_xxbrw_<mode>): Changed to ...
(p9_xxbrw_v4si): ... this insn, without VSX_W iterator.
(p9_xxbrw_v4sf): New expander.

* gcc.target/powerpc/pr84226.c: New test.

From-SVN: r257536

6 years agobuiltins-1-be.c: Rename duplicate test from this to...
Peter Bergner [Fri, 9 Feb 2018 18:02:15 +0000 (12:02 -0600)]
builtins-1-be.c: Rename duplicate test from this to...

* gcc.target/powerpc/builtins-1-be.c <vclzb>: Rename duplicate test
from this to...
<vclzd>: ...this.

From-SVN: r257535

6 years agoPR lto/84212 - -Wno-* does not disable warnings from -flto link stage
Martin Sebor [Fri, 9 Feb 2018 17:58:54 +0000 (17:58 +0000)]
PR lto/84212 - -Wno-* does not disable warnings from -flto link stage

gcc/c-family/ChangeLog:

PR lto/84212
* c.opt (-Wstringop-overflow, -Warray-bounds): Add LTO.
(-Walloc-size-larger-than, -Wformat-truncation=): Same.
(-Wmaybe-uninitialized, -Wnonnull, -Wrestrict): Same.
(-Wstrict-overflow, -Wsuggest-attribute): Same.
(-Wuninitialized): Same.

gcc/testsuite/ChangeLog:

PR lto/84212
* gcc.dg/lto/pr84212_0.c: New test file.
* gcc.dg/lto/pr84212_1.c: Same.

From-SVN: r257534

6 years agorx.md: updated "movsicc" expand to be matched by GCC
Sebastian Perta [Fri, 9 Feb 2018 17:43:11 +0000 (17:43 +0000)]
rx.md: updated "movsicc" expand to be matched by GCC

2018-02-09  Sebastian Perta  <sebastian.perta@renesas.com>

*config/rx.md: updated "movsicc" expand to be matched by GCC
*testsuite/gcc.target/rx/movsicc.c: new test case

From-SVN: r257533

6 years agore PR target/83926 (ICE during RTL pass: ira, in elimination_costs_in_insn, at reload...
Peter Bergner [Fri, 9 Feb 2018 16:32:37 +0000 (10:32 -0600)]
re PR target/83926 (ICE during RTL pass: ira, in elimination_costs_in_insn, at reload1.c:3633)

gcc/
PR target/83926
* config/rs6000/vsx.md (vsx_mul_v2di): Handle generating a 64-bit
multiply in 32-bit mode.
(vsx_div_v2di): Handle generating a 64-bit signed divide in 32-bit mode.
(vsx_udiv_v2di): Handle generating a 64-bit unsigned divide in 32-bit
mode.

gcc/testsuite/
PR target/83926
* gcc.target/powerpc/pr83926.c: New test.
* gcc.target/powerpc/builtins-1-be.c: Filter out gimple folding disabled
message.  Fix test for running in 32-bit mode.

From-SVN: r257531

6 years agoconstraints.md: added new constraint CALL_OP_SYMBOL_REF to allow or block "symbol_ref"...
Sebastian Perta [Fri, 9 Feb 2018 16:17:13 +0000 (16:17 +0000)]
constraints.md: added new constraint CALL_OP_SYMBOL_REF to allow or block "symbol_ref"...

2018-02-09  Sebastian Perta  <sebastian.perta@renesas.com>

* config/rx/constraints.md: added new constraint CALL_OP_SYMBOL_REF
to allow or block "symbol_ref" depending on value of TARGET_JSR
* config/rx/rx.md: use CALL_OP_SYMBOL_REF in call_internal and
call_value_internal insns

From-SVN: r257529

6 years ago* Makefile.am (GOTOOLS_TEST_TIMEOUT): Double value.
Ian Lance Taylor [Fri, 9 Feb 2018 15:05:17 +0000 (15:05 +0000)]
* Makefile.am (GOTOOLS_TEST_TIMEOUT): Double value.

From-SVN: r257527

6 years agoDWARF: no location for non-definition DECLs with non-trivial DECL_VALUE_EXPR
Pierre-Marie de Rodat [Fri, 9 Feb 2018 14:02:37 +0000 (14:02 +0000)]
DWARF: no location for non-definition DECLs with non-trivial DECL_VALUE_EXPR

This patch restricts the set of cases in which we allow the generation of
location attributes for variables that are not defined in the current unit.
For such variables with complex DECL_VALUE_EXPR trees, generating a location
attribute can end up creating relocations to text symbols in the debug section
of LTO object files, which is not valid.

gcc/
PR lto/84213
* dwarf2out.c (is_trivial_indirect_ref): New function.
(dwarf2out_late_global_decl): Do not generate a location
attribute for variables that have a non-trivial DECL_VALUE_EXPR
and that are not defined in the current unit.

From-SVN: r257526

6 years agooptabs.c (prepare_cmp_insn): Try harder to emit a direct comparison instead of a...
Eric Botcazou [Fri, 9 Feb 2018 12:33:40 +0000 (12:33 +0000)]
optabs.c (prepare_cmp_insn): Try harder to emit a direct comparison instead of a libcall for UNORDERED.

* optabs.c (prepare_cmp_insn): Try harder to emit a direct comparison
instead of a libcall for UNORDERED.

From-SVN: r257525

6 years agore PR target/82641 (Unable to enable crc32 for a certain function with target attribu...
Tamar Christina [Fri, 9 Feb 2018 12:23:46 +0000 (12:23 +0000)]
re PR target/82641 (Unable to enable crc32 for a certain function with target attribute on ARM (aarch32))

2018-02-09  Tamar Christina  <tamar.christina@arm.com>

PR target/82641
* config/arm/arm-c.c (arm_cpu_builtins): Un-define __ARM_FEATURE_LDREX,
__ARM_ARCH_PROFILE, __ARM_ARCH_ISA_THUMB, __ARM_FP and __ARM_NEON_FP.

gcc/testsuite
2018-02-09  Tamar Christina  <tamar.christina@arm.com>

PR target/82641
* gcc.target/arm/pragma_arch_switch_2.c: Use armv6 and armv5t.

From-SVN: r257524

6 years agoS/390: Fix PR84295
Andreas Krebbel [Fri, 9 Feb 2018 11:42:34 +0000 (11:42 +0000)]
S/390: Fix PR84295

gcc/ChangeLog:

2018-02-09  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

PR target/PR84295
* config/s390/s390.c (s390_set_current_function): Invoke
s390_indirect_branch_settings also if fndecl didn't change.

gcc/testsuite/ChangeLog:

2018-02-09  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

PR target/PR84295
* gcc.target/s390/pr84295.c: New test.

From-SVN: r257522

6 years agore PR c++/77522 (ICE on invalid code C++14 code: in tsubst_decl, at cp/pt.c:12447)
Paolo Carlini [Fri, 9 Feb 2018 11:37:14 +0000 (11:37 +0000)]
re PR c++/77522 (ICE on invalid code C++14 code: in tsubst_decl, at cp/pt.c:12447)

2018-02-09  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/77522
* g++.dg/cpp1y/lambda-init16.C: New.

From-SVN: r257521

6 years ago[LVU] set ppc64 blockage's length to zero
Alexandre Oliva [Fri, 9 Feb 2018 10:39:28 +0000 (10:39 +0000)]
[LVU] set ppc64 blockage's length to zero

LVU requires the zero-length (pseudo) insns's length to reflect
reality.  If they don't, it may assume there's a PC change where there
isn't any, and then a view-aware assembler will detect the problem and
complain about out-of-sync views.

ppc blockage pseudo-insns did not have the length attribute explicitly
set in them, so they inherited the attribute's default value, and that
was nonzero.

for  gcc/ChangeLog

* config/rs6000/rs6000.md (blockage): Set length to zero.

From-SVN: r257520

6 years ago* expr.c (optimize_bitfield_assignment_op): Remove obsolete assertion.
Eric Botcazou [Fri, 9 Feb 2018 09:50:14 +0000 (09:50 +0000)]
* expr.c (optimize_bitfield_assignment_op): Remove obsolete assertion.

From-SVN: r257519

6 years agore PR target/84278 (claims initv4sfv2sf is available but inits through stack)
Richard Biener [Fri, 9 Feb 2018 09:19:34 +0000 (09:19 +0000)]
re PR target/84278 (claims initv4sfv2sf is available but inits through stack)

2018-02-09  Richard Biener  <rguenther@suse.de>

PR tree-optimization/84278
* gcc.target/i386/pr84278.c: Adjust regex.

From-SVN: r257518

6 years agoc-ada-spec.c (dump_ada_declaration): Do not generate the 'constant' keyword for compo...
Eric Botcazou [Fri, 9 Feb 2018 08:54:54 +0000 (08:54 +0000)]
c-ada-spec.c (dump_ada_declaration): Do not generate the 'constant' keyword for components.

* c-ada-spec.c (dump_ada_declaration): Do not generate the 'constant'
keyword for components.

From-SVN: r257517

6 years agore PR tree-optimization/84232 (gcc.dg/tree-ssa/ssa-dom-cse-2.c fail with -march=silve...
Jakub Jelinek [Fri, 9 Feb 2018 06:44:43 +0000 (07:44 +0100)]
re PR tree-optimization/84232 (gcc.dg/tree-ssa/ssa-dom-cse-2.c fail with -march=silvermont)

PR tree-optimization/84232
* gcc.dg/tree-ssa/ssa-dom-cse-2.c: Add -mtune-generic on x86.

From-SVN: r257516

6 years agore PR sanitizer/84285 (Fail to statically link with -fsanitize=undefined)
Jakub Jelinek [Fri, 9 Feb 2018 06:44:06 +0000 (07:44 +0100)]
re PR sanitizer/84285 (Fail to statically link with -fsanitize=undefined)

PR sanitizer/84285
* gcc.c (STATIC_LIBASAN_LIBS, STATIC_LIBTSAN_LIBS,
STATIC_LIBLSAN_LIBS, STATIC_LIBUBSAN_LIBS): Handle -static like
-static-lib*san.

From-SVN: r257515

6 years agore PR debug/84252 (ICE in get_tracked_reg_offset when building libvpx for aarch64)
Jakub Jelinek [Fri, 9 Feb 2018 05:48:33 +0000 (06:48 +0100)]
re PR debug/84252 (ICE in get_tracked_reg_offset when building libvpx for aarch64)

PR debug/84252
* var-tracking.c (vt_add_function_parameter): Punt for non-onepart
PARALLEL incoming that failed vt_get_decl_and_offset check.

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

From-SVN: r257514

6 years agore PR middle-end/84237 (xen build faiulre only zero initializers are allowed in secti...
Jakub Jelinek [Fri, 9 Feb 2018 05:47:24 +0000 (06:47 +0100)]
re PR middle-end/84237 (xen build faiulre only zero initializers are allowed in section '.bss.page_aligned.const')

PR middle-end/84237
* output.h (bss_initializer_p): Add NAMED argument, defaulted to false.
* varasm.c (bss_initializer_p): Add NAMED argument, if true, ignore
TREE_READONLY bit.
(get_variable_section): For decls in named .bss* sections pass true as
second argument to bss_initializer_p.

* gcc.dg/pr84237.c: New test.

From-SVN: r257513

6 years agore PR c++/83659 (ICE on compilable C++ code: in tree_to_shwi, at tree.c:6821)
Marek Polacek [Fri, 9 Feb 2018 05:46:18 +0000 (05:46 +0000)]
re PR c++/83659 (ICE on compilable C++ code: in tree_to_shwi, at tree.c:6821)

PR c++/83659
* fold-const.c (fold_indirect_ref_1): Use VECTOR_TYPE_P macro.
Formatting fixes.  Verify first that tree_fits_poly_int64_p (op01).
Sync some changes from cxx_fold_indirect_ref.

* constexpr.c (cxx_fold_indirect_ref): Sync some changes from
fold_indirect_ref_1, including poly_*int64.  Verify first that
tree_fits_poly_int64_p (op01).  Formatting fixes.

* g++.dg/torture/pr83659.C: New test.

Co-Authored-By: Jakub Jelinek <jakub@redhat.com>
From-SVN: r257512

6 years ago[IEPM] Introduce inline entry point markers
Alexandre Oliva [Fri, 9 Feb 2018 02:22:11 +0000 (02:22 +0000)]
[IEPM] Introduce inline entry point markers

Output DW_AT_entry_pc based on markers.

Introduce DW_AT_GNU_entry_view as a DWARF extension.

If views are enabled are we're not in strict compliance mode, output
DW_AT_GNU_entry_view if it might be nonzero.

This patch depends on SFN and LVU patchsets, and on the IEPM patch that
introduces the inline_entry debug hook.

for  include/ChangeLog

* dwarf2.def (DW_AT_GNU_entry_view): New.

for  gcc/ChangeLog

* cfgexpand.c (expand_gimple_basic_block): Handle inline entry
markers.
* dwarf2out.c (dwarf2_debug_hooks): Enable inline_entry hook.
(BLOCK_INLINE_ENTRY_LABEL): New.
(dwarf2out_var_location): Disregard inline entry markers.
(inline_entry_data): New struct.
(inline_entry_data_hasher): New hashtable type.
(inline_entry_data_hasher::hash): New.
(inline_entry_data_hasher::equal): New.
(inline_entry_data_table): New variable.
(add_high_low_attributes): Add DW_AT_entry_pc and
DW_AT_GNU_entry_view attributes if a pending entry is found
in inline_entry_data_table.  Add old entry_pc attribute only
if debug nonbinding markers are disabled.
(gen_inlined_subroutine_die): Set BLOCK_DIE if nonbinding
markers are enabled.
(block_within_block_p, dwarf2out_inline_entry): New.
(dwarf2out_finish): Check that no entries remained in
inline_entry_data_table.
* final.c (reemit_insn_block_notes): Handle inline entry notes.
(final_scan_insn, notice_source_line): Likewise.
(rest_of_clean_state): Skip inline entry markers.
* gimple-pretty-print.c (dump_gimple_debug): Handle inline entry
markers.
* gimple.c (gimple_build_debug_inline_entry): New.
* gimple.h (enum gimple_debug_subcode): Add
GIMPLE_DEBUG_INLINE_ENTRY.
(gimple_build_debug_inline_entry): Declare.
(gimple_debug_inline_entry_p): New.
(gimple_debug_nonbind_marker_p): Adjust.
* insn-notes.def (INLINE_ENTRY): New.
* print-rtl.c (rtx_writer::print_rtx_operand_code_0): Handle
inline entry marker notes.
(print_insn): Likewise.
* rtl.h (NOTE_MARKER_P): Add INLINE_ENTRY support.
(INSN_DEBUG_MARKER_KIND): Likewise.
(GEN_RTX_DEBUG_MARKER_INLINE_ENTRY_PAT): New.
* tree-inline.c (expand_call_inline): Build and insert
debug_inline_entry stmt.
* tree-ssa-live.c (remove_unused_scope_block_p): Preserve
inline entry blocks early, if nonbind markers are enabled.
(dump_scope_block): Dump fragment info.
* var-tracking.c (reemit_marker_as_note): Handle inline entry note.
* doc/gimple.texi (gimple_debug_inline_entry_p): New.
(gimple_build_debug_inline_entry): New.
* doc/invoke.texi (gstatement-frontiers, gno-statement-frontiers):
Enable/disable inline entry points too.
* doc/rtl.texi (NOTE_INSN_INLINE_ENTRY): New.
(DEBUG_INSN): Describe inline entry markers.

From-SVN: r257511

6 years ago[LVU] Introduce location views
Alexandre Oliva [Fri, 9 Feb 2018 02:21:57 +0000 (02:21 +0000)]
[LVU] Introduce location views

This patch introduces an option to enable the generation of location
views along with location lists.  The exact format depends on the
DWARF version: it can be a separate attribute (DW_AT_GNU_locviews) or
(DW_LLE_view_pair) entries in DWARF5+ loclists.

Line number tables are also affected.  If the assembler is found, at
compiler build time, to support .loc views, we use them and
assembler-computed view labels, otherwise we output compiler-generated
line number programs with conservatively-computed view labels.  In
either case, we output view information next to line number changes
when verbose assembly output is requested.

This patch requires an LVU patch that modifies the exported API of
final_scan_insn.  It also expects the entire SFN patchset to be
installed first, although SFN is not a requirement for LVU.

for  include/ChangeLog

* dwarf2.def (DW_AT_GNU_locviews): New.
* dwarf2.h (enum dwarf_location_list_entry_type): Add
DW_LLE_GNU_view_pair.
(DW_LLE_view_pair): Define.

for  gcc/ChangeLog

* common.opt (gvariable-location-views): New.
(gvariable-location-views=incompat5): New.
* config.in: Rebuilt.
* configure: Rebuilt.
* configure.ac: Test assembler for view support.
* dwarf2asm.c (dw2_asm_output_symname_uleb128): New.
* dwarf2asm.h (dw2_asm_output_symname_uleb128): Declare.
* dwarf2out.c (var_loc_view): New typedef.
(struct dw_loc_list_struct): Add vl_symbol, vbegin, vend.
(dwarf2out_locviews_in_attribute): New.
(dwarf2out_locviews_in_loclist): New.
(dw_val_equal_p): Compare val_view_list of dw_val_class_view_lists.
(enum dw_line_info_opcode): Add LI_adv_address.
(struct dw_line_info_table): Add view.
(RESET_NEXT_VIEW, RESETTING_VIEW_P): New macros.
(DWARF2_ASM_VIEW_DEBUG_INFO): Define default.
(zero_view_p): New variable.
(ZERO_VIEW_P): New macro.
(output_asm_line_debug_info): New.
(struct var_loc_node): Add view.
(add_AT_view_list, AT_loc_list): New.
(add_var_loc_to_decl): Add view param.  Test it against last.
(new_loc_list): Add view params.  Record them.
(AT_loc_list_ptr): Handle loc and view lists.
(view_list_to_loc_list_val_node): New.
(print_dw_val): Handle dw_val_class_view_list.
(size_of_die): Likewise.
(value_format): Likewise.
(loc_list_has_views): New.
(gen_llsym): Set vl_symbol too.
(maybe_gen_llsym, skip_loc_list_entry): New.
(dwarf2out_maybe_output_loclist_view_pair): New.
(output_loc_list): Output view list or entries too.
(output_view_list_offset): New.
(output_die): Handle dw_val_class_view_list.
(output_dwarf_version): New.
(output_compilation_unit_header): Use it.
(output_skeleton_debug_sections): Likewise.
(output_rnglists, output_line_info): Likewise.
(output_pubnames, output_aranges): Update version comments.
(output_one_line_info_table): Output view numbers in asm comments.
(dw_loc_list): Determine current endview, pass it to new_loc_list.
Call maybe_gen_llsym.
(loc_list_from_tree_1): Adjust.
(add_AT_location_description): Create view list attribute if
needed, check it's absent otherwise.
(convert_cfa_to_fb_loc_list): Adjust.
(maybe_emit_file): Call output_asm_line_debug_info for test.
(dwarf2out_var_location): Reset views as needed.  Precompute
add_var_loc_to_decl args.  Call get_attr_min_length only if we have the
attribute.  Set view.
(new_line_info_table): Reset next view.
(set_cur_line_info_table): Call output_asm_line_debug_info for test.
(dwarf2out_source_line): Likewise.  Output view resets and labels to
the assembler, or select appropriate line info opcodes.
(prune_unused_types_walk_attribs): Handle dw_val_class_view_list.
(optimize_string_length): Catch it.  Adjust.
(resolve_addr): Copy vl_symbol along with ll_symbol.  Handle
dw_val_class_view_list, and remove it if no longer needed.
(hash_loc_list): Hash view numbers.
(loc_list_hasher::equal): Compare them.
(optimize_location_lists): Check whether a view list symbol is
needed, and whether the locview attribute is present, and
whether they match.  Remove the locview attribute if no longer
needed.
(index_location_lists): Call skip_loc_list_entry for test.
(dwarf2out_finish): Call output_asm_line_debug_info for test.
Use output_dwarf_version.
* dwarf2out.h (enum dw_val_class): Add dw_val_class_view_list.
(struct dw_val_node): Add val_view_list.
* final.c (SEEN_NEXT_VIEW): New.
(set_next_view_needed): New.
(clear_next_view_needed): New.
(maybe_output_next_view): New.
(final_start_function): Rename to...
(final_start_function_1): ... this.  Take pointer to FIRST,
add SEEN parameter.  Emit param bindings in the initial view.
(final_start_function): Reintroduce SEEN-less interface.
(final): Rename to...
(final_1): ... this.  Take SEEN parameter.  Output final pending
next view at the end.
(final): Reintroduce seen-less interface.
(final_scan_insn): Output pending next view before switching
sections or ending a block.  Mark the next view as needed when
outputting variable locations.  Notify debug backend of section
changes, and of location view changes.
(rest_of_handle_final): Adjust.
* toplev.c (process_options): Autodetect value for debug variable
location views option.  Warn on incompat5 without -gdwarf-5.
* doc/invoke.texi (gvariable-location-views): New.
(gvariable-location-views=incompat5): New.
(gno-variable-location-views): New.

From-SVN: r257510

6 years agoFix ICE in find_taken_edge_computed_goto (PR 84136)
David Malcolm [Fri, 9 Feb 2018 01:07:11 +0000 (01:07 +0000)]
Fix ICE in find_taken_edge_computed_goto (PR 84136)

PR 84136 reports an ICE within sccvn_dom_walker when handling a
C/C++ source file that overuses the labels-as-values extension.
The code in question stores a jump label into a global, and then
jumps to it from another function, which ICEs after inlining:

void* a;

void foo() {
  if ((a = &&l))
      return;

  l:;
}

int main() {
  foo();
  goto *a;

  return 0;
}

This appears to be far beyond what we claim to support in this
extension - but we shouldn't ICE.

What's happening is that, after inlining, we have usage of a *copy*
of the label, which optimizes away the if-return logic, turning it
into an infinite loop.

On entry to the sccvn_dom_walker we have this gimple:

main ()
{
  void * a.0_1;

  <bb 2> [count: 0]:
  a = &l;

  <bb 3> [count: 0]:
l:
  a.0_1 = a;
  goto a.0_1;
}

and:
  edge taken = find_taken_edge (bb, vn_valueize (val));
reasonably valueizes the:
  goto a.0_1;
after the:
  a = &l;
  a.0_1 = a;
as if it were:
  goto *&l;

find_taken_edge_computed_goto then has:

2380   dest = label_to_block (val);
2381   if (dest)
2382     {
2383       e = find_edge (bb, dest);
2384       gcc_assert (e != NULL);
2385     }

which locates dest as a self-jump from block 3 back to itself.

However, the find_edge call returns NULL - it has a predecessor edge
from block 2, but no successor edges.

Hence the assertion fails and we ICE.

A successor edge from the computed goto could have been created by
make_edges if the label stmt had been in the function, but make_edges
only looks in the current function when handling computed gotos, and
the label only appeared after inlining.

The following patch removes the assertion, fixing the ICE.

gcc/testsuite/ChangeLog:
PR tree-optimization/84136
* gcc.c-torture/compile/pr84136.c: New test.

gcc/ChangeLog:
PR tree-optimization/84136
* tree-cfg.c (find_taken_edge_computed_goto): Remove assertion
that the result of find_edge is non-NULL.

From-SVN: r257509

6 years agoDaily bump.
GCC Administrator [Fri, 9 Feb 2018 00:16:14 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r257508

6 years agore PR target/83008 ([performance] Is it better to avoid extra instructions in data...
Sergey Shalnov [Thu, 8 Feb 2018 22:31:15 +0000 (23:31 +0100)]
re PR target/83008 ([performance] Is it better to avoid extra instructions in data passing between loops?)

PR target/83008
* config/i386/x86-tune-costs.h (skylake_cost): Fix cost of
storing integer register in SImode.  Fix cost of 256 and 512
byte aligned SSE register store.

* config/i386/i386.c (ix86_multiplication_cost): Fix
multiplication cost for TARGET_AVX512DQ.

testsuite/ChangeLog:

PR target/83008
* gcc.target/i386/pr83008.c: New test.

From-SVN: r257505

6 years agore PR target/81143 (New test case gcc.target/powerpc/pr79799-2.c fails on powerpc BE)
Peter Bergner [Thu, 8 Feb 2018 20:40:32 +0000 (14:40 -0600)]
re PR target/81143 (New test case gcc.target/powerpc/pr79799-2.c fails on powerpc BE)

PR target/81143
* gcc.target/powerpc/pr79799-2.c: Use __LITTLE_ENDIAN__.

From-SVN: r257504

6 years agoconstexpr.c (cxx_eval_component_reference): Use INDIRECT_REF_P.
Paolo Carlini [Thu, 8 Feb 2018 18:56:17 +0000 (18:56 +0000)]
constexpr.c (cxx_eval_component_reference): Use INDIRECT_REF_P.

2018-02-08  Paolo Carlini  <paolo.carlini@oracle.com>

* constexpr.c (cxx_eval_component_reference): Use INDIRECT_REF_P.
* lambda.c (build_capture_proxy): Likewise.
* search.c (field_access_p): Likewise.
* semantics.c (omp_clause_decl, omp_privatize_field,
finish_omp_clauses): Likewise.

From-SVN: r257503

6 years agore PR c++/83806 (Spurious -Wunused-but-set-parameter with nullptr)
Paolo Carlini [Thu, 8 Feb 2018 18:54:39 +0000 (18:54 +0000)]
re PR c++/83806 (Spurious -Wunused-but-set-parameter with nullptr)

/cp
2018-02-08  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/83806
* typeck.c (decay_conversion): Use mark_rvalue_use for the special
case of nullptr too.

/testsuite
2018-02-08  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/83806
* g++.dg/warn/Wunused-parm-11.C: New.

From-SVN: r257502

6 years agoMark previous change with:
Mike Stump [Thu, 8 Feb 2018 18:39:43 +0000 (18:39 +0000)]
Mark previous change with:

PR target/84113

From-SVN: r257500

6 years agore PR tree-optimization/84238 (ICE tree check: expected integer_cst, have plus_expr...
Marek Polacek [Thu, 8 Feb 2018 16:18:04 +0000 (16:18 +0000)]
re PR tree-optimization/84238 (ICE tree check: expected integer_cst, have plus_expr in to_wide, at tree.h:5527)

PR tree-optimization/84238
* tree-ssa-strlen.c (maybe_diag_stxncpy_trunc): Verify the result of
get_range_strlen.

* gcc.dg/Wstringop-overflow-3.c: New test.

From-SVN: r257497

6 years ago[C++ PATCH] initializer_list diagnostic
Nathan Sidwell [Thu, 8 Feb 2018 16:11:39 +0000 (16:11 +0000)]
[C++ PATCH] initializer_list diagnostic

https://gcc.gnu.org/ml/gcc-patches/2018-02/msg00434.html
* class.c (finish_struct): Fix std:initializer_list diagnostic
formatting.

* g++.dg/cpp0x/initlist93.C: Adjust diagnostic.

From-SVN: r257496

6 years agoruntime: get missing function name from symbol table
Ian Lance Taylor [Thu, 8 Feb 2018 15:37:43 +0000 (15:37 +0000)]
runtime: get missing function name from symbol table

    If we trace back through code that has no debug info, as when calling
    through C code compiled with -g0, we won't have a function name.
    Try to fetch the function name using the symbol table.

    Adding the test case revealed that gotest failed to use the gccgo tag
    when matching files, so add that.

    Reviewed-on: https://go-review.googlesource.com/92756

From-SVN: r257495

6 years agoMakefile.am (check-gccgo, check-gcc): Add options to pick up target libstdc++, to...
Ian Lance Taylor [Thu, 8 Feb 2018 15:34:42 +0000 (15:34 +0000)]
Makefile.am (check-gccgo, check-gcc): Add options to pick up target libstdc++, to permit tests that use C++.

* Makefile.am (check-gccgo, check-gcc): Add options to pick up
target libstdc++, to permit tests that use C++.
* Makefile.in: Rebuild.

From-SVN: r257494

6 years agolibgo: update to Go1.10rc2
Ian Lance Taylor [Thu, 8 Feb 2018 15:30:22 +0000 (15:30 +0000)]
libgo: update to Go1.10rc2

    Reviewed-on: https://go-review.googlesource.com/92736

From-SVN: r257493

6 years agoAnother fix for single-element permutes (PR 84265)
Richard Sandiford [Thu, 8 Feb 2018 15:17:20 +0000 (15:17 +0000)]
Another fix for single-element permutes (PR 84265)

PR83753 was about a case in which we ended up trying to "vectorise"
a group of loads ore stores using single-element vectors.  The problem
was that we were classifying the load or store as VMAT_CONTIGUOUS_PERMUTE
rather than VMAT_CONTIGUOUS, even though it doesn't make sense to permute
a single-element vector.

In that PR it was enough to change get_group_load_store_type,
because vectorisation ended up being unprofitable and so we didn't
take things further.  But when vectorisation is profitable, the same
fix is needed in vectorizable_load and vectorizable_store.

2018-02-08  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/
PR tree-optimization/84265
* tree-vect-stmts.c (vectorizable_store): Don't treat
VMAT_CONTIGUOUS accesses as grouped.
(vectorizable_load): Likewise.

gcc/testsuite/
PR tree-optimization/84265
* gcc.dg/vect/pr84265.c: New test.

From-SVN: r257492

6 years agoUse nonzero bits to refine range in split_constant_offset (PR 81635)
Richard Sandiford [Thu, 8 Feb 2018 15:16:29 +0000 (15:16 +0000)]
Use nonzero bits to refine range in split_constant_offset (PR 81635)

This patch is part 2 of the fix for PR 81635.  It means that
split_constant_offset can handle loops like:

  for (unsigned int i = 0; i < n; i += 4)
    {
      a[i] = ...;
      a[i + 1] = ...;
    }

CCP records that "i" must have its low 2 bits clear, but we don't
include this information in the range of "i", which remains [0, +INF].
I tried making set_nonzero_bits update the range info in the same
way that set_range_info updates the nonzero bits, but it regressed
cases like vrp117.c and made some other tests worse.

vrp117.c has a multiplication by 10, so CCP can infer that the low bit
of the result is clear.  If we included that in the range, the range
would go from [-INF, +INF] to [-INF, not-quite-+INF].  However,
the multiplication is also known to overflow in all cases, so VRP
saturates the result to [INT_MAX, INT_MAX].  This obviously creates a
contradiction with the nonzero bits, and intersecting the new saturated
range with an existing not-quite-+INF range would make us drop to
VR_UNDEFINED.  We're prepared to fold a comparison with an [INT_MAX,
INT_MAX] value but not with a VR_UNDEFINED value.

The other problems were created when intersecting [-INF, not-quite-+INF]
with a useful VR_ANTI_RANGE like ~[-1, 1].  The intersection would
keep the former range rather than the latter.

The patch therefore keeps the adjustment local to split_constant_offset
for now, but adds a helper routine so that it's easy to move this later.

2018-02-08  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/
PR tree-optimization/81635
* wide-int.h (wi::round_down_for_mask, wi::round_up_for_mask): Declare.
* wide-int.cc (wi::round_down_for_mask, wi::round_up_for_mask)
(test_round_for_mask): New functions.
(wide_int_cc_tests): Call test_round_for_mask.
* tree-vrp.h (intersect_range_with_nonzero_bits): Declare.
* tree-vrp.c (intersect_range_with_nonzero_bits): New function.
* tree-data-ref.c (split_constant_offset_1): Use it to refine the
range returned by get_range_info.

gcc/testsuite/
PR tree-optimization/81635
* gcc.dg/vect/bb-slp-pr81635-3.c: New test.
* gcc.dg/vect/bb-slp-pr81635-4.c: Likewise.

From-SVN: r257491

6 years agore PR ipa/81360 (ice in estimate_edge_growth, at ipa-inline.h:86)
Jan Hubicka [Thu, 8 Feb 2018 14:51:51 +0000 (15:51 +0100)]
re PR ipa/81360 (ice in estimate_edge_growth, at ipa-inline.h:86)

PR ipa/81360
* cgraph.h (symtab_node::output_to_lto_symbol_table_p): Declare
* symtab.c: Include builtins.h
(symtab_node::output_to_lto_symbol_table_p): Move here
from lto-streamer-out.c:output_symbol_p.
* lto-streamer-out.c (write_symbol): Turn early exit to assert.
(output_symbol_p): Move all logic to symtab.c
(produce_symtab): Update.

* lto.c (unify_scc): Register prevailing trees, not trees to be freed.
(read_cgraph_and_symbols): Use
symtab_node::output_to_lto_symbol_table_p.

From-SVN: r257490

6 years agoS/390: Disable prediction of indirect branches
Andreas Krebbel [Thu, 8 Feb 2018 14:45:53 +0000 (14:45 +0000)]
S/390: Disable prediction of indirect branches

This patch implements GCC support for mitigating vulnerability
CVE-2017-5715 known as Spectre #2 on IBM Z.

In order to disable prediction of indirect branches the implementation
makes use of an IBM Z specific feature - the execute instruction.
Performing an indirect branch via execute prevents the branch from
being subject to dynamic branch prediction.

The implementation tries to stay close to the x86 solution regarding
user interface.

x86 style options supported (without thunk-inline):

-mindirect-branch=(keep|thunk|thunk-extern)
-mfunction-return=(keep|thunk|thunk-extern)

IBM Z specific options:

-mindirect-branch-jump=(keep|thunk|thunk-extern|thunk-inline)
-mindirect-branch-call=(keep|thunk|thunk-extern)
-mfunction-return-reg=(keep|thunk|thunk-extern)
-mfunction-return-mem=(keep|thunk|thunk-extern)

These options allow us to enable/disable the branch conversion at a
finer granularity.

-mindirect-branch sets the value of -mindirect-branch-jump and
 -mindirect-branch-call.

-mfunction-return sets the value of -mfunction-return-reg and
 -mfunction-return-mem.

All these options are supported on GCC command line as well as
function attributes.

'thunk' triggers the generation of out of line thunks (expolines) and
replaces the formerly indirect branch with a direct branch to the
thunk.  Depending on the -march= setting two different types of thunks
are generated.  With -march=z10 or higher exrl (execute relative long)
is being used while targeting older machines makes use of larl/ex
instead.  From a security perspective the exrl variant is preferable.

'thunk-extern' does the branch replacement like 'thunk' but does not
emit the thunks.

'thunk-inline' is only available for indirect jumps.  It should be used
in environments where correct CFI is important - known as user space.

Additionally the patch introduces the -mindirect-branch-table option
which generates tables pointing to the locations which have been
modified.  This is supposed to allow reverting the changes without
re-compilation in situations where it isn't required. The sections are
split up into one section per option.

gcc/ChangeLog:

2018-02-08  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

* config/s390/s390-opts.h (enum indirect_branch): Define.
* config/s390/s390-protos.h (s390_return_addr_from_memory)
(s390_indirect_branch_via_thunk)
(s390_indirect_branch_via_inline_thunk): Add function prototypes.
(enum s390_indirect_branch_type): Define.
* config/s390/s390.c (struct s390_frame_layout, struct
machine_function): Remove.
(indirect_branch_prez10thunk_mask, indirect_branch_z10thunk_mask)
(indirect_branch_table_label_no, indirect_branch_table_name):
Define variables.
(INDIRECT_BRANCH_NUM_OPTIONS): Define macro.
(enum s390_indirect_branch_option): Define.
(s390_return_addr_from_memory): New function.
(s390_handle_string_attribute): New function.
(s390_attribute_table): Add new attribute handler.
(s390_execute_label): Handle UNSPEC_EXECUTE_JUMP patterns.
(s390_indirect_branch_via_thunk): New function.
(s390_indirect_branch_via_inline_thunk): New function.
(s390_function_ok_for_sibcall): When jumping via thunk disallow
sibling call optimization for non z10 compiles.
(s390_emit_call): Force indirect branch target to be a single
register.  Add r1 clobber for non-z10 compiles.
(s390_emit_epilogue): Emit return jump via return_use expander.
(s390_reorg): Handle JUMP_INSNs as execute targets.
(s390_option_override_internal): Perform validity checks for the
new command line options.
(s390_indirect_branch_attrvalue): New function.
(s390_indirect_branch_settings): New function.
(s390_set_current_function): Invoke s390_indirect_branch_settings.
(s390_output_indirect_thunk_function):  New function.
(s390_code_end): Implement target hook.
(s390_case_values_threshold): Implement target hook.
(TARGET_ASM_CODE_END, TARGET_CASE_VALUES_THRESHOLD): Define target
macros.
* config/s390/s390.h (struct s390_frame_layout)
(struct machine_function): Move here from s390.c.
(TARGET_INDIRECT_BRANCH_NOBP_RET)
(TARGET_INDIRECT_BRANCH_NOBP_JUMP)
(TARGET_INDIRECT_BRANCH_NOBP_JUMP_THUNK)
(TARGET_INDIRECT_BRANCH_NOBP_JUMP_INLINE_THUNK)
(TARGET_INDIRECT_BRANCH_NOBP_CALL)
(TARGET_DEFAULT_INDIRECT_BRANCH_TABLE)
(TARGET_INDIRECT_BRANCH_THUNK_NAME_EXRL)
(TARGET_INDIRECT_BRANCH_THUNK_NAME_EX)
(TARGET_INDIRECT_BRANCH_TABLE): Define macros.
* config/s390/s390.md (UNSPEC_EXECUTE_JUMP)
(INDIRECT_BRANCH_THUNK_REGNUM): Define constants.
(mnemonic attribute): Add values which aren't recognized
automatically.
("*cjump_long", "*icjump_long", "*basr", "*basr_r"): Disable
pattern for branch conversion.  Fix mnemonic attribute.
("*c<code>", "*sibcall_br", "*sibcall_value_br", "*return"): Emit
indirect branch via thunk if requested.
("indirect_jump", "<code>"): Expand patterns for branch conversion.
("*indirect_jump"): Disable for branch conversion using out of
line thunks.
("indirect_jump_via_thunk<mode>_z10")
("indirect_jump_via_thunk<mode>")
("indirect_jump_via_inlinethunk<mode>_z10")
("indirect_jump_via_inlinethunk<mode>", "*casesi_jump")
("casesi_jump_via_thunk<mode>_z10", "casesi_jump_via_thunk<mode>")
("casesi_jump_via_inlinethunk<mode>_z10")
("casesi_jump_via_inlinethunk<mode>", "*basr_via_thunk<mode>_z10")
("*basr_via_thunk<mode>", "*basr_r_via_thunk_z10")
("*basr_r_via_thunk", "return<mode>_prez10"): New pattern.
("*indirect2_jump"): Disable for branch conversion.
("casesi_jump"): Turn into expander and expand patterns for branch
conversion.
("return_use"): New expander.
("*return"): Emit return via thunk and rename it to ...
("*return<mode>"): ... this one.
* config/s390/s390.opt: Add new options and and enum for the
option values.

gcc/testsuite/ChangeLog:

2018-02-08  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

* gcc.target/s390/nobp-function-pointer-attr.c: New test.
* gcc.target/s390/nobp-function-pointer-nothunk.c: New test.
* gcc.target/s390/nobp-function-pointer-z10.c: New test.
* gcc.target/s390/nobp-function-pointer-z900.c: New test.
* gcc.target/s390/nobp-indirect-jump-attr.c: New test.
* gcc.target/s390/nobp-indirect-jump-inline-attr.c: New test.
* gcc.target/s390/nobp-indirect-jump-inline-z10.c: New test.
* gcc.target/s390/nobp-indirect-jump-inline-z900.c: New test.
* gcc.target/s390/nobp-indirect-jump-nothunk.c: New test.
* gcc.target/s390/nobp-indirect-jump-z10.c: New test.
* gcc.target/s390/nobp-indirect-jump-z900.c: New test.
* gcc.target/s390/nobp-return-attr-all.c: New test.
* gcc.target/s390/nobp-return-attr-neg.c: New test.
* gcc.target/s390/nobp-return-mem-attr.c: New test.
* gcc.target/s390/nobp-return-mem-nothunk.c: New test.
* gcc.target/s390/nobp-return-mem-z10.c: New test.
* gcc.target/s390/nobp-return-mem-z900.c: New test.
* gcc.target/s390/nobp-return-reg-attr.c: New test.
* gcc.target/s390/nobp-return-reg-mixed.c: New test.
* gcc.target/s390/nobp-return-reg-nothunk.c: New test.
* gcc.target/s390/nobp-return-reg-z10.c: New test.
* gcc.target/s390/nobp-return-reg-z900.c: New test.
* gcc.target/s390/nobp-table-jump-inline-z10.c: New test.
* gcc.target/s390/nobp-table-jump-inline-z900.c: New test.
* gcc.target/s390/nobp-table-jump-z10.c: New test.
* gcc.target/s390/nobp-table-jump-z900.c: New test.

From-SVN: r257489

6 years agoSimplify LRA lowpart subreg fix
Richard Sandiford [Thu, 8 Feb 2018 13:50:16 +0000 (13:50 +0000)]
Simplify LRA lowpart subreg fix

r257177 made the else arms equivalent to the if arms.

2018-02-08  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/
* lra-constraints.c (match_reload): Unconditionally use
gen_lowpart_SUBREG, rather than selecting between that
and equivalent gen_rtx_SUBREG code.

From-SVN: r257488

6 years agore PR middle-end/84233 (ICE (segfault) in gimple_assign_rhs_code)
Richard Biener [Thu, 8 Feb 2018 13:29:15 +0000 (13:29 +0000)]
re PR middle-end/84233 (ICE (segfault) in gimple_assign_rhs_code)

2018-02-08  Richard Biener  <rguenther@suse.de>

PR tree-optimization/84233
* tree-ssa-phiprop.c (propagate_with_phi): Use separate
changed flag instead of boguously re-using phi_inserted.

* g++.dg/torture/pr84233.C: New testcase.

From-SVN: r257486

6 years ago[hsa] Fix PR82416 testcase
Martin Jambor [Thu, 8 Feb 2018 13:06:26 +0000 (14:06 +0100)]
[hsa] Fix PR82416 testcase

2018-02-08  Martin Jambor  <mjambor@suse.cz>

* testsuite/libgomp.hsa.c/pr82416.c: Make the function with target
clonable.

From-SVN: r257485

6 years ago[hsa] Set program allocation for static local variables
Martin Jambor [Thu, 8 Feb 2018 13:03:52 +0000 (14:03 +0100)]
[hsa] Set program allocation for static local variables

2018-02-08  Martin Jambor  <mjambor@suse.cz>

* hsa-gen.c (get_symbol_for_decl): Set program allocation for
static local variables.

libgomp/
* testsuite/libgomp.hsa.c/staticvar.c: New test.

From-SVN: r257484

6 years agore PR target/84278 (claims initv4sfv2sf is available but inits through stack)
Richard Biener [Thu, 8 Feb 2018 12:53:19 +0000 (12:53 +0000)]
re PR target/84278 (claims initv4sfv2sf is available but inits through stack)

2018-02-08  Richard Biener  <rguenther@suse.de>

PR tree-optimization/84278
* tree-vect-stmts.c (vectorizable_store): When looking for
smaller vector types to perform grouped strided loads/stores
make sure the mode is supported by the target.
(vectorizable_load): Likewise.

* gcc.target/i386/pr84278.c: New testcase.

From-SVN: r257483

6 years ago[AArch64] Use more LDP/STP in shrinkwrapping
Wilco Dijkstra [Thu, 8 Feb 2018 12:32:51 +0000 (12:32 +0000)]
[AArch64] Use more LDP/STP in shrinkwrapping

The shrinkwrap optimization added in GCC 7 allows each callee-save to
be delayed and done only across blocks which need a particular callee-save.
Although this reduces unnecessary memory traffic on code paths that need
few callee-saves, it typically uses LDR/STR rather than LDP/STP.  This
means more memory accesses and increased codesize, ~1.0% on average.

To improve this, if a particular callee-save must be saved/restored, also
add the adjacent callee-save to allow use of LDP/STP.  This significantly
reduces codesize (for example gcc_r, povray_r, parest_r, xalancbmk_r are
1% smaller).  This is a simple fix which can be backported.  A more advanced
approach would scan blocks for pairs of callee-saves, but that requires a
full rewrite of all the callee-save code which is too late at this stage.

An example epilog in a shrinkwrapped function before:

ldp    x21, x22, [sp,#16]
ldr    x23, [sp,#32]
ldr    x24, [sp,#40]
ldp    x25, x26, [sp,#48]
ldr    x27, [sp,#64]
ldr    x28, [sp,#72]
ldr    x30, [sp,#80]
ldr    d8, [sp,#88]
ldp    x19, x20, [sp],#96
ret

And after this patch:

ldr    d8, [sp,#88]
ldp    x21, x22, [sp,#16]
ldp    x23, x24, [sp,#32]
ldp    x25, x26, [sp,#48]
ldp    x27, x28, [sp,#64]
ldr    x30, [sp,#80]
ldp    x19, x20, [sp],#96
ret

    gcc/
* config/aarch64/aarch64.c (aarch64_components_for_bb):
Increase LDP/STP opportunities by adding adjacent callee-saves.

From-SVN: r257482

6 years agoPR84068, PR83459: Fix sort order of SCHED_PRESSURE_MODEL
Wilco Dijkstra [Thu, 8 Feb 2018 12:29:28 +0000 (12:29 +0000)]
PR84068, PR83459: Fix sort order of SCHED_PRESSURE_MODEL

The comparison function for SCHED_PRESSURE_MODEL is incorrect.  If either
instruction is not in target_bb, the ordering is not well defined.
Since all instructions outside the target_bb get the highest model_index,
all we need to do is sort on model_index.  If the model_index is the same
we defer to RFS_DEP_COUNT and/or RFS_TIE.

    gcc/
PR rtl-optimization/84068
PR rtl-optimization/83459
* haifa-sched.c (rank_for_schedule): Fix SCHED_PRESSURE_MODEL sorting.

    gcc/testsuite
PR rtl-optimization/84068
PR rtl-optimization/83459
* gcc.dg/pr84068.c: New test.

From-SVN: r257481

6 years agore PR tree-optimization/84224 (ICE in execute, at gimple-ssa-warn-alloca.c:448)
Aldy Hernandez [Thu, 8 Feb 2018 11:16:25 +0000 (11:16 +0000)]
re PR tree-optimization/84224 (ICE in execute, at gimple-ssa-warn-alloca.c:448)

PR tree-optimization/84224
* gimple-ssa-warn-alloca.c (pass_walloca::execute): Remove assert.
* calls.c (gimple_alloca_call_p): Only return TRUE when we have
non-zero arguments.

From-SVN: r257480

6 years agoslp-pr56812.cc: Allow either basic-block or loop vectorization to happen.
Richard Biener [Thu, 8 Feb 2018 10:52:00 +0000 (10:52 +0000)]
slp-pr56812.cc: Allow either basic-block or loop vectorization to happen.

2018-02-08  Richard Biener  <rguenther@suse.de>

* g++.dg/vect/slp-pr56812.cc: Allow either basic-block or
loop vectorization to happen.

From-SVN: r257479