Commit Graph

159411 Commits

Author SHA1 Message Date
Janne Blomqvist 7a15726687 Use pointer sized array indices.
Using pointer sized variables (e.g. size_t / ptrdiff_t) when the
variables are used as array indices allows accessing larger arrays,
and can be a slight performance improvement due to no need for sign or
zero extending, or masking.

Regtested on x86_64-pc-linux-gnu.

libgfortran/ChangeLog:

2018-01-31  Janne Blomqvist  <jb@gcc.gnu.org>

	* generated/cshift1_16.c (cshift1): Regenerated.
	* generated/cshift1_4.c (cshift1): Regenerated.
	* generated/cshift1_8.c (cshift1): Regenerated.
	* generated/eoshift1_16.c (eoshift1): Regenerated.
	* generated/eoshift1_4.c (eoshift1): Regenerated.
	* generated/eoshift1_8.c (eoshift1): Regenerated.
	* generated/eoshift3_16.c (eoshift3): Regenerated.
	* generated/eoshift3_4.c (eoshift3): Regenerated.
	* generated/eoshift3_8.c (eoshift3): Regenerated.
	* generated/in_pack_c10.c (internal_pack_c10): Regenerated.
	* generated/in_pack_c16.c (internal_pack_c16): Regenerated.
	* generated/in_pack_c4.c (internal_pack_c4): Regenerated.
	* generated/in_pack_c8.c (internal_pack_c8): Regenerated.
	* generated/in_pack_i1.c (internal_pack_1): Regenerated.
	* generated/in_pack_i16.c (internal_pack_16): Regenerated.
	* generated/in_pack_i2.c (internal_pack_2): Regenerated.
	* generated/in_pack_i4.c (internal_pack_4): Regenerated.
	* generated/in_pack_i8.c (internal_pack_8): Regenerated.
	* generated/in_pack_r10.c (internal_pack_r10): Regenerated.
	* generated/in_pack_r16.c (internal_pack_r16): Regenerated.
	* generated/in_pack_r4.c (internal_pack_r4): Regenerated.
	* generated/in_pack_r8.c (internal_pack_r8): Regenerated.
	* generated/in_unpack_c10.c (internal_unpack_c10): Regenerated.
	* generated/in_unpack_c16.c (internal_unpack_c16): Regenerated.
	* generated/in_unpack_c4.c (internal_unpack_c4): Regenerated.
	* generated/in_unpack_c8.c (internal_unpack_c8): Regenerated.
	* generated/in_unpack_i1.c (internal_unpack_1): Regenerated.
	* generated/in_unpack_i16.c (internal_unpack_16): Regenerated.
	* generated/in_unpack_i2.c (internal_unpack_2): Regenerated.
	* generated/in_unpack_i4.c (internal_unpack_4): Regenerated.
	* generated/in_unpack_i8.c (internal_unpack_8): Regenerated.
	* generated/in_unpack_r10.c (internal_unpack_r10): Regenerated.
	* generated/in_unpack_r16.c (internal_unpack_r16): Regenerated.
	* generated/in_unpack_r4.c (internal_unpack_r4): Regenerated.
	* generated/in_unpack_r8.c (internal_unpack_r8): Regenerated.
	* generated/reshape_c10.c (reshape_c10): Regenerated.
	* generated/reshape_c16.c (reshape_c16): Regenerated.
	* generated/reshape_c4.c (reshape_c4): Regenerated.
	* generated/reshape_c8.c (reshape_c8): Regenerated.
	* generated/reshape_i16.c (reshape_16): Regenerated.
	* generated/reshape_i4.c (reshape_4): Regenerated.
	* generated/reshape_i8.c (reshape_8): Regenerated.
	* generated/reshape_r10.c (reshape_r10): Regenerated.
	* generated/reshape_r16.c (reshape_r16): Regenerated.
	* generated/reshape_r4.c (reshape_r4): Regenerated.
	* generated/reshape_r8.c (reshape_r8): Regenerated.
	* generated/shape_i1.c (shape_1): Regenerated.
	* generated/shape_i16.c (shape_16): Regenerated.
	* generated/shape_i2.c (shape_2): Regenerated.
	* generated/shape_i4.c (shape_4): Regenerated.
	* generated/shape_i8.c (shape_8): Regenerated.
	* generated/spread_c10.c (spread_scalar_c10): Regenerated.
	* generated/spread_c16.c (spread_scalar_c16): Regenerated.
	* generated/spread_c4.c (spread_scalar_c4): Regenerated.
	* generated/spread_c8.c (spread_scalar_c8): Regenerated.
	* generated/spread_i1.c (spread_scalar_i1): Regenerated.
	* generated/spread_i16.c (spread_scalar_i16): Regenerated.
	* generated/spread_i2.c (spread_scalar_i2): Regenerated.
	* generated/spread_i4.c (spread_scalar_i4): Regenerated.
	* generated/spread_i8.c (spread_scalar_i8): Regenerated.
	* generated/spread_r10.c (spread_scalar_r10): Regenerated.
	* generated/spread_r16.c (spread_scalar_r16): Regenerated.
	* generated/spread_r4.c (spread_scalar_r4): Regenerated.
	* generated/spread_r8.c (spread_scalar_r8): Regenerated.
	* intrinsics/random.c (jump): Use size_t for array index in loop.
	(getosrandom): Likewise.
	(arandom_r4): Make n an index_type.
	(arandom_r8): Likewise.
	(arandom_r10): Likewise.
	(arandom_r16): Likewise.
	(scramble_seed): Use size_t for array index in loop.
	* m4/cshift1.m4: Make i an index_type.
	* m4/eoshift1.m4: Likewise.
	* m4/eoshift3.m4: Likewise.
	* m4/in_pack.m4: Make n an index_type.
	* m4/in_unpack.m4: Likewise.
	* m4/reshape.m4: Make n and dim index_type's.
	* m4/shape.m4: Make n an index_type.
	* m4/spread.m4: Likewise, use index_type argument rather than
	copying to int.
	* runtime/bounds.c (bounds_ifunction_return): Make n an
	index_type.
	* runtime/in_pack_generic.c (internal_pack): Likewise.
	* runtime/in_unpack_generic.c (internal_unpack): Make n and size
	index_type's.

From-SVN: r257234
2018-01-31 16:16:22 +02:00
Janne Blomqvist 9f3dcd1414 PR 78534 Reinstate better string copy algorithm
As part of the change to larger character lengths, the string copy
algorithm was temporarily pessimized to get around some spurious
-Wstringop-overflow warnings.  Having tried a number of variations of
this algorithm I have managed to get it down to one spurious warning,
only with -O1 optimization, in the testsuite.  This patch reinstates
the optimized variant and modifies this one testcase to ignore the
warning.

Regtested on x86_64-pc-linux-gnu.

gcc/fortran/ChangeLog:

2018-01-31  Janne Blomqvist  <jb@gcc.gnu.org>

	PR fortran/78534
	* trans-expr.c (fill_with_spaces): Use memset instead of
	generating loop.
	(gfc_trans_string_copy): Improve opportunity to use builtins with
	constant lengths.

gcc/testsuite/ChangeLog:

2018-01-31  Janne Blomqvist  <jb@gcc.gnu.org>

	PR fortran/78534
	* gfortran.dg/allocate_deferred_char_scalar_1.f03: Prune
	-Wstringop-overflow warnings due to spurious warning with -O1.
	* gfortran.dg/char_cast_1.f90: Update dump scan pattern.
	* gfortran.dg/transfer_intrinsic_1.f90: Likewise.

From-SVN: r257233
2018-01-31 15:23:20 +02:00
Richard Biener 957a25ab0c re PR tree-optimization/84132 (tree-data-ref.c:3938: poor coding ?)
2018-01-31  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/84132
	* tree-data-ref.c (analyze_miv_subscript): Properly
	check whether evolution_function_is_affine_multivariate_p
	before calling gcd_of_steps_may_divide_p.

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

From-SVN: r257232
2018-01-31 13:07:53 +00:00
Jan Hubicka 8ede319fa9 pr81360.C: Drop unintended -O2 from dg-options and dg-final scan.
* g++.dg/torture/pr81360.C: Drop unintended -O2 from dg-options and
	dg-final scan.

From-SVN: r257230
2018-01-31 11:37:15 +00:00
Julia Koval e6c7bfdbf3 re PR target/83618 (_rdpid_u32 doesn't work on 64-bit targets as gas expects the 64-bit register)
PR target/83618

gcc/
	* config/i386/i386.c (ix86_expand_builtin): Handle IX86_BUILTIN_RDPID.
	* config/i386/i386.md (rdpid_rex64) New.
	(rdpid): Make 32bit only.

gcc/testsuite/
	* gcc.target/i386/rdpid.c: Remove "eax".

From-SVN: r257229
2018-01-31 12:06:20 +01:00
Aldy Hernandez 7aec1b8209 re PR lto/84105 (Segmentation fault in pp_tree_identifier() during LTO)
PR lto/84105
	* tree-pretty-print.c (dump_generic_node): Handle a TYPE_NAME with
	an IDENTIFIER_NODE for FUNCTION_TYPE's.

From-SVN: r257228
2018-01-31 10:42:52 +00:00
Eric Botcazou 73df9303b7 Revert
2018-01-12  Eric Botcazou  <ebotcazou@adacore.com>

	* config/sparc/sparc.md (vxworks_load_got): Set the GOT register.

From-SVN: r257227
2018-01-31 10:24:19 +00:00
Kyrylo Tkachov 39058d4b4c [AArch64] PR tree-optimization/64946: XFAIL gcc.target/aarch64/vect-abs-compile.c
This test has been failing since forever, it has never passed AFAIK.
The PR details the vectoriser deficiency.
I propose we xfail this with a reference to the PR.

        PR tree-optimization/64946
        * gcc.target/aarch64/vect-abs-compile.c: XFAIL byte and half-word
        scan-assembler checks.

From-SVN: r257225
2018-01-31 10:06:45 +00:00
Eric Botcazou ae20d760b1 re PR rtl-optimization/84071 (wrong elimination of zero-extension after sign-extended load)
PR rtl-optimization/84071
	* combine.c (record_dead_and_set_regs_1): Record the source unmodified
	for a paradoxical SUBREG on a WORD_REGISTER_OPERATIONS target.

From-SVN: r257224
2018-01-31 10:03:06 +00:00
Claudiu Zissulescu b6fb257bd6 [ARC] Add 'aux' variable attribute.
The 'aux' variable attribute is used to directly access the auxiliary
register space from C.

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

        * config/arc/arc.c (arc_handle_aux_attribute): New function.
        (arc_attribute_table): Add 'aux' attribute.
        (arc_in_small_data_p): Consider aux like variables.
        (arc_is_aux_reg_p): New function.
        (arc_asm_output_aligned_decl_local): Ignore 'aux' like variables.
        (arc_get_aux_arg): New function.
        (prepare_move_operands): Handle aux-register access.
        (arc_handle_aux_attribute): New function.
        * doc/extend.texi (ARC Variable attributes): Add subsection.

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

        * gcc.target/arc/taux-1.c: New test.
        * gcc.target/arc/taux-2.c: Likewise.

From-SVN: r257223
2018-01-31 11:01:48 +01:00
Claudiu Zissulescu 8180c03ff0 [ARC] Add 'uncached' attribute.
The _Uncached type qualifier can be used to bypass the cache without
resorting to declaring variables as volatile.

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

	* config/arc/arc-protos.h (arc_is_uncached_mem_p): Function proto.
	* config/arc/arc.c (arc_handle_uncached_attribute): New function.
	(arc_attribute_table): Add 'uncached' attribute.
	(arc_print_operand): Print '.di' flag for uncached memory
	accesses.
	(arc_in_small_data_p): Do not consider for small data the uncached
	types.
	(arc_is_uncached_mem_p): New function.
	* config/arc/predicates.md (compact_store_memory_operand): Check
	for uncached memory accesses.
	(nonvol_nonimm_operand): Likewise.
	* gcc/doc/extend.texi (ARC Type Attribute): New subsection.

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

	* gcc.target/arc/uncached.c: New test.

From-SVN: r257222
2018-01-31 11:01:34 +01:00
Rainer Orth 2f857e1b07 Fix gnat.dg/lto20.adb XPASS
PR lto/83954
	* gnat.dg/lto20.adb: Remove dg-excess-errors.

From-SVN: r257221
2018-01-31 09:07:55 +00:00
Jakub Jelinek 1306a81d81 re PR preprocessor/69869 (internal compiler error: Segmentation fault in call to skip_macro_block_comment when using '-traditional-cpp')
PR preprocessor/69869
	* traditional.c (skip_macro_block_comment): Return bool, true if
	the macro block comment is unterminated.
	(copy_comment): Use return value from skip_macro_block_comment instead
	of always false.

	* gcc.dg/cpp/trad/pr69869.c: New test.

From-SVN: r257220
2018-01-31 09:31:52 +01:00
Jakub Jelinek 7b56ebc347 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
2018-01-31 09:26:52 +01:00
Ian Lance Taylor ebc2f4010d 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
2018-01-31 06:17:25 +00:00
Jeff Law 5837571173 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
2018-01-30 22:02:30 -07:00
Ian Lance Taylor 61ddc5ea25 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
2018-01-31 02:11:03 +00:00
GCC Administrator f0ab0c3a96 Daily bump.
From-SVN: r257215
2018-01-31 00:16:26 +00:00
Jakub Jelinek f2adfb898b 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
2018-01-30 23:57:51 +01:00
Thomas Koenig 8fb2cc6b24 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
2018-01-30 22:35:34 +00:00
Rainer Orth f58d41ff24 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
2018-01-30 21:18:40 +00:00
Janus Weil 3d94369825 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
2018-01-30 22:15:55 +01:00
Rainer Orth 940ac3aada Add path for gcc.target/powerpc/pr84112.c in ChangeLog.
From-SVN: r257207
2018-01-30 20:54:34 +00:00
Thomas Koenig dca9e8be87 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
2018-01-30 20:49:49 +00:00
Rainer Orth 881f7c9735 Fix g++.dg/torture/pr81360.C scan-ipa-dump
* g++.dg/torture/pr81360.C: Add -fdump-ipa-icf to dg-options.

From-SVN: r257205
2018-01-30 20:33:20 +00:00
Vladimir Makarov 634c3ff018 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
2018-01-30 20:28:59 +00:00
Jakub Jelinek c5370327b0 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
2018-01-30 21:03:04 +01:00
Jason Merrill b1c7b29a3c PR c++/84091 - ICE with local class in lambda in template.
* decl2.c (determine_visibility): Look for outer containing template
	instantiation.

From-SVN: r257202
2018-01-30 15:01:36 -05:00
Jason Merrill 8d79f003d3 PR c++/84098 - ICE with lambda in template NSDMI.
* pt.c (instantiate_class_template_1): Ignore more lambdas.

From-SVN: r257199
2018-01-30 14:05:12 -05:00
Thomas Koenig b6019ab18c 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
2018-01-30 18:20:27 +00:00
Alexandre Oliva cacb4a794f [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
2018-01-30 17:40:50 +00:00
Aaron Sawdey a5d37900ad 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
2018-01-30 11:27:16 -06:00
Bill Seurer 86145a19ab [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
2018-01-30 16:51:14 +00:00
Jakub Jelinek a59b07c1e1 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
2018-01-30 16:58:22 +01:00
Jan Hubicka 9efd61f83b 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
2018-01-30 13:50:45 +00:00
Jan Hubicka 9a4841a370 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
2018-01-30 13:23:39 +00:00
Jan Hubicka 44c945e62c 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
2018-01-30 13:17:40 +00:00
Jan Hubicka 6439c35806 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
2018-01-30 12:46:19 +00:00
Richard Biener 85bb2f9a30 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
2018-01-30 11:19:47 +00:00
Rainer Orth 924d6d0b69 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
2018-01-30 09:53:29 +00:00
Richard Sandiford 8711e791de [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
2018-01-30 09:48:24 +00:00
Richard Sandiford e89b01f2b1 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
2018-01-30 09:45:58 +00:00
Richard Sandiford 65aa25a443 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
2018-01-30 09:45:40 +00:00
Kyrylo Tkachov 502f644786 [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
2018-01-30 09:13:39 +00:00
Kirill Yukhin a236a499b3 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
2018-01-30 08:21:22 +00:00
Jeff Law 6beb01d08c 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
2018-01-29 22:30:40 -07:00
Ian Lance Taylor 111c8b4ce9 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
2018-01-30 04:48:55 +00:00
GCC Administrator a8e4cea41c Daily bump.
From-SVN: r257170
2018-01-30 00:16:20 +00:00
Christoph Spiel 99ae7ce5ca 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
2018-01-30 00:38:01 +01:00
Michael Meissner ce6ecbac46 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
2018-01-29 22:30:34 +00:00