gcc.git
6 years agore PR c/84100 (Function __attribute__((optimize(align-loops=32))) gives spurious...
Jakub Jelinek [Wed, 31 Jan 2018 08:26:52 +0000 (09:26 +0100)]
re PR c/84100 (Function __attribute__((optimize(align-loops=32))) gives spurious warning and is ignored)

PR c/84100
* common.opt (falign-functions=, falign-jumps=, falign-labels=,
falign-loops=): Add Optimization flag.

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

From-SVN: r257219

6 years agogo-gcc.cc (Gcc_backend::convert_tree): New private method.
Ian Lance Taylor [Wed, 31 Jan 2018 06:17:25 +0000 (06:17 +0000)]
go-gcc.cc (Gcc_backend::convert_tree): New private method.

* go-gcc.cc (Gcc_backend::convert_tree): New private method.
(Gcc_backend::constructor_expression): Call it.
(Gcc_backend::assignment_statement): Likewise.
(Gcc_backend::temporary_variable): Likewise.

Fixes https://golang.org/issue/#23606

From-SVN: r257218

6 years agore PR target/84064 (ICE in ix86_expand_prologue related to -fstack-clash-protection...
Jeff Law [Wed, 31 Jan 2018 05:02:30 +0000 (22:02 -0700)]
re PR target/84064 (ICE in ix86_expand_prologue related to -fstack-clash-protection and memcpy on i686)

PR target/84064
* i386.c (ix86_adjust_stack_and_probe_stack_clash): New argument
INT_REGISTERS_SAVED.  Check it prior to calling
get_scratch_register_on_entry.
(ix86_adjust_stack_and_probe): Similarly.
(ix86_emit_probe_stack_range): Similarly.
(ix86_expand_prologue): Corresponding changes.

PR target/84064
* gcc.target/i386/pr84064: New test.

From-SVN: r257217

6 years agocompiler: Function_type and Backend_function_type should not be identical
Ian Lance Taylor [Wed, 31 Jan 2018 02:11:03 +0000 (02:11 +0000)]
compiler: Function_type and Backend_function_type should not be identical

    Function_type and Backend_function_type have different backend
    representations, so they should not be identical. Otherwise it
    confuses Type::type_btypes map.

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

From-SVN: r257216

6 years agoDaily bump.
GCC Administrator [Wed, 31 Jan 2018 00:16:26 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r257215

6 years agore PR debug/84131 (Fortran dynamical array debug info)
Jakub Jelinek [Tue, 30 Jan 2018 22:57:51 +0000 (23:57 +0100)]
re PR debug/84131 (Fortran dynamical array debug info)

PR debug/84131
* trans-array.c (gfc_get_descriptor_offsets_for_info): Set *data_off
to DATA_FIELD's offset rather than OFFSET_FIELD's offset.

From-SVN: r257212

6 years agore PR fortran/84134 (ICE: Floating point exception)
Thomas Koenig [Tue, 30 Jan 2018 22:35:34 +0000 (22:35 +0000)]
re PR fortran/84134 (ICE: Floating point exception)

2017-01-30  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/84134
* array.c (gfc_ref_dimen_size): Whitespace fixes.  If stride is
zero, return false.

2017-01-30  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/84134
* gfortran.dg/data_implied_do_2.f90: New test.

From-SVN: r257211

6 years agoFix use of Solaris values-Xc.o (PR target/40411)
Rainer Orth [Tue, 30 Jan 2018 21:18:40 +0000 (21:18 +0000)]
Fix use of Solaris values-Xc.o (PR target/40411)

PR target/40411
* config/sol2.h (STARTFILE_ARCH_SPEC): Use -std=c*,
-std=iso9899:199409 instead of -pedantic to select values-Xc.o.

From-SVN: r257209

6 years agopr68318_1.f90: Add closing bracket in dejagnu directive.
Janus Weil [Tue, 30 Jan 2018 21:15:55 +0000 (22:15 +0100)]
pr68318_1.f90: Add closing bracket in dejagnu directive.

2018-01-30  Janus Weil  <janus@gcc.gnu.org>

* gfortran.dg/pr68318_1.f90: Add closing bracket in dejagnu directive.

From-SVN: r257208

6 years agoAdd path for gcc.target/powerpc/pr84112.c in ChangeLog.
Rainer Orth [Tue, 30 Jan 2018 20:54:34 +0000 (20:54 +0000)]
Add path for gcc.target/powerpc/pr84112.c in ChangeLog.

From-SVN: r257207

6 years agore PR fortran/84133 (ICE in gimplify_var_or_parm_decl, at gimplify.c:2706)
Thomas Koenig [Tue, 30 Jan 2018 20:49:49 +0000 (20:49 +0000)]
re PR fortran/84133 (ICE in gimplify_var_or_parm_decl, at gimplify.c:2706)

2018-01-30  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/84133
* frontend-passes (matmul_to_var_expr): Return early if
in association list.
(inline_matmul_assign): Likewise.

2018-01-30  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/84133
* gfortran.dg/inline_matmul_21.f90: New test case.

From-SVN: r257206

6 years agoFix g++.dg/torture/pr81360.C scan-ipa-dump
Rainer Orth [Tue, 30 Jan 2018 20:33:20 +0000 (20:33 +0000)]
Fix g++.dg/torture/pr81360.C scan-ipa-dump

* g++.dg/torture/pr81360.C: Add -fdump-ipa-icf to dg-options.

From-SVN: r257205

6 years agore PR target/84112 (powerpc64le ICE in LRA on openjdk)
Vladimir Makarov [Tue, 30 Jan 2018 20:28:59 +0000 (20:28 +0000)]
re PR target/84112 (powerpc64le ICE in LRA on openjdk)

2018-01-30  Vladimir Makarov  <vmakarov@redhat.com>

PR target/84112
* lra-constraints.c (curr_insn_transform): Process AND in the
address.

2018-01-30  Vladimir Makarov  <vmakarov@redhat.com>

PR target/84112
* pr84112.c: New.

From-SVN: r257204

6 years agore PR target/83986 (ICE in maybe_record_trace_start, at dwarf2cfi.c:2348)
Jakub Jelinek [Tue, 30 Jan 2018 20:03:04 +0000 (21:03 +0100)]
re PR target/83986 (ICE in maybe_record_trace_start, at dwarf2cfi.c:2348)

PR rtl-optimization/83986
* sched-deps.c (sched_analyze_insn): For frame related insns, add anti
dependence against last_pending_memory_flush in addition to
pending_jump_insns.

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

From-SVN: r257203

6 years agoPR c++/84091 - ICE with local class in lambda in template.
Jason Merrill [Tue, 30 Jan 2018 20:01:36 +0000 (15:01 -0500)]
PR c++/84091 - ICE with local class in lambda in template.

* decl2.c (determine_visibility): Look for outer containing template
instantiation.

From-SVN: r257202

6 years agoPR c++/84098 - ICE with lambda in template NSDMI.
Jason Merrill [Tue, 30 Jan 2018 19:05:12 +0000 (14:05 -0500)]
PR c++/84098 - ICE with lambda in template NSDMI.

* pt.c (instantiate_class_template_1): Ignore more lambdas.

From-SVN: r257199

6 years agore PR fortran/37577 ([meta-bug] change internal array descriptor format for better...
Thomas Koenig [Tue, 30 Jan 2018 18:20:27 +0000 (18:20 +0000)]
re PR fortran/37577 ([meta-bug] change internal array descriptor format for better syntax, C interop TR, rank 15)

2018-01-30  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/37577
* libgfortran.h: Remove GFC_DTYPE_DERIVED_1, GFC_DTYPE_DERIVED_2,
GFC_DTYPE_DERIVED_4, GFC_DTYPE_DERIVED_8 and GFC_DTYPE_DERIVED_16.
* m4/cshift1.m4: Remove GFC_DTYPE_DERIVED_1.
* generated/cshift1_16.c: Regenerated.
* generated/cshift1_4.c: Regenerated.
* generated/cshift1_8.c: Regenerated.
* intrinsics/cshift0.c: Remove GFC_DTYPE_DERIVED_1.
* intrinsics/pack_generic.c (pack): Move handling of other types
into separate switch statement.
* intrinsics/spread_generic.c (spread): Likewise.
(spread_scalar): Likewise.
* intrinsics/unpack_generic.c (unpack1): Likewise.
(unpack0): Likewise.
* runtime/in_pack_generic.c (internal_pack): Likewise.
* runtime/in_unpack_generic.c (internal_unpack): Likewise.

From-SVN: r257195

6 years ago[PR81611] accept copies in simple_iv_increment_p
Alexandre Oliva [Tue, 30 Jan 2018 17:40:50 +0000 (17:40 +0000)]
[PR81611] accept copies in simple_iv_increment_p

If there are copies between the GIMPLE_PHI at the loop body and the
increment that reaches it (presumably through a back edge), still
regard it as a simple_iv_increment, so that we won't consider the
value in the back edge eligible for forwprop.  Doing so would risk
making the phi node and the incremented conflicting value live
within the loop, and the phi node to be preserved for propagated
uses after the loop.

for  gcc/ChangeLog

PR tree-optimization/81611
* tree-ssa-dom.c (simple_iv_increment_p): Skip intervening
copies.

From-SVN: r257194

6 years agors6000.c (rs6000_internal_arg_pointer): Only return a reg rtx.
Aaron Sawdey [Tue, 30 Jan 2018 17:27:16 +0000 (17:27 +0000)]
rs6000.c (rs6000_internal_arg_pointer): Only return a reg rtx.

2018-01-30  Aaron Sawdey  <acsawdey@linux.vnet.ibm.com>

* config/rs6000/rs6000.c (rs6000_internal_arg_pointer): Only return
a reg rtx.

From-SVN: r257193

6 years ago[PATCH, rs6000] pr58684, pr83759 xfail test cases that fail on powerpc64.
Bill Seurer [Tue, 30 Jan 2018 16:51:14 +0000 (16:51 +0000)]
[PATCH, rs6000] pr58684, pr83759 xfail test cases that fail on powerpc64.

This patch xfails a few test cases on powerpc64 that fail after r256380
due to a longstanding issue with floating-point compares.

See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58684 for more information.

2018-01-30  Bill Seurer  <seurer@linux.vnet.ibm.com>

PR 58684
* gcc/testsuite/gcc.dg/torture/inf-compare-1.c: Add xfail.
* gcc/testsuite/gcc.dg/torture/inf-compare-2.c: Add xfail.
* gcc/testsuite/gcc.dg/torture/inf-compare-3.c: Add xfail.
* gcc/testsuite/gcc.dg/torture/inf-compare-4.c: Add xfail.

From-SVN: r257190

6 years agore PR tree-optimization/84111 (Compile time hog w/ -O2)
Jakub Jelinek [Tue, 30 Jan 2018 15:58:22 +0000 (16:58 +0100)]
re PR tree-optimization/84111 (Compile time hog w/ -O2)

PR tree-optimization/84111
* tree-ssa-loop-ivcanon.c (tree_unroll_loops_completely_1): Skip
inner loops added during recursion, as they don't have up-to-date
SSA form.

* gcc.c-torture/compile/pr84111.c: New test.

From-SVN: r257188

6 years agore PR ipa/83179 (gcc.dg/ipa/inline-1.c fail)
Jan Hubicka [Tue, 30 Jan 2018 13:50:45 +0000 (14:50 +0100)]
re PR ipa/83179 (gcc.dg/ipa/inline-1.c fail)

PR ipa/83179
* gcc.dg/ipa/inline-2.c: Fix template.
* gcc.dg/ipa/inline-3.c: Fix template.

From-SVN: r257186

6 years agore PR ipa/81360 (ice in estimate_edge_growth, at ipa-inline.h:86)
Jan Hubicka [Tue, 30 Jan 2018 13:23:39 +0000 (14:23 +0100)]
re PR ipa/81360 (ice in estimate_edge_growth, at ipa-inline.h:86)

PR ipa/81360
* ipa-inline.c (can_inline_edge_p): Break out late tests to...
(can_inline_edge_by_limits_p): ... here.
(can_early_inline_edge_p, check_callers,
update_caller_keys, update_callee_keys, recursive_inlining,
add_new_edges_to_heap, speculation_useful_p,
inline_small_functions,
inline_small_functions, flatten_function,
inline_to_all_callers_1): Update.

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

From-SVN: r257184

6 years agore PR lto/83954 (LTO: Bogus -Wlto-type-mismatch warning for array of pointer to incom...
Jan Hubicka [Tue, 30 Jan 2018 13:17:40 +0000 (14:17 +0100)]
re PR lto/83954 (LTO: Bogus -Wlto-type-mismatch warning for array of pointer to incomplete type)

PR lto/83954
* lto-symtab.c (warn_type_compatibility_p): Silence false positive
for type match warning on arrays of pointers.
* gcc.dg/lto/pr83954.h: New testcase.
* gcc.dg/lto/pr83954_0.c: New testcase.
* gcc.dg/lto/pr83954_1.c: New testcase.

From-SVN: r257183

6 years agoprofile-count.c (profile_count::combine_with_ipa_count): Handle zeros correctly.
Jan Hubicka [Tue, 30 Jan 2018 12:46:19 +0000 (13:46 +0100)]
profile-count.c (profile_count::combine_with_ipa_count): Handle zeros correctly.

* profile-count.c (profile_count::combine_with_ipa_count): Handle
zeros correctly.

From-SVN: r257182

6 years agore PR target/83008 ([performance] Is it better to avoid extra instructions in data...
Richard Biener [Tue, 30 Jan 2018 11:19:47 +0000 (11:19 +0000)]
re PR target/83008 ([performance] Is it better to avoid extra instructions in data passing between loops?)

2018-01-30  Richard Biener  <rguenther@suse.de>

PR tree-optimization/83008
* tree-vect-slp.c (vect_analyze_slp_cost_1): Properly cost
invariant and constant vector uses in stmts when they need
more than one stmt.

From-SVN: r257181

6 years agoDisable SHF_MERGE on Solaris 10/x86 (PR bootstrap/84017)
Rainer Orth [Tue, 30 Jan 2018 09:53:29 +0000 (09:53 +0000)]
Disable SHF_MERGE on Solaris 10/x86 (PR bootstrap/84017)

gcc/testsuite:
PR bootstrap/84017
* gcc.dg/debug/dwarf2/prod-options.c: Add -fno-merge-debug-strings
to dg-options.
Simplify DW_AT_producer scan.

gcc:
PR bootstrap/84017
* configure.ac (gcc_cv_as_shf_merge): Disable on Solaris 10/x86.
* configure: Regenerate.

From-SVN: r257179

6 years ago[AArch64] Fix sve/extract_[12].c for big-endian SVE
Richard Sandiford [Tue, 30 Jan 2018 09:48:24 +0000 (09:48 +0000)]
[AArch64] Fix sve/extract_[12].c for big-endian SVE

sve/extract_[12].c were relying on the target-independent optimisation
that removes a redundant vec_select, so that we don't end up with
things like:

    dup v0.4s, v0.4s[0]
    ...use s0...

But that optimisation rightly doesn't trigger for big-endian targets,
because GCC expects lane 0 to be in the high part of the register
rather than the low part.

SVE breaks this assumption -- see the comment at the head of
aarch64-sve.md for details -- so the optimisation is valid for
both endiannesses.  Long term, we probably need some kind of target
hook to make GCC aware of this.

But there's another problem with the current extract pattern: it doesn't
tell the register allocator how cheap an extraction of lane 0 is with
tied registers.  It seems better to split the lane 0 case out into
its own pattern and use tied operands for the FPR<-SIMD case,
so that using different registers has the cost of an extra reload.
I think we want this for both endiannesses, regardless of the hook
described above.

Also, the gen_lowpart in this pattern fails for aarch64_be due to
TARGET_CAN_CHANGE_MODE_CLASS restrictions, so the patch uses gen_rtx_REG
instead.  We're only creating this rtl in order to print it, so there's
no need for anything fancier.

2018-01-30  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/
* config/aarch64/aarch64-sve.md (*vec_extract<mode><Vel>_0): New
pattern.
(*vec_extract<mode><Vel>_v128): Require a nonzero lane number.
Use gen_rtx_REG rather than gen_lowpart.

Reviewed-by: James Greenhalgh <james.greenhalgh@arm.com>
From-SVN: r257178

6 years agoFix LRA subreg calculation for big-endian targets
Richard Sandiford [Tue, 30 Jan 2018 09:45:58 +0000 (09:45 +0000)]
Fix LRA subreg calculation for big-endian targets

LRA was using a subreg offset of 0 whenever constraints matched
two operands with different modes.  That leads to an invalid offset
(and ICE) on big-endian targets if one of the modes is narrower
than a word.  E.g. if a (reg:SI X) is matched to a (reg:QI Y),
the big-endian subreg should be (subreg:QI (reg:SI X) 3) rather
than (subreg:QI (reg:SI X) 0).

But this raises the issue of what the behaviour should be when the
matched operands occupy different numbers of registers.  Should the
register numbers match, or should the locations of the lsbs match?
Although the documentation isn't clear, reload went for the second
interpretation (which seems the most natural to me):

      /* On a REG_WORDS_BIG_ENDIAN machine, point to the last register of a
         multiple hard register group of scalar integer registers, so that
         for example (reg:DI 0) and (reg:SI 1) will be considered the same
         register.  */

So I think this means that we can/must use the lowpart offset
unconditionally, rather than trying to separate out the multi-register
case.  This also matches the LRA handling of constant integers, which
already uses lowpart subregs.

The patch fixes gcc.target/aarch64/sve/extract_[34].c for aarch64_be.

2018-01-30  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/
* lra-constraints.c (match_reload): Use subreg_lowpart_offset
rather than 0 when creating partial subregs.

From-SVN: r257177

6 years agoExpand vec_perm_indices::series_p comment
Richard Sandiford [Tue, 30 Jan 2018 09:45:40 +0000 (09:45 +0000)]
Expand vec_perm_indices::series_p comment

2018-01-30  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/
* vec-perm-indices.c (vec_perm_indices::series_p): Give examples
of usage.

From-SVN: r257176

6 years ago[testsuite] XFAIL gcc.dg/tree-ssa/ssa-dom-cse-2.c on non-NEON arm targets
Kyrylo Tkachov [Tue, 30 Jan 2018 09:13:39 +0000 (09:13 +0000)]
[testsuite] XFAIL gcc.dg/tree-ssa/ssa-dom-cse-2.c on non-NEON arm targets

This test fails to optimise away the PLUS reduction in the loop on arm targets when vectorisation
is not enabled due to absence of SIMD instructions.
From reading the logs and the PR I gather that the presence or absence of SIMD affects the passing of this test
on other targets as well, as evidenced by the long list of xfail targets.
This list looks quite unwieldy to me, but here is a patch adding non-NEON arm to that list.

    * gcc.dg/tree-ssa/ssa-dom-cse-2.c: XFAIL on !arm_neon arm targets.

From-SVN: r257175

6 years agoFix AVX-512BITALG test failures
Kirill Yukhin [Tue, 30 Jan 2018 08:21:22 +0000 (08:21 +0000)]
Fix AVX-512BITALG test failures

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/avx512bitalgvl-vpopcntb-1.c: Ditto.
* gcc.target/i386/avx512bitalgvl-vpopcntw-1.c: Ditto.

From-SVN: r257173

6 years agore PR testsuite/81010 (test case gcc.target/powerpc/pr56605.c fails starting with...
Jeff Law [Tue, 30 Jan 2018 05:30:40 +0000 (22:30 -0700)]
re PR testsuite/81010 (test case gcc.target/powerpc/pr56605.c fails starting with r248958)

PR testsuite/81010
* gcc.target/powerpc/pr56605.c: Update various dg- directives to
better match other tests which require vsx.  Verify the zero
extension is part of the test in the combiner dump.

From-SVN: r257172

6 years agointernal/syscall/unix: add randomTrap for sh/shbe
Ian Lance Taylor [Tue, 30 Jan 2018 04:48:55 +0000 (04:48 +0000)]
internal/syscall/unix: add randomTrap for sh/shbe

    CL 84555 added support for the SuperH architecture, but didn't add the
    randomTrap definition to be used for the getrandom syscall on Linux.
    Add it now.

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

From-SVN: r257171

6 years agoDaily bump.
GCC Administrator [Tue, 30 Jan 2018 00:16:20 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r257170

6 years agore PR libgomp/84096 (Wrong prototype for omp_init_nest_lock_with_hint() in "omp.h...
Christoph Spiel [Mon, 29 Jan 2018 23:38:01 +0000 (23:38 +0000)]
re PR libgomp/84096 (Wrong prototype for omp_init_nest_lock_with_hint() in "omp.h.in")

PR libgomp/84096
* omp.h.in (omp_init_nest_lock_with_hint): Use omp_nest_lock_t
instead of omp_lock_t.

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

6 years agore PR target/81550 (gcc.target/powerpc/loop_align.c fails starting with r250482)
Michael Meissner [Mon, 29 Jan 2018 22:30:34 +0000 (22:30 +0000)]
re PR target/81550 (gcc.target/powerpc/loop_align.c fails starting with r250482)

2018-01-29  Michael Meissner  <meissner@linux.vnet.ibm.com>

PR target/81550
* config/rs6000/rs6000.c (rs6000_setup_reg_addr_masks): If DFmode
and SFmode can go in Altivec registers (-mcpu=power7 for DFmode,
-mcpu=power8 for SFmode) don't set the PRE_INCDEC or PRE_MODIFY
flags.  This restores the settings used before the 2017-07-24.
Turning off pre increment/decrement/modify allows IVOPTS to
optimize DF/SF loops where the index is an int.

From-SVN: r257166

6 years agocompiler: don't insert write barriers if we've seen errors
Ian Lance Taylor [Mon, 29 Jan 2018 20:58:23 +0000 (20:58 +0000)]
compiler: don't insert write barriers if we've seen errors

    The compiler skips the escape analysis pass if it has seen any errors.
    The write barrier pass, especially the check-escapes portion, relies
    on escape analysis running.  So don't run this pass if there have been
    any errors, as it may cause further unreliable error reports.

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

From-SVN: r257163

6 years agoPR c++/68810 - wrong location for reinterpret_cast error.
Jason Merrill [Mon, 29 Jan 2018 20:56:00 +0000 (15:56 -0500)]
PR c++/68810 - wrong location for reinterpret_cast error.

* cvt.c (cp_convert_to_pointer): Always build a CONVERT_EXPR when
!dofold.

From-SVN: r257161

6 years agore PR c++/83996 (ICE with zero-sized array)
Marek Polacek [Mon, 29 Jan 2018 20:54:12 +0000 (20:54 +0000)]
re PR c++/83996 (ICE with zero-sized array)

PR c++/83996
* constexpr.c (cxx_fold_indirect_ref): Compute ((foo *)&fooarray)[1]
=> fooarray[1] in offset_int.

* g++.dg/ext/pr83996.C: New test.

From-SVN: r257160

6 years agore PR c/83966 (ICE in check_function_arguments at gcc/c-family/c-common.c:5617)
Marek Polacek [Mon, 29 Jan 2018 18:20:01 +0000 (18:20 +0000)]
re PR c/83966 (ICE in check_function_arguments at gcc/c-family/c-common.c:5617)

PR c/83966
* c-format.c (check_function_format): Check current_function_decl.

* gcc.dg/format/Wsuggest-attribute-1.c: New test.

From-SVN: r257159

6 years agore PR bootstrap/80867 (gnat bootstrap broken on powerpc64le-linux-gnu with -O3)
Richard Biener [Mon, 29 Jan 2018 18:00:49 +0000 (18:00 +0000)]
re PR bootstrap/80867 (gnat bootstrap broken on powerpc64le-linux-gnu with -O3)

gcc/ChangeLog:

2018-01-29  Richard Biener <rguenther@suse.de>
    Kelvin Nilsen  <kelvin@gcc.gnu.org>

PR bootstrap/80867
* tree-vect-stmts.c (vectorizable_call): Don't call
targetm.vectorize_builtin_md_vectorized_function if callee is
NULL.

Co-Authored-By: Kelvin Nilsen <kelvin@gcc.gnu.org>
From-SVN: r257158

6 years agoextend.tex: Fix typo in second arg in __builtin_bcdadd_{lt|eq|gt|ov}...
Carl Love [Mon, 29 Jan 2018 16:59:06 +0000 (16:59 +0000)]
extend.tex: Fix typo in second arg in __builtin_bcdadd_{lt|eq|gt|ov}...

gcc/ChangeLog:

2018-01-22 Carl Love <cel@us.ibm.com>

* doc/extend.tex: Fix typo in second arg in
__builtin_bcdadd_{lt|eq|gt|ov}, and __builtin_bcdsub_{lt|eq|gt|ov}.

From-SVN: r257156

6 years agoPR c++/83942 - wrong unused warning with static_cast.
Jason Merrill [Mon, 29 Jan 2018 16:56:28 +0000 (11:56 -0500)]
PR c++/83942 - wrong unused warning with static_cast.

* cvt.c (ocp_convert): Call mark_rvalue_use.

From-SVN: r257155

6 years agore PR libgomp/84086 ([8 Regresssion] segfault in instantiate_scev_r for libgomp.fortr...
Richard Biener [Mon, 29 Jan 2018 15:22:55 +0000 (15:22 +0000)]
re PR libgomp/84086 ([8 Regresssion] segfault in instantiate_scev_r for libgomp.fortran/examples-4/simd-2.f90 -O1)

2018-01-29  Richard Biener  <rguenther@suse.de>

PR tree-optimization/84086
* tree-ssanames.c: Include cfgloop.h and tree-scalar-evolution.h.
(flush_ssaname_freelist): When SSA names were released reset
the SCEV hash table.

From-SVN: r257152

6 years agoRemove duplicate "//" in comment
Jonathan Wakely [Mon, 29 Jan 2018 14:09:52 +0000 (14:09 +0000)]
Remove duplicate "//" in comment

From-SVN: r257147

6 years agoPR libstdc++/83833 fix failing test on ia32
Jonathan Wakely [Mon, 29 Jan 2018 14:07:27 +0000 (14:07 +0000)]
PR libstdc++/83833 fix failing test on ia32

PR libstdc++/83833
* testsuite/26_numerics/random/chi_squared_distribution/83833.cc:
Add -ffloat-store to options for m68k and ia32.

From-SVN: r257146

6 years ago* download_prerequisites: Use shasum for FreeBSD and DragonFly.
Jonathan Wakely [Mon, 29 Jan 2018 13:30:02 +0000 (13:30 +0000)]
* download_prerequisites: Use shasum for FreeBSD and DragonFly.

From-SVN: r257143

6 years agoRegenerate libstdc++ documentation
Jonathan Wakely [Mon, 29 Jan 2018 12:37:17 +0000 (12:37 +0000)]
Regenerate libstdc++ documentation

* doc/xml/faq.xml: Update copyright years.
* doc/html/*: Regenerate.

From-SVN: r257142

6 years agoPR libstdc++/83658 fix exception-safety in std::any::emplace
Jonathan Wakely [Mon, 29 Jan 2018 12:33:32 +0000 (12:33 +0000)]
PR libstdc++/83658 fix exception-safety in std::any::emplace

PR libstdc++/83658
* include/std/any (any::__do_emplace): Only set _M_manager after
constructing the contained object.
* testsuite/20_util/any/misc/any_cast_neg.cc: Adjust dg-error line.
* testsuite/20_util/any/modifiers/83658.cc: New test.

From-SVN: r257141

6 years agore PR tree-optimization/84057 (ICE: Segmentation fault (in can_remove_branch_p))
Richard Biener [Mon, 29 Jan 2018 09:16:09 +0000 (09:16 +0000)]
re PR tree-optimization/84057 (ICE: Segmentation fault (in can_remove_branch_p))

2018-01-29  Richard Biener  <rguenther@suse.de>

PR tree-optimization/84057
* tree-ssa-loop-ivcanon.c (unloop_loops): Deal with already
removed paths when removing edges.

* gcc.dg/graphite/pr84057.c: New testcase.

From-SVN: r257139

6 years agore PR fortran/84073 (In -fc-prototypes fixed (nonzero) length strings are mapped...
Thomas Koenig [Mon, 29 Jan 2018 07:11:16 +0000 (07:11 +0000)]
re PR fortran/84073 (In -fc-prototypes fixed (nonzero) length strings are mapped to plain char in prototype.)

2017-01-29  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/84073
* resolve.c (resolve_component): Ensure BIND(C) character
components have length one.
(resolve_symbol): Likewise for variables.

2017-01-29  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/84073
* gfortran.dg/bind_c_usage_31.f90: New test.

From-SVN: r257138

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

From-SVN: r257134

6 years agore PR c++/83924 (ICE: Error reporting routines re-entered with -Wduplicated-branches)
Paolo Carlini [Sun, 28 Jan 2018 01:28:05 +0000 (01:28 +0000)]
re PR c++/83924 (ICE: Error reporting routines re-entered with -Wduplicated-branches)

2018-01-27  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/83924
* g++.dg/warn/Wduplicated-branches5.C: New.

From-SVN: r257131

6 years agoDaily bump.
GCC Administrator [Sun, 28 Jan 2018 00:16:12 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r257130

6 years agolibgo: update to Go1.10rc1
Ian Lance Taylor [Sat, 27 Jan 2018 23:45:46 +0000 (23:45 +0000)]
libgo: update to Go1.10rc1

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

From-SVN: r257127

6 years agolibgo: update to Go1.10rc1
Ian Lance Taylor [Sat, 27 Jan 2018 23:44:29 +0000 (23:44 +0000)]
libgo: update to Go1.10rc1

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

From-SVN: r257126

6 years agoReplace -mfunction-return== with -mfunction-return=
H.J. Lu [Sat, 27 Jan 2018 13:50:59 +0000 (13:50 +0000)]
Replace -mfunction-return== with -mfunction-return=

Fix a typo in doc/invoke.texi.

* doc/invoke.texi: Replace -mfunction-return==@var{choice} with
-mfunction-return=@var{choice}.

From-SVN: r257124

6 years agore PR fortran/84065 (string_1.f90 fails since r256944)
Jakub Jelinek [Sat, 27 Jan 2018 10:28:20 +0000 (11:28 +0100)]
re PR fortran/84065 (string_1.f90 fails since r256944)

PR fortran/84065
* decl.c (add_init_expr_to_sym): Ignore initializers for too large
lengths.

From-SVN: r257121

6 years agore PR middle-end/84034 (incomplete warning message with dos line endings)
Bernd Edlinger [Sat, 27 Jan 2018 06:44:25 +0000 (06:44 +0000)]
re PR middle-end/84034 (incomplete warning message with dos line endings)

2018-01-27  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        PR diagnostic/84034
        * diagnostic-show-locus.c (get_line_width_without_trailing_whitespace):
        Handle CR like TAB.
        (layout::print_source_line): Likewise.
        (test_get_line_width_without_trailing_whitespace): Add test cases.

From-SVN: r257120

6 years agore PR middle-end/84040 (compilation time of gcc.c-torture/compile/limits-blockid...
Jakub Jelinek [Sat, 27 Jan 2018 06:28:15 +0000 (07:28 +0100)]
re PR middle-end/84040 (compilation time of gcc.c-torture/compile/limits-blockid.c is 50x slower)

PR middle-end/84040
* sched-deps.c (sched_macro_fuse_insns): Return immediately for
debug insns.

From-SVN: r257119

6 years agoc-cppbuiltin.c (c_cpp_builtins): Use ggc_strdup for the fp_suffix argument.
Jakub Jelinek [Sat, 27 Jan 2018 06:27:47 +0000 (07:27 +0100)]
c-cppbuiltin.c (c_cpp_builtins): Use ggc_strdup for the fp_suffix argument.

* c-cppbuiltin.c (c_cpp_builtins): Use ggc_strdup for the fp_suffix
argument.
(LAZY_HEX_FP_VALUES_CNT): Define.
(lazy_hex_fp_values): Allow up to LAZY_HEX_FP_VALUES_CNT lazy hex fp
values rather than just 12.
(builtin_define_with_hex_fp_value): Likewise.

* include/cpplib.h (enum cpp_builtin_type): Change BT_LAST_USER from
BT_FIRST_USER + 31 to BT_FIRST_USER + 63.

From-SVN: r257118

6 years agoDaily bump.
GCC Administrator [Sat, 27 Jan 2018 00:16:14 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r257117

6 years agoRISC-V: Allow register pairs for 64-bit target.
Jim Wilson [Sat, 27 Jan 2018 00:00:11 +0000 (00:00 +0000)]
RISC-V: Allow register pairs for 64-bit target.

gcc/
* config/riscv/riscv.h (MAX_FIXED_MODE_SIZE): New.

From-SVN: r257114

6 years agocompiler: show readable names in escape analysis messages
Ian Lance Taylor [Fri, 26 Jan 2018 23:58:54 +0000 (23:58 +0000)]
compiler: show readable names in escape analysis messages

    Call message_name when printing a variable for an escape analysis
    message.  This implies changing the AST dumps, which is fine.

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

From-SVN: r257113

6 years agoRegenerate .pot files.
Joseph Myers [Fri, 26 Jan 2018 22:51:02 +0000 (22:51 +0000)]
Regenerate .pot files.

gcc/po:
* gcc.pot: Regenerate.

libcpp/po:
* cpplib.pot: Regenerate.

From-SVN: r257111

6 years agoRISC-V: Add --specs=nosys.specs support.
Jim Wilson [Fri, 26 Jan 2018 21:24:22 +0000 (21:24 +0000)]
RISC-V: Add --specs=nosys.specs support.

gcc/
* config/riscv/elf.h (LIB_SPEC): Don't include -lgloss when nosys.specs
specified.

From-SVN: r257109

6 years agors6000: Fix safe-indirect-jump-[18].c
Segher Boessenkool [Fri, 26 Jan 2018 21:08:47 +0000 (22:08 +0100)]
rs6000: Fix safe-indirect-jump-[18].c

This patch merges the safe-indirect-jump-1.c and -8.c testcases,
since they do the same thing.  On the 64-bit and AIX ABIs the indirect
call is not a sibcall, since there is code generated after the call
(the restore of r2).  On the 32-bit non-AIX ABIs it is a sibcall.

* gcc.target/powerpc/safe-indirect-jump-1.c: Build on all targets.
Make expected output depend on whether we expect sibcalls or not.
* gcc.target/powerpc/safe-indirect-jump-8.c: Delete (merged into
safe-indirect-jump-1.c).

From-SVN: r257108

6 years agoPR c++/83956 - wrong dtor error with anonymous union
Jason Merrill [Fri, 26 Jan 2018 20:47:32 +0000 (15:47 -0500)]
PR c++/83956 - wrong dtor error with anonymous union

* method.c (walk_field_subobs): Variant members only affect
deletedness.
(maybe_explain_implicit_delete): Pass &deleted_p for diagnostic.

From-SVN: r257107

6 years agoPartial Failed Images patch
Damian Rouson [Fri, 26 Jan 2018 20:14:09 +0000 (20:14 +0000)]
Partial Failed Images patch

Co-Authored-By: Alessandro Fanfarillo <fanfarillo.gcc@gmail.com>
Co-Authored-By: Soren Rasmussen <s.c.rasmussen@gmail.com>
From-SVN: r257105

6 years agore PR fortran/83998 (ICE in gfc_conv_intrinsic_dot_product, at fortran/trans-intrinsi...
Steven G. Kargl [Fri, 26 Jan 2018 19:33:16 +0000 (19:33 +0000)]
re PR fortran/83998 (ICE in gfc_conv_intrinsic_dot_product, at fortran/trans-intrinsic.c:4403)

2018-01-26  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/83998
* simplify.c (compute_dot_product):  Initialize result to INTEGER(1) 0
or .false.  The summation does the correct type conversion.
(gfc_simplify_dot_product): Special case zero-sized arrays.

2018-01-26  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/83998
* gfortran.dg/dot_product_4.f90

From-SVN: r257104

6 years ago[AArch64] Fix gcc.target/aarch64/subs_compare_[12].c
Kyrylo Tkachov [Fri, 26 Jan 2018 17:15:21 +0000 (17:15 +0000)]
[AArch64] Fix gcc.target/aarch64/subs_compare_[12].c

This patch fixes the testsuite failures gcc.target/aarch64/subs_compare_1.c and subs_compare_2.c
The tests check that we combine a sequence like:
        sub     w2, w0, w1
        cmp     w0, w1

into
        subs    w2, w0, w1

This is done by a couple of peepholes in aarch64.md.

Unfortunately due to scheduling and other optimisations the SUB and CMP
can come in a different order:
        cmp     w0, w1
        sub     w0, w0, w1

And the existing peepholes cannot catch that and we fail to combine the two.
This patch adds a peephole that matches the CMP as the first insn and the SUB as the second
and outputs a SUBS.  This is almost equivalent to the existing peephole that matches SUB first and CMP second
except that it doesn't have the restriction that the output register of the SUB has to not be one of the input registers.
Remember "sub w0, w0, w1 ; cmp w0, w1" is *not* equivalent to: "subs  w0, w0, w1"
but "cmp w0, w1 ; sub w0, w0, w1" is.

So this is what this patch does. It adds a peephole for the case above and one for the SUB-immediate variant
(because the SUB-immediate is represented as PLUS-of-negated-immediate and thus has different RTL structure).

Bootstrapped and tested on aarch64-none-linux-gnu.

    * config/aarch64/aarch64.md: Add peepholes for CMP + SUB -> SUBS
    and CMP + SUB-immediate -> SUBS.

From-SVN: r257102

6 years agoPR c++/84036 - ICE with variadic capture.
Jason Merrill [Fri, 26 Jan 2018 17:10:24 +0000 (12:10 -0500)]
PR c++/84036 - ICE with variadic capture.

PR c++/82249
* pt.c (tsubst_pack_expansion): When optimizing a simple
substitution, pull a single pack expansion out of its pack.

From-SVN: r257101

6 years agoPR tree-optimization/83896 - ice in get_string_len on a call to strlen with
Martin Sebor [Fri, 26 Jan 2018 16:47:22 +0000 (16:47 +0000)]
PR tree-optimization/83896 - ice in get_string_len on a call to strlen with

PR tree-optimization/83896 - ice in get_string_len on a call to strlen with
non-constant length

gcc/ChangeLog:

        PR tree-optimization/83896
        * tree-ssa-strlen.c (get_string_len): Rename...
        (get_string_cst_length): ...to this.  Return HOST_WIDE_INT.
        Avoid assuming length is constant.
        (handle_char_store): Use HOST_WIDE_INT for string length.

gcc/testsuite/ChangeLog:

        PR tree-optimization/83896
        * gcc.dg/strlenopt-43.c: New test.

From-SVN: r257100

6 years ago* ChangeLog: Fix whitespace.
Uros Bizjak [Fri, 26 Jan 2018 15:48:24 +0000 (16:48 +0100)]
* ChangeLog: Fix whitespace.

From-SVN: r257098

6 years agofold-vec-abs-int.c: Remove scan-assembler stanzas.
Will Schmidt [Fri, 26 Jan 2018 15:37:34 +0000 (15:37 +0000)]
fold-vec-abs-int.c: Remove scan-assembler stanzas.

[testsuite]

2018-01-26  Will Schmidt  <will_schmidt@vnet.ibm.com>

* gcc.target/powerpc/fold-vec-abs-int.c: Remove scan-assembler stanzas.
* gcc.target/powerpc/fold-vec-abs-int-fwrap.c: Same.
* gcc.target/powerpc/fold-vec-abs-int.p7.c: New.
* gcc.target/powerpc/fold-vec-abs-int.p8.c: New.
* gcc.target/powerpc/fold-vec-abs-int.p9.c: New.
* gcc.target/powerpc/fold-vec-abs-int-fwrapv.p7.c: New.
* gcc.target/powerpc/fold-vec-abs-int-fwrapv.p8.c: New.
* gcc.target/powerpc/fold-vec-abs-int-fwrapv.p9.c: New.
* gcc.target/powerpc/fold-vec-abs-longlong.c: Remove scan-assembler stanzas.
* gcc.target/powerpc/fold-vec-abs-longlong-fwrap.c: Same.
* gcc.target/powerpc/fold-vec-abs-longlong.p7.c: New.
* gcc.target/powerpc/fold-vec-abs-longlong.p8.c: New.
* gcc.target/powerpc/fold-vec-abs-longlong.p9.c: New.
* gcc.target/powerpc/fold-vec-abs-longlong-fwrapv.p7.c: New.
* gcc.target/powerpc/fold-vec-abs-longlong-fwrapv.p8.c: New.
* gcc.target/powerpc/fold-vec-abs-longlong-fwrapv.p9.c: New.
* gcc.target/powerpc/fold-vec-abs-short.c: Add xxspltib to valid instruction list.
* gcc.target/powerpc/fold-vec-abs-short-fwrapv.c: Same.

From-SVN: r257097

6 years agore PR target/81763 (Issues with BMI on 32bit x86 apps on GCC 7.1+)
Uros Bizjak [Fri, 26 Jan 2018 15:36:32 +0000 (16:36 +0100)]
re PR target/81763 (Issues with BMI on 32bit x86 apps on GCC 7.1+)

PR target/81763
* config/i386/i386.md (*andndi3_doubleword): Add earlyclobber
to (=&r,r,rm) alternative. Add (=r,0,rm) and (=r,r,0) alternatives.

From-SVN: r257096

6 years agofold-vec-cmp-int.c: Delete.
Will Schmidt [Fri, 26 Jan 2018 15:30:41 +0000 (15:30 +0000)]
fold-vec-cmp-int.c: Delete.

[testsuite]

2018-01-24  Will Schmidt  <will_schmidt@vnet.ibm.com>

        * gcc.target/powerpc/fold-vec-cmp-int.c: Delete.
        * gcc.target/powerpc/fold-vec-cmp-int.h: New.
        * gcc.target/powerpc/fold-vec-cmp-int.p7.c: New.
        * gcc.target/powerpc/fold-vec-cmp-int.p8.c: New.
        * gcc.target/powerpc/fold-vec-cmp-int.p9.c: New.
        * gcc.target/powerpc/fold-vec-cmp-short.c: Delete.
        * gcc.target/powerpc/fold-vec-cmp-short.h: New.
        * gcc.target/powerpc/fold-vec-cmp-short.p8.c: New.
        * gcc.target/powerpc/fold-vec-cmp-short.p9.c: New.
        * gcc.target/powerpc/fold-vec-cmp-char.c: Delete.
        * gcc.target/powerpc/fold-vec-cmp-char.h: New.
        * gcc.target/powerpc/fold-vec-cmp-char.p8.c: New.
        * gcc.target/powerpc/fold-vec-cmp-char.p9.c: New.

From-SVN: r257095

6 years agoFix ifunc detection.
Martin Liska [Fri, 26 Jan 2018 15:27:14 +0000 (16:27 +0100)]
Fix ifunc detection.

2018-01-26  Martin Liska  <mliska@suse.cz>

* lib/target-supports.exp: Return a value, otherwise -Wreturn-type
warning is seen.

From-SVN: r257094

6 years agoPR c++/82514 - ICE with local class in generic lambda.
Jason Merrill [Fri, 26 Jan 2018 15:25:23 +0000 (10:25 -0500)]
PR c++/82514 - ICE with local class in generic lambda.

* pt.c (regenerated_lambda_fn_p): Remove.
(enclosing_instantiation_of): Don't use it.
(tsubst_function_decl): Call enclosing_instantiation_of.

* pt.c (lookup_template_class_1): Add sanity check.
* name-lookup.c (do_pushtag): Don't add closures to local_classes.

From-SVN: r257093

6 years agopowerpcfold-vec-neg-longlong.h: New.
Will Schmidt [Fri, 26 Jan 2018 15:20:45 +0000 (15:20 +0000)]
powerpcfold-vec-neg-longlong.h: New.

[testsuite]

2018-01-23  Will Schmidt  <will_schmidt@vnet.ibm.com>

* gcc.target/powerpcfold-vec-neg-longlong.h:  New.
* gcc.target/powerpc/fold-vec-neg-longlong.p8.c:  New.
* gcc.target/powerpc/fold-vec-neg-longlong.p9.c:  New.
* gcc.target/powerpc/fold-vec-neg-longlong.c:  Delete.

* gcc.target/powerpc/fold-vec-neg-int.c: Remove scan-assembler stanzas.
* gcc.target/powerpc/fold-vec-neg-int.p7.c: New.
* gcc.target/powerpc/fold-vec-neg-int.p8.c: New.
* gcc.target/powerpc/fold-vec-neg-int.p9.c: New.

From-SVN: r257092

6 years agore PR rtl-optimization/84003 (FAIL: g++.dg/torture/pr77745.C with noinline foo)
Richard Biener [Fri, 26 Jan 2018 14:50:25 +0000 (14:50 +0000)]
re PR rtl-optimization/84003 (FAIL: g++.dg/torture/pr77745.C with noinline foo)

2018-01-26  Richard Biener  <rguenther@suse.de>

PR rtl-optimization/84003
* dse.c (record_store): Only record redundant stores when
the earlier store aliases at least all accesses the later one does.

* g++.dg/torture/pr77745.C: Mark foo noinline to trigger
latent bug in DSE if NOINLINE is appropriately defined.
* g++.dg/torture/pr77745-2.C: New testcase including pr77745.C
and defining NOINLINE.

From-SVN: r257091

6 years ago[arm] XFAIL advsimd-intrinsics/vld1x2.c
Kyrylo Tkachov [Fri, 26 Jan 2018 14:34:34 +0000 (14:34 +0000)]
[arm] XFAIL advsimd-intrinsics/vld1x2.c

This recently added test fails on arm. We haven't implemented these intrinsics for arm
(any volunteers?) so for now let's XFAIL these on that target.
Also, the float64 versions of these intrinsics are not supposed to be available on arm
so this patch slightly adjusts the test to not include them for aarch32.
In any case the entire test is XFAILed on arm, so this doesn't have any noticeable
effect.

The same number of tests (PASS) still occur on aarch64 but now they appear as XFAIL
rather than FAIL on arm.

    * gcc.target/aarch64/advsimd-intrinsics/vld1x2.c: Make float64
    tests specific to aarch64.  XFAIL test on arm.

From-SVN: r257090

6 years agore PR rtl-optimization/83985 (Compile time hog for 32-bit BE powerpc targets)
Jakub Jelinek [Fri, 26 Jan 2018 11:48:05 +0000 (12:48 +0100)]
re PR rtl-optimization/83985 (Compile time hog for 32-bit BE powerpc targets)

PR rtl-optimization/83985
* dce.c (deletable_insn_p): Return false for separate shrink wrapping
REG_CFA_RESTORE insns.
(delete_unmarked_insns): Don't ignore separate shrink wrapping
REG_CFA_RESTORE insns here.

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

From-SVN: r257087

6 years agore PR c/83989 (-Wrestrict false positive with malloc-style functions)
Jakub Jelinek [Fri, 26 Jan 2018 11:47:11 +0000 (12:47 +0100)]
re PR c/83989 (-Wrestrict false positive with malloc-style functions)

PR c/83989
* gimple-ssa-warn-restrict.c (builtin_memref::builtin_memref): Don't
use SSA_NAME_VAR as base for SSA_NAMEs with non-NULL SSA_NAME_VAR.

* c-c++-common/Wrestrict-3.c: New test.

From-SVN: r257086

6 years ago[ARC] Add ARCv2 core3 tune option.
Claudiu Zissulescu [Fri, 26 Jan 2018 11:34:31 +0000 (12:34 +0100)]
[ARC] Add ARCv2 core3 tune option.

ARCv2 Core3 cpus are comming with dbnz support. Add this feature on
the tune option.

gcc/
2018-01-26  Claudiu Zissulescu  <claziss@synopsys.com>

        * config/arc/arc-arch.h (arc_tune_attr): Add ARC_TUNE_CORE_3.
        * config/arc/arc.c (arc_sched_issue_rate): Use ARC_TUNE_... .
        (arc_init): Likewise.
        (arc_override_options): Likewise.
        (arc_file_start): Choose Tag_ARC_CPU_variation based on arc_tune
        value.
        (hwloop_fail): Use TARGET_DBNZ when we want to check for dbnz insn
        support.
        * config/arc/arc.h (TARGET_DBNZ): Define.
        * config/arc/arc.md (attr tune): Add core_3, use ARC_TUNE_... to
        properly set the tune attribute.
        (dbnz): Use TARGET_DBNZ guard.
        * config/arc/arc.opt (mtune): Add core3 option.

From-SVN: r257085

6 years ago[ARC] Rework delegitimate_address hook
Claudiu Zissulescu [Fri, 26 Jan 2018 11:34:16 +0000 (12:34 +0100)]
[ARC] Rework delegitimate_address hook

Delegitimize address is used to undo the obfuscating effect of PIC
addresses, returning the address in a way which is understood by the
compiler.  The old version of the hook was outdated, not beeing able
to recognize the current addresses generated by the ARC backend.

gcc/
2018-01-26  Claudiu Zissulescu  <claziss@synopsys.com>

* config/arc/arc.c (arc_delegitimize_address_0): Refactored to
recognize new pic like addresses.
(arc_delegitimize_address): Clean up.

testsuite/
2018-01-26  Claudiu Zissulescu  <claziss@synopsys.com>

* testsuite/gcc.target/arc/tdelegitimize_addr.c: New test.

From-SVN: r257084

6 years ago[ARC] Add support for reduced register file set
Claudiu Zissulescu [Fri, 26 Jan 2018 11:34:00 +0000 (12:34 +0100)]
[ARC] Add support for reduced register file set

gcc/
2018-01-26  Claudiu Zissulescu  <claziss@synopsys.com>

        * config/arc/arc-arches.def: Option mrf16 valid for all
        architectures.
        * config/arc/arc-c.def (__ARC_RF16__): New predefined macro.
        * config/arc/arc-cpus.def (em_mini): New cpu with rf16 on.
        * config/arc/arc-options.def (FL_RF16): Add mrf16 option.
        * config/arc/arc-tables.opt: Regenerate.
        * config/arc/arc.c (arc_conditional_register_usage): Handle
        reduced register file case.
        (arc_file_start): Set must have build attributes.
        * config/arc/arc.h (MAX_ARC_PARM_REGS): Conditional define using
        mrf16 option value.
        * config/arc/arc.opt (mrf16): Add new option.
        * config/arc/elf.h (ATTRIBUTE_PCS): Define.
        * config/arc/genmultilib.awk: Handle new mrf16 option.
        * config/arc/linux.h (ATTRIBUTE_PCS): Define.
        * config/arc/t-multilib: Regenerate.
        * doc/invoke.texi (ARC Options): Document mrf16 option.

libgcc/
2018-01-26  Claudiu Zissulescu  <claziss@synopsys.com>

        * config/arc/lib1funcs.S (__udivmodsi4): Use safe version for RF16
        option.
        (__divsi3): Use RF16 safe registers.
        (__modsi3): Likewise.

From-SVN: r257083

6 years ago[ARC] Add SJLI support.
Claudiu Zissulescu [Fri, 26 Jan 2018 11:33:42 +0000 (12:33 +0100)]
[ARC] Add SJLI support.

gcc/
2018-01-26  Claudiu Zissulescu  <claziss@synopsys.com>

        * config/arc/arc-protos.h: Add arc_is_secure_call_p proto.
        * config/arc/arc.c (arc_handle_secure_attribute): New function.
        (arc_attribute_table): Add 'secure_call' attribute.
        (arc_print_operand): Print secure call operand.
        (arc_function_ok_for_sibcall): Don't optimize tail calls when
        secure.
        (arc_is_secure_call_p): New function.
        * config/arc/arc.md (call_i): Add support for sjli instruction.
        (call_value_i): Likewise.
        * config/arc/constraints.md (Csc): New constraint.

From-SVN: r257082

6 years ago[ARC] Add JLI support.
Claudiu Zissulescu [Fri, 26 Jan 2018 11:33:22 +0000 (12:33 +0100)]
[ARC] Add JLI support.

The ARCv2 ISA provides the JLI instruction, which is two-byte instructions
that can be used to reduce code size in an application. To make use of it,
we provide two new function attributes 'jli_always' and 'jli_fixed' which
will force the compiler to call the indicated function using a jli_s
instruction. The compiler also generates the entries in the JLI table for
the case when we use 'jli_always' attribute. In the case of 'jli_fixed'
the compiler assumes a fixed position of the function into JLI
table. Thus, the user needs to provide an assembly file with the JLI table
for the final link. This is usefully when we want to have a table in ROM
and a second table in the RAM memory.

The jli instruction usage can be also forced without the need to annotate
the source code via '-mjli-always' command.

gcc/
2018-01-26  Claudiu Zissulescu  <claziss@synopsys.com>
            John Eric Martin <John.Martin@emmicro-us.com>

        * config/arc/arc-protos.h: Add arc_is_jli_call_p proto.
        * config/arc/arc.c (_arc_jli_section): New struct.
        (arc_jli_section): New type.
        (rc_jli_sections): New static variable.
        (arc_handle_jli_attribute): New function.
        (arc_attribute_table): Add jli_always and jli_fixed attribute.
        (arc_file_end): New function.
        (TARGET_ASM_FILE_END): Define.
        (arc_print_operand): Reuse 'S' letter for JLI output instruction.
        (arc_add_jli_section): New function.
        (jli_call_scan): Likewise.
        (arc_reorg): Call jli_call_scan.
        (arc_output_addsi): Remove 'S' from printing asm operand.
        (arc_is_jli_call_p): New function.
        * config/arc/arc.md (movqi_insn): Remove 'S' from printing asm
        operand.
        (movhi_insn): Likewise.
        (movsi_insn): Likewise.
        (movsi_set_cc_insn): Likewise.
        (loadqi_update): Likewise.
        (load_zeroextendqisi_update): Likewise.
        (load_signextendqisi_update): Likewise.
        (loadhi_update): Likewise.
        (load_zeroextendhisi_update): Likewise.
        (load_signextendhisi_update): Likewise.
        (loadsi_update): Likewise.
        (loadsf_update): Likewise.
        (movsicc_insn): Likewise.
        (bset_insn): Likewise.
        (bxor_insn): Likewise.
        (bclr_insn): Likewise.
        (bmsk_insn): Likewise.
        (bicsi3_insn): Likewise.
        (cmpsi_cc_c_insn): Likewise.
        (movsi_ne): Likewise.
        (movsi_cond_exec): Likewise.
        (clrsbsi2): Likewise.
        (norm_f): Likewise.
        (normw): Likewise.
        (swap): Likewise.
        (divaw): Likewise.
        (flag): Likewise.
        (sr): Likewise.
        (kflag): Likewise.
        (ffs): Likewise.
        (ffs_f): Likewise.
        (fls): Likewise.
        (call_i): Remove 'S' asm letter, add jli instruction.
        (call_value_i): Likewise.
        * config/arc/arc.op (mjli-always): New option.
        * config/arc/constraints.md (Cji): New constraint.
        * config/arc/fpx.md (addsf3_fpx): Remove 'S' from printing asm
        operand.
        (subsf3_fpx): Likewise.
        (mulsf3_fpx): Likewise.
        * config/arc/simdext.md (vendrec_insn): Remove 'S' from printing
        asm operand.
        * doc/extend.texi (ARC): Document 'jli-always' and 'jli-fixed'
        function attrbutes.
        * doc/invoke.texi (ARC): Document mjli-always option.

gcc/testsuite
2018-01-26  Claudiu Zissulescu  <claziss@synopsys.com>

        * gcc.target/arc/jli-1.c: New file.
        * gcc.target/arc/jli-2.c: Likewise.

Co-Authored-By: John Eric Martin <John.Martin@emmicro-us.com>
From-SVN: r257081

6 years agoCorrected date in changelog
Sebastian Perta [Fri, 26 Jan 2018 10:57:53 +0000 (10:57 +0000)]
Corrected date in changelog

From-SVN: r257080

6 years agorl78.c: if operand 2 is const avoid addition with 0 and use incw and decw where possible
Sebastian Perta [Fri, 26 Jan 2018 10:55:31 +0000 (10:55 +0000)]
rl78.c: if operand 2 is const avoid addition with 0 and use incw and decw where possible

2018-01-25  Sebastian Perta  <sebastian.perta@renesas.com>

* config/rl78/rl78.c: if operand 2 is const avoid addition with 0
and use incw and decw where possible
* testsuite/gcc.target/rl78/test_addsi3_internal.c: new file

From-SVN: r257079

6 years agoFix gcc.target/aarch64/sve/peel_ind_1.c for -mcmodel=tiny
Szabolcs Nagy [Fri, 26 Jan 2018 10:46:56 +0000 (10:46 +0000)]
Fix gcc.target/aarch64/sve/peel_ind_1.c for -mcmodel=tiny

gcc/testsuite/ChangeLog:

2018-01-26  Szabolcs Nagy  <szabolcs.nagy@arm.com>

* gcc.target/aarch64/sve/peel_ind_1.c: Match (adrp|adr) in scan-assembler.
* gcc.target/aarch64/sve/peel_ind_2.c: Likewise.
* gcc.target/aarch64/sve/peel_ind_3.c: Likewise.

From-SVN: r257078

6 years agore PR tree-optimization/81082 (Failure to vectorise after reassociating index computa...
Richard Biener [Fri, 26 Jan 2018 10:30:36 +0000 (10:30 +0000)]
re PR tree-optimization/81082 (Failure to vectorise after reassociating index computation)

2018-01-26  Richard Biener  <rguenther@suse.de>

PR tree-optimization/81082
* fold-const.c (fold_plusminus_mult_expr): Do not perform the
association if it requires casting to unsigned.
* match.pd ((A * C) +- (B * C) -> (A+-B)): New patterns derived
from fold_plusminus_mult_expr to catch important cases late when
range info is available.

* gcc.dg/vect/pr81082.c: New testcase.
* gcc.dg/tree-ssa/loop-15.c: XFAIL the (int)((unsigned)n + -1U) * n + n
simplification to n * n.

From-SVN: r257077

6 years agoConfigure USE_HIDDEN_LINKONCE on Solaris/x86
Rainer Orth [Fri, 26 Jan 2018 08:32:21 +0000 (08:32 +0000)]
Configure USE_HIDDEN_LINKONCE on Solaris/x86

gcc/testsuite:
* gcc.target/i386/mcount_pic.c: Only xfail get_pc_thunk scan on
Solaris 10.
* gcc.target/i386/pr63620.c: Likewise.

gcc:
* config/i386/sol2.h (USE_HIDDEN_LINKONCE): Remove.
* configure.ac (hidden_linkonce): New test.
* configure: Regenerate.
* config.in: Regenerate.

From-SVN: r257076

6 years agoFix various x86 avx512{bitalg, vpopcntdq, vbmi2} issues (PR target/83488)
Julia Koval [Fri, 26 Jan 2018 04:14:15 +0000 (05:14 +0100)]
Fix various x86 avx512{bitalg, vpopcntdq, vbmi2} issues (PR target/83488)

gcc/
* config/i386/avx512bitalgintrin.h (_mm512_bitshuffle_epi64_mask,
_mm512_mask_bitshuffle_epi64_mask, _mm256_bitshuffle_epi64_mask,
_mm256_mask_bitshuffle_epi64_mask, _mm_bitshuffle_epi64_mask,
_mm_mask_bitshuffle_epi64_mask): Fix type.
* config/i386/i386-builtin-types.def (UHI_FTYPE_V2DI_V2DI_UHI,
USI_FTYPE_V4DI_V4DI_USI): Remove.
* config/i386/i386-builtin.def (__builtin_ia32_vpshufbitqmb512_mask,
__builtin_ia32_vpshufbitqmb256_mask,
__builtin_ia32_vpshufbitqmb128_mask): Fix types.
* config/i386/i386.c (ix86_expand_args_builtin): Remove old types.
* config/i386/sse.md (VI1_AVX512VLBW): Change types.

gcc/testsuite/
* gcc.target/i386/avx512bitalg-vpshufbitqmb-1.c: Add -mavx512f -mavx512bw.
* gcc.target/i386/avx512bitalgvl-vpshufbitqmb-1.c: Add -mavx512bw.
* gcc.target/i386/i386.exp: Fix types.

From-SVN: r257075

6 years agoDaily bump.
GCC Administrator [Fri, 26 Jan 2018 00:16:20 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r257073

6 years agoPR84033, powerpc64le -moptimize-swaps bad code with vec_vbpermq
Alan Modra [Thu, 25 Jan 2018 23:57:18 +0000 (10:27 +1030)]
PR84033, powerpc64le -moptimize-swaps bad code with vec_vbpermq

vbpermq produces its output in bits 48..63 of the target vector reg,
so the output cannot be lane swapped.

gcc/
PR target/84033
* config/rs6000/rs6000-p8swap.c (rtx_is_swappable_p): Exclude
UNSPEC_VBPERMQ.  Sort other unspecs.
gcc/testsuite/
PR target/84033
* gcc.target/powerpc/swaps-p8-46.c: New.

From-SVN: r257070

6 years agocompiler: look through aliases when looking for methods
Ian Lance Taylor [Thu, 25 Jan 2018 23:13:31 +0000 (23:13 +0000)]
compiler: look through aliases when looking for methods

    Add a Type::is_alias method to remove some existing loops and avoid
    adding a new one.

    Test case is https://golang.org/cl/89935.

    Fixes golang/go#23489

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

From-SVN: r257069

6 years agocompiler: deref receiver types in mangled names
Ian Lance Taylor [Thu, 25 Jan 2018 23:10:35 +0000 (23:10 +0000)]
compiler: deref receiver types in mangled names

    This was the original intent, as reflected in the long comment at the
    start of names.cc, but I forgot to implement it.

    Also, remove a leading ".0" from the final name.  That could occur for
    a method whose receiver type starts with 'u', as in that case we
    prepend a space to the mangled name, to avoid confusion with the
    Unicode mangling, and the space turns into ".0".

    Also, if the Unicode encoding would cause the final to start with
    "..u" or "..U", add a leading underscore.

    Patch gotest to not get fooled by some names.

    The result of these changes is that all symbols start with a letter or
    an underscore.

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

From-SVN: r257068