Commit Graph

158579 Commits

Author SHA1 Message Date
Richard Sandiford
fba05d9e9a match.pd handling of three-constant bitops
natch.pd tries to reassociate two bit operations if both of them have
constant operands.  However, with the polynomial integers added later,
there's no guarantee that a bit operation on two integers can be folded
at compile time.  This means that the pattern can trigger for operations
on three constants, and as things stood could endlessly oscillate
between the two associations.

This patch keeps the existing pattern for the normal case of a
non-constant first operand.  When all three operands are constant it
tries to find a pair of constants that do fold.  If none do, it keeps
the original expression as-was.

2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
	    Alan Hayward  <alan.hayward@arm.com>
	    David Sherwood  <david.sherwood@arm.com>

gcc/
	* match.pd: Handle bit operations involving three constants
	and try to fold one pair.

Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
Co-Authored-By: David Sherwood <david.sherwood@arm.com>

From-SVN: r256125
2018-01-03 07:13:57 +00:00
Richard Sandiford
0f26839a0a Add an alternative vector loop iv mechanism
Normally we adjust the vector loop so that it iterates:

   (original number of scalar iterations - number of peels) / VF

times, enforcing this using an IV that starts at zero and increments
by one each iteration.  However, dividing by VF would be expensive
for variable VF, so this patch adds an alternative in which the IV
increments by VF each iteration instead.  We then need to take care
to handle possible overflow in the IV.

The new mechanism isn't used yet; a later patch replaces the
"if (1)" with a check for variable VF.

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

gcc/
	* tree-vect-loop-manip.c: Include gimple-fold.h.
	(slpeel_make_loop_iterate_ntimes): Add step, final_iv and
	niters_maybe_zero parameters.  Handle other cases besides a step of 1.
	(vect_gen_vector_loop_niters): Add a step_vector_ptr parameter.
	Add a path that uses a step of VF instead of 1, but disable it
	for now.
	(vect_do_peeling): Add step_vector, niters_vector_mult_vf_var
	and niters_no_overflow parameters.  Update calls to
	slpeel_make_loop_iterate_ntimes and vect_gen_vector_loop_niters.
	Create a new SSA name if the latter choses to use a ste other
	than zero, and return it via niters_vector_mult_vf_var.
	* tree-vect-loop.c (vect_transform_loop): Update calls to
	vect_do_peeling, vect_gen_vector_loop_niters and
	slpeel_make_loop_iterate_ntimes.
	* tree-vectorizer.h (slpeel_make_loop_iterate_ntimes, vect_do_peeling)
	(vect_gen_vector_loop_niters): Update declarations after above changes.

From-SVN: r256124
2018-01-03 07:13:50 +00:00
Ben Elliston
e50ffab340 Summary: Replace a few instances of 8 leading spaces with horizontal tabs.
From-SVN: r256123
2018-01-03 15:32:45 +11:00
Ben Elliston
ef7d7cf50d config.guess: Import latest version.
* config.guess: Import latest version.
	* config.sub: Likewise.

From-SVN: r256122
2018-01-03 15:25:18 +11:00
Michael Meissner
2d71e7b8d4 rs6000.md (floor<mode>2): Add support for IEEE 128-bit round to integer instructions.
[gcc]
2018-01-02  Michael Meissner  <meissner@linux.vnet.ibm.com>

	* config/rs6000/rs6000.md (floor<mode>2): Add support for IEEE
	128-bit round to integer instructions.
	(ceil<mode>2): Likewise.
	(btrunc<mode>2): Likewise.
	(round<mode>2): Likewise.

[gcc/testsuite]
2018-01-02  Michael Meissner  <meissner@linux.vnet.ibm.com>

	* gcc.target/powerpc/float128-hw2.c: Add tests for ceilf128,
	floorf128, truncf128, and roundf128.
	* gcc.target/powerpc/float128-hw5.c: New tests for _Float128
	optimizations added in match.pd.
	* gcc.target/powerpc/float128-hw6.c: Likewise.
	* gcc.target/powerpc/float128-hw7.c: Likewise.
	* gcc.target/powerpc/float128-hw8.c: Likewise.
	* gcc.target/powerpc/float128-hw9.c: Likewise.
	* gcc.target/powerpc/float128-hw10.c: Likewise.
	* gcc.target/powerpc/float128-hw11.c: Likewise.

From-SVN: r256118
2018-01-03 02:38:09 +00:00
GCC Administrator
50d75500a3 Daily bump.
From-SVN: r256116
2018-01-03 00:16:18 +00:00
Aaron Sawdey
3b0cb1a553 rs6000-string.c (expand_block_move): Allow the use of unaligned VSX load/store on P8/P9.
2018-01-02  Aaron Sawdey  <acsawdey@linux.vnet.ibm.com>

        * config/rs6000/rs6000-string.c (expand_block_move): Allow the use of
        unaligned VSX load/store on P8/P9.
        (expand_block_clear): Allow the use of unaligned VSX
	load/store on P8/P9.

From-SVN: r256112
2018-01-02 17:01:43 -06:00
Bill Schmidt
6012c652c7 rs6000-p8swap.c (swap_feeds_both_load_and_store): New function.
2018-01-02  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	* config/rs6000/rs6000-p8swap.c (swap_feeds_both_load_and_store):
	New function.
	(rs6000_analyze_swaps): Mark a web unoptimizable if it contains a
	swap associated with both a load and a store.

From-SVN: r256111
2018-01-02 22:56:45 +00:00
Andrew Waterman
f1bdc63a89 RISC-V: Fix for icache flush issue on multicore processors.
gcc/
	* config/riscv/linux.h (ICACHE_FLUSH_FUNC): New.
	* config/riscv/riscv.md (clear_cache): Use it.

From-SVN: r256109
2018-01-02 12:34:01 -08:00
Artyom Skrobov
a7e92aff74 * web.c: Remove out-of-date comment.
From-SVN: r256106
2018-01-02 12:16:44 -07:00
Richard Sandiford
2bc6986d01 Fix REG_ARGS_SIZE handling when pushing TLS addresses
The new assert in add_args_size_note triggered for gcc.dg/tls/opt-3.c
and others on m68k.  This looks like a pre-existing bug: if we pushed
a value that needs a call to something like __tls_get_addr, we ended
up with two different REG_ARGS_SIZE notes on the same instruction.

It seems to be OK for emit_single_push_insn to push something that
needs a call to __tls_get_addr:

      /* We have to allow non-call_pop patterns for the case
	 of emit_single_push_insn of a TLS address.  */
      if (GET_CODE (pat) != PARALLEL)
	return 0;

so I think the bug is in the way this is handled rather than the fact
that it occurs at all.

If we're pushing a value X that needs a call C to calculate, we'll
add REG_ARGS_SIZE notes to the pushes and pops for C as part of the
call sequence.  Then emit_single_push_insn calls fixup_args_size_notes
on the whole push sequence (the calculation of X, including C,
and the push of X itself).  This is where the double notes came from.
But emit_single_push_insn_1 adjusted stack_pointer_delta *before* the
push, so the notes added for C were relative to the situation after
the future push of X rather than before it.

Presumably this didn't matter in practice because the note added
second tended to trump the note added first.  But code is allowed to
walk REG_NOTES without having to disregard secondary notes.

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

gcc/
	* expr.c (fixup_args_size_notes): Check that any existing
	REG_ARGS_SIZE notes are correct, and don't try to re-add them.
	(emit_single_push_insn_1): Move stack_pointer_delta adjustment to...
	(emit_single_push_insn): ...here.

From-SVN: r256105
2018-01-02 19:14:43 +00:00
Richard Sandiford
cd5ff7bc32 Make CONST_VECTOR_ELT handle implicitly-encoded elements
This patch makes CONST_VECTOR_ELT handle implicitly-encoded elements,
in a similar way to VECTOR_CST_ELT.

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

gcc/
	* rtl.h (CONST_VECTOR_ELT): Redefine to const_vector_elt.
	(const_vector_encoded_nelts): New function.
	(CONST_VECTOR_NUNITS): Redefine to use GET_MODE_NUNITS.
	(const_vector_int_elt, const_vector_elt): Declare.
	* emit-rtl.c (const_vector_int_elt_1): New function.
	(const_vector_elt): Likewise.
	* simplify-rtx.c (simplify_immed_subreg): Avoid taking the address
	of CONST_VECTOR_ELT.

From-SVN: r256104
2018-01-02 18:28:14 +00:00
Richard Sandiford
3d8ca53dd9 Make more use of rtx_vector_builder
This patch makes various bits of CONST_VECTOR-building code use
rtx_vector_builder, operating directly on a specific encoding.

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

gcc/
	* expr.c: Include rtx-vector-builder.h.
	(const_vector_mask_from_tree): Use rtx_vector_builder and operate
	directly on the tree encoding.
	(const_vector_from_tree): Likewise.
	* optabs.c: Include rtx-vector-builder.h.
	(expand_vec_perm_var): Use rtx_vector_builder and create a repeating
	sequence of "u" values.
	* vec-perm-indices.c: Include rtx-vector-builder.h.
	(vec_perm_indices_to_rtx): Use rtx_vector_builder and operate
	directly on the vec_perm_indices encoding.

From-SVN: r256103
2018-01-02 18:28:06 +00:00
Richard Sandiford
3877c56065 New CONST_VECTOR layout
This patch makes CONST_VECTOR use the same encoding as VECTOR_CST.

One problem that occurs in RTL but not at the tree level is that a fair
amount of code uses XVEC and XVECEXP directly on CONST_VECTORs (which is
valid, just with looser checking).  This is complicated by the fact that
vectors are also represented as PARALLELs in some target interfaces,
so using XVECEXP is a good polymorphic way of handling both forms.

Rather than try to untangle all that, the best approach seemed to be to
continue to encode every element in a fixed-length vector.  That way only
target-independent and AArch64 code need to be precise about using
CONST_VECTOR_ELT over XVECEXP.

After this change is no longer valid to modify CONST_VECTORs in-place.
This needed some fix-up in the powerpc backends.

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

gcc/
	* doc/rtl.texi (const_vector): Describe new encoding scheme.
	* Makefile.in (OBJS): Add rtx-vector-builder.o.
	* rtx-vector-builder.h: New file.
	* rtx-vector-builder.c: Likewise.
	* rtl.h (rtx_def::u2): Add a const_vector field.
	(CONST_VECTOR_NPATTERNS): New macro.
	(CONST_VECTOR_NELTS_PER_PATTERN): Likewise.
	(CONST_VECTOR_DUPLICATE_P): Likewise.
	(CONST_VECTOR_STEPPED_P): Likewise.
	(CONST_VECTOR_ENCODED_ELT): Likewise.
	(const_vec_duplicate_p): Check for a duplicated vector encoding.
	(unwrap_const_vec_duplicate): Likewise.
	(const_vec_series_p): Check for a non-duplicated vector encoding.
	Say that the function only returns true for integer vectors.
	* emit-rtl.c: Include rtx-vector-builder.h.
	(gen_const_vec_duplicate_1): Delete.
	(gen_const_vector): Call gen_const_vec_duplicate instead of
	gen_const_vec_duplicate_1.
	(const_vec_series_p_1): Operate directly on the CONST_VECTOR encoding.
	(gen_const_vec_duplicate): Use rtx_vector_builder.
	(gen_const_vec_series): Likewise.
	(gen_rtx_CONST_VECTOR): Likewise.
	* config/powerpcspe/powerpcspe.c: Include rtx-vector-builder.h.
	(swap_const_vector_halves): Take an rtx pointer rather than rtx.
	Build a new vector rather than modifying a CONST_VECTOR in-place.
	(handle_special_swappables): Update call accordingly.
	* config/rs6000/rs6000-p8swap.c: Include rtx-vector-builder.h.
	(swap_const_vector_halves): Take an rtx pointer rather than rtx.
	Build a new vector rather than modifying a CONST_VECTOR in-place.
	(handle_special_swappables): Update call accordingly.

From-SVN: r256102
2018-01-02 18:27:50 +00:00
Richard Sandiford
8eff75e0d2 Use CONST_VECTOR_ELT instead of XVECEXP
This patch replaces target-independent uses of XVECEXP with uses
of CONST_VECTOR_ELT.  This kind of replacement isn't necessary
for code specific to targets other than AArch64.

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

gcc/
	* simplify-rtx.c (simplify_const_binary_operation): Use
	CONST_VECTOR_ELT instead of XVECEXP.

From-SVN: r256101
2018-01-02 18:27:42 +00:00
Richard Sandiford
b00cb3bfa5 Use ssizetype selectors for autovectorised VEC_PERM_EXPRs
The previous patches mean that there's no reason that constant
VEC_PERM_EXPRs need to have the same shape as the data inputs.
This patch makes the autovectoriser use sizetype elements instead,
so that indices don't get truncated for large or variable-length
vectors.

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

gcc/
	* tree-cfg.c (verify_gimple_assign_ternary): Allow the size of
	the selector elements to be different from the data elements
	if the selector is a VECTOR_CST.
	* tree-vect-stmts.c (vect_gen_perm_mask_any): Use a vector of
	ssizetype for the selector.

From-SVN: r256100
2018-01-02 18:27:35 +00:00
Richard Sandiford
d386748304 Use vec_perm_builder::series_p in shift_amt_for_vec_perm_mask
This patch makes shift_amt_for_vec_perm_mask use series_p to check
for the simple case of a natural linear series before falling back
to testing each element individually.  The series_p test works with
variable-length vectors but testing every individual element doesn't.

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

gcc/
	* optabs.c (shift_amt_for_vec_perm_mask): Try using series_p
	before testing each element individually.
	* tree-vect-generic.c (lower_vec_perm): Likewise.

From-SVN: r256099
2018-01-02 18:27:24 +00:00
Richard Sandiford
1a1c441dbe Rework VEC_PERM_EXPR folding
This patch reworks the VEC_PERM_EXPR folding so that more of it
works for variable-length vectors.  E.g. it means that we can
now recognise variable-length permutes that reduce to a single
vector, or cases in which a variable-length permute only needs
one input.  There should be no functional change for fixed-length
vectors.

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

gcc/
	* selftest.h (selftest::vec_perm_indices_c_tests): Declare.
	* selftest-run-tests.c (selftest::run_tests): Call it.
	* vector-builder.h (vector_builder::operator ==): New function.
	(vector_builder::operator !=): Likewise.
	* vec-perm-indices.h (vec_perm_indices::series_p): Declare.
	(vec_perm_indices::all_from_input_p): New function.
	* vec-perm-indices.c (vec_perm_indices::series_p): Likewise.
	(test_vec_perm_12, selftest::vec_perm_indices_c_tests): Likewise.
	* fold-const.c (fold_ternary_loc): Use tree_to_vec_perm_builder
	instead of reading the VECTOR_CST directly.  Detect whether both
	vector inputs are the same before constructing the vec_perm_indices,
	and update the number of inputs argument accordingly.  Use the
	utility functions added above.  Only construct sel2 if we need to.

From-SVN: r256098
2018-01-02 18:27:15 +00:00
Richard Sandiford
d980067b1e Use explicit encodings for simple permutes
This patch makes users of vec_perm_builders use the compressed encoding
where possible.  This means that they work with variable-length vectors.

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

gcc/
	* optabs.c (expand_vec_perm_var): Use an explicit encoding for
	the broadcast of the low byte.
	(expand_mult_highpart): Use an explicit encoding for the permutes.
	* optabs-query.c (can_mult_highpart_p): Likewise.
	* tree-vect-loop.c (calc_vec_perm_mask_for_shift): Likewise.
	* tree-vect-stmts.c (perm_mask_for_reverse): Likewise.
	(vectorizable_bswap): Likewise.
	* tree-vect-data-refs.c (vect_grouped_store_supported): Use an
	explicit encoding for the power-of-2 permutes.
	(vect_permute_store_chain): Likewise.
	(vect_grouped_load_supported): Likewise.
	(vect_permute_load_chain): Likewise.

From-SVN: r256097
2018-01-02 18:27:05 +00:00
Richard Sandiford
736d0f2878 Add a vec_perm_indices_to_tree helper function
This patch adds a function for creating a VECTOR_CST from a
vec_perm_indices, operating directly on the encoding.

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

gcc/
	* vec-perm-indices.h (vec_perm_indices_to_tree): Declare.
	* vec-perm-indices.c (vec_perm_indices_to_tree): New function.
	* tree-ssa-forwprop.c (simplify_vector_constructor): Use it.
	* tree-vect-slp.c (vect_transform_slp_perm_load): Likewise.
	* tree-vect-stmts.c (vectorizable_bswap): Likewise.
	(vect_gen_perm_mask_any): Likewise.

From-SVN: r256096
2018-01-02 18:26:56 +00:00
Richard Sandiford
e3342de49c Make vec_perm_indices use new vector encoding
This patch changes vec_perm_indices from a plain vec<> to a class
that stores a canonicalized permutation, using the same encoding
as for VECTOR_CSTs.  This means that vec_perm_indices now carries
information about the number of vectors being permuted (currently
always 1 or 2) and the number of elements in each input vector.

A new vec_perm_builder class is used to actually build up the vector,
like tree_vector_builder does for trees.  vec_perm_indices is the
completed representation, a bit like VECTOR_CST is for trees.

The patch just does a mechanical conversion of the code to
vec_perm_builder: a later patch uses explicit encodings where possible.

The point of all this is that it makes the representation suitable
for variable-length vectors.  It's no longer necessary for the
underlying vec<>s to store every element explicitly.

In int-vector-builder.h, "using the same encoding as tree and rtx constants"
describes the endpoint -- adding the rtx encoding comes later.

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

gcc/
	* int-vector-builder.h: New file.
	* vec-perm-indices.h: Include int-vector-builder.h.
	(vec_perm_indices): Redefine as an int_vector_builder.
	(auto_vec_perm_indices): Delete.
	(vec_perm_builder): Redefine as a stand-alone class.
	(vec_perm_indices::vec_perm_indices): New function.
	(vec_perm_indices::clamp): Likewise.
	* vec-perm-indices.c: Include fold-const.h and tree-vector-builder.h.
	(vec_perm_indices::new_vector): New function.
	(vec_perm_indices::new_expanded_vector): Update for new
	vec_perm_indices class.
	(vec_perm_indices::rotate_inputs): New function.
	(vec_perm_indices::all_in_range_p): Operate directly on the
	encoded form, without computing elided elements.
	(tree_to_vec_perm_builder): Operate directly on the VECTOR_CST
	encoding.  Update for new vec_perm_indices class.
	* optabs.c (expand_vec_perm_const): Create a vec_perm_indices for
	the given vec_perm_builder.
	(expand_vec_perm_var): Update vec_perm_builder constructor.
	(expand_mult_highpart): Use vec_perm_builder instead of
	auto_vec_perm_indices.
	* optabs-query.c (can_mult_highpart_p): Use vec_perm_builder and
	vec_perm_indices instead of auto_vec_perm_indices.  Use a single
	or double series encoding as appropriate.
	* fold-const.c (fold_ternary_loc): Use vec_perm_builder and
	vec_perm_indices instead of auto_vec_perm_indices.
	* tree-ssa-forwprop.c (simplify_vector_constructor): Likewise.
	* tree-vect-data-refs.c (vect_grouped_store_supported): Likewise.
	(vect_permute_store_chain): Likewise.
	(vect_grouped_load_supported): Likewise.
	(vect_permute_load_chain): Likewise.
	(vect_shift_permute_load_chain): Likewise.
	* tree-vect-slp.c (vect_build_slp_tree_1): Likewise.
	(vect_transform_slp_perm_load): Likewise.
	(vect_schedule_slp_instance): Likewise.
	* tree-vect-stmts.c (perm_mask_for_reverse): Likewise.
	(vectorizable_mask_load_store): Likewise.
	(vectorizable_bswap): Likewise.
	(vectorizable_store): Likewise.
	(vectorizable_load): Likewise.
	* tree-vect-generic.c (lower_vec_perm): Use vec_perm_builder and
	vec_perm_indices instead of auto_vec_perm_indices.  Use
	tree_to_vec_perm_builder to read the vector from a tree.
	* tree-vect-loop.c (calc_vec_perm_mask_for_shift): Take a
	vec_perm_builder instead of a vec_perm_indices.
	(have_whole_vector_shift): Use vec_perm_builder and
	vec_perm_indices instead of auto_vec_perm_indices.  Leave the
	truncation to calc_vec_perm_mask_for_shift.
	(vect_create_epilog_for_reduction): Likewise.
	* config/aarch64/aarch64.c (expand_vec_perm_d::perm): Change
	from auto_vec_perm_indices to vec_perm_indices.
	(aarch64_expand_vec_perm_const_1): Use rotate_inputs on d.perm
	instead of changing individual elements.
	(aarch64_vectorize_vec_perm_const): Use new_vector to install
	the vector in d.perm.
	* config/arm/arm.c (expand_vec_perm_d::perm): Change
	from auto_vec_perm_indices to vec_perm_indices.
	(arm_expand_vec_perm_const_1): Use rotate_inputs on d.perm
	instead of changing individual elements.
	(arm_vectorize_vec_perm_const): Use new_vector to install
	the vector in d.perm.
	* config/powerpcspe/powerpcspe.c (rs6000_expand_extract_even):
	Update vec_perm_builder constructor.
	(rs6000_expand_interleave): Likewise.
	* config/rs6000/rs6000.c (rs6000_expand_extract_even): Likewise.
	(rs6000_expand_interleave): Likewise.

From-SVN: r256095
2018-01-02 18:26:47 +00:00
Richard Sandiford
6da64f1b32 Check whether a vector of QIs can store all indices
The patch to remove the vec_perm_const optab checked whether replacing
a constant permute with a variable permute is safe, or whether it might
truncate the indices.  This patch adds a corresponding check for whether
variable permutes can be lowered to QImode-based permutes.

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

gcc/
	* optabs-query.c (can_vec_perm_var_p): Check whether lowering
	to qimode could truncate the indices.
	* optabs.c (expand_vec_perm_var): Likewise.

From-SVN: r256094
2018-01-02 18:26:35 +00:00
Richard Sandiford
f151c9e141 Remove vec_perm_const optab
One of the changes needed for variable-length VEC_PERM_EXPRs -- and for
long fixed-length VEC_PERM_EXPRs -- is the ability to use constant
selectors that wouldn't fit in the vectors being permuted.  E.g. a
permute on two V256QIs can't be done using a V256QI selector.

At the moment constant permutes use two interfaces:
targetm.vectorizer.vec_perm_const_ok for testing whether a permute is
valid and the vec_perm_const optab for actually emitting the permute.
The former gets passed a vec<> selector and the latter an rtx selector.
Most ports share a lot of code between the hook and the optab, with a
wrapper function for each interface.

We could try to keep that interface and require ports to define wider
vector modes that could be attached to the CONST_VECTOR (e.g. V256HI or
V256SI in the example above).  But building a CONST_VECTOR rtx seems a bit
pointless here, since the expand code only creates the CONST_VECTOR in
order to call the optab, and the first thing the target does is take
the CONST_VECTOR apart again.

The easiest approach therefore seemed to be to remove the optab and
reuse the target hook to emit the code.  One potential drawback is that
it's no longer possible to use match_operand predicates to force
operands into the required form, but in practice all targets want
register operands anyway.

The patch also changes vec_perm_indices into a class that provides
some simple routines for handling permutations.  A later patch will
flesh this out and get rid of auto_vec_perm_indices, but I didn't
want to do all that in this patch and make it more complicated than
it already is.

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

gcc/
	* Makefile.in (OBJS): Add vec-perm-indices.o.
	* vec-perm-indices.h: New file.
	* vec-perm-indices.c: Likewise.
	* target.h (vec_perm_indices): Replace with a forward class
	declaration.
	(auto_vec_perm_indices): Move to vec-perm-indices.h.
	* optabs.h: Include vec-perm-indices.h.
	(expand_vec_perm): Delete.
	(selector_fits_mode_p, expand_vec_perm_var): Declare.
	(expand_vec_perm_const): Declare.
	* target.def (vec_perm_const_ok): Replace with...
	(vec_perm_const): ...this new hook.
	* doc/tm.texi.in (TARGET_VECTORIZE_VEC_PERM_CONST_OK): Replace with...
	(TARGET_VECTORIZE_VEC_PERM_CONST): ...this new hook.
	* doc/tm.texi: Regenerate.
	* optabs.def (vec_perm_const): Delete.
	* doc/md.texi (vec_perm_const): Likewise.
	(vec_perm): Refer to TARGET_VECTORIZE_VEC_PERM_CONST.
	* expr.c (expand_expr_real_2): Use expand_vec_perm_const rather than
	expand_vec_perm for constant permutation vectors.  Assert that
	the mode of variable permutation vectors is the integer equivalent
	of the mode that is being permuted.
	* optabs-query.h (selector_fits_mode_p): Declare.
	* optabs-query.c: Include vec-perm-indices.h.
	(selector_fits_mode_p): New function.
	(can_vec_perm_const_p): Check whether targetm.vectorize.vec_perm_const
	is defined, instead of checking whether the vec_perm_const_optab
	exists.  Use targetm.vectorize.vec_perm_const instead of
	targetm.vectorize.vec_perm_const_ok.  Check whether the indices
	fit in the vector mode before using a variable permute.
	* optabs.c (shift_amt_for_vec_perm_mask): Take a mode and a
	vec_perm_indices instead of an rtx.
	(expand_vec_perm): Replace with...
	(expand_vec_perm_const): ...this new function.  Take the selector
	as a vec_perm_indices rather than an rtx.  Also take the mode of
	the selector.  Update call to shift_amt_for_vec_perm_mask.
	Use targetm.vectorize.vec_perm_const instead of vec_perm_const_optab.
	Use vec_perm_indices::new_expanded_vector to expand the original
	selector into bytes.  Check whether the indices fit in the vector
	mode before using a variable permute.
	(expand_vec_perm_var): Make global.
	(expand_mult_highpart): Use expand_vec_perm_const.
	* fold-const.c: Includes vec-perm-indices.h.
	* tree-ssa-forwprop.c: Likewise.
	* tree-vect-data-refs.c: Likewise.
	* tree-vect-generic.c: Likewise.
	* tree-vect-loop.c: Likewise.
	* tree-vect-slp.c: Likewise.
	* tree-vect-stmts.c: Likewise.
	* config/aarch64/aarch64-protos.h (aarch64_expand_vec_perm_const):
	Delete.
	* config/aarch64/aarch64-simd.md (vec_perm_const<mode>): Delete.
	* config/aarch64/aarch64.c (aarch64_expand_vec_perm_const)
	(aarch64_vectorize_vec_perm_const_ok): Fuse into...
	(aarch64_vectorize_vec_perm_const): ...this new function.
	(TARGET_VECTORIZE_VEC_PERM_CONST_OK): Delete.
	(TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
	* config/arm/arm-protos.h (arm_expand_vec_perm_const): Delete.
	* config/arm/vec-common.md (vec_perm_const<mode>): Delete.
	* config/arm/arm.c (TARGET_VECTORIZE_VEC_PERM_CONST_OK): Delete.
	(TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
	(arm_expand_vec_perm_const, arm_vectorize_vec_perm_const_ok): Merge
	into...
	(arm_vectorize_vec_perm_const): ...this new function.  Explicitly
	check for NEON modes.
	* config/i386/i386-protos.h (ix86_expand_vec_perm_const): Delete.
	* config/i386/sse.md (VEC_PERM_CONST, vec_perm_const<mode>): Delete.
	* config/i386/i386.c (ix86_expand_vec_perm_const_1): Update comment.
	(ix86_expand_vec_perm_const, ix86_vectorize_vec_perm_const_ok): Merge
	into...
	(ix86_vectorize_vec_perm_const): ...this new function.  Incorporate
	the old VEC_PERM_CONST conditions.
	* config/ia64/ia64-protos.h (ia64_expand_vec_perm_const): Delete.
	* config/ia64/vect.md (vec_perm_const<mode>): Delete.
	* config/ia64/ia64.c (ia64_expand_vec_perm_const)
	(ia64_vectorize_vec_perm_const_ok): Merge into...
	(ia64_vectorize_vec_perm_const): ...this new function.
	* config/mips/loongson.md (vec_perm_const<mode>): Delete.
	* config/mips/mips-msa.md (vec_perm_const<mode>): Delete.
	* config/mips/mips-ps-3d.md (vec_perm_constv2sf): Delete.
	* config/mips/mips-protos.h (mips_expand_vec_perm_const): Delete.
	* config/mips/mips.c (mips_expand_vec_perm_const)
	(mips_vectorize_vec_perm_const_ok): Merge into...
	(mips_vectorize_vec_perm_const): ...this new function.
	* config/powerpcspe/altivec.md (vec_perm_constv16qi): Delete.
	* config/powerpcspe/paired.md (vec_perm_constv2sf): Delete.
	* config/powerpcspe/spe.md (vec_perm_constv2si): Delete.
	* config/powerpcspe/vsx.md (vec_perm_const<mode>): Delete.
	* config/powerpcspe/powerpcspe-protos.h (altivec_expand_vec_perm_const)
	(rs6000_expand_vec_perm_const): Delete.
	* config/powerpcspe/powerpcspe.c (TARGET_VECTORIZE_VEC_PERM_CONST_OK):
	Delete.
	(TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
	(altivec_expand_vec_perm_const_le): Take each operand individually.
	Operate on constant selectors rather than rtxes.
	(altivec_expand_vec_perm_const): Likewise.  Update call to
	altivec_expand_vec_perm_const_le.
	(rs6000_expand_vec_perm_const): Delete.
	(rs6000_vectorize_vec_perm_const_ok): Delete.
	(rs6000_vectorize_vec_perm_const): New function.
	(rs6000_do_expand_vec_perm): Take a vec_perm_builder instead of
	an element count and rtx array.
	(rs6000_expand_extract_even): Update call accordingly.
	(rs6000_expand_interleave): Likewise.
	* config/rs6000/altivec.md (vec_perm_constv16qi): Delete.
	* config/rs6000/paired.md (vec_perm_constv2sf): Delete.
	* config/rs6000/vsx.md (vec_perm_const<mode>): Delete.
	* config/rs6000/rs6000-protos.h (altivec_expand_vec_perm_const)
	(rs6000_expand_vec_perm_const): Delete.
	* config/rs6000/rs6000.c (TARGET_VECTORIZE_VEC_PERM_CONST_OK): Delete.
	(TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
	(altivec_expand_vec_perm_const_le): Take each operand individually.
	Operate on constant selectors rather than rtxes.
	(altivec_expand_vec_perm_const): Likewise.  Update call to
	altivec_expand_vec_perm_const_le.
	(rs6000_expand_vec_perm_const): Delete.
	(rs6000_vectorize_vec_perm_const_ok): Delete.
	(rs6000_vectorize_vec_perm_const): New function.  Remove stray
	reference to the SPE evmerge intructions.
	(rs6000_do_expand_vec_perm): Take a vec_perm_builder instead of
	an element count and rtx array.
	(rs6000_expand_extract_even): Update call accordingly.
	(rs6000_expand_interleave): Likewise.
	* config/sparc/sparc.md (vec_perm_constv8qi): Delete in favor of...
	* config/sparc/sparc.c (sparc_vectorize_vec_perm_const): ...this
	new function.
	(TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.

From-SVN: r256093
2018-01-02 18:26:27 +00:00
Richard Sandiford
279b805713 Refactor expand_vec_perm
This patch splits the variable handling out of expand_vec_perm into
a subroutine, so that the next patch can use a different interface
for expanding constant permutes.  expand_vec_perm now does all the
CONST_VECTOR handling directly and defers to expand_vec_perm_var
for other rtx codes.  Handling CONST_VECTORs includes handling the
fallback to variable permutes.

The patch also adds an assert for valid optab modes to expand_vec_perm_1,
so that we get it when using optabs for CONST_VECTORs.  The MODE_VECTOR_INT
part was previously in expand_vec_perm and the mode_for_int_vector part
is new.

Most of the patch is just reindentation.

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

gcc/
	* optabs.c (expand_vec_perm_1): Assert that SEL has an integer
	vector mode and that that mode matches the mode of the data
	being permuted.
	(expand_vec_perm): Split handling of non-CONST_VECTOR selectors
	out into expand_vec_perm_var.  Do all CONST_VECTOR handling here,
	directly using expand_vec_perm_1 when forcing selectors into
	registers.
	(expand_vec_perm_var): New function, split out from expand_vec_perm.

From-SVN: r256092
2018-01-02 18:26:16 +00:00
Richard Sandiford
7ac7e2868d Split can_vec_perm_p into can_vec_perm_{var,const}_p
This patch splits can_vec_perm_p into two functions: can_vec_perm_var_p
for testing permute operations with variable selection vectors, and
can_vec_perm_const_p for testing permute operations with specific
constant selection vectors.  This means that we can pass the constant
selection vector by reference.

Constant permutes can still use a variable permute as a fallback.
A later patch adds a check to makre sure that we don't truncate the
vector indices when doing this.

However, have_whole_vector_shift checked:

  if (direct_optab_handler (vec_perm_const_optab, mode) == CODE_FOR_nothing)
    return false;

which had the effect of disallowing the fallback to variable permutes.
I'm not sure whether that was the intention or whether it was just
supposed to short-cut the loop on targets that don't support permutes.
(But then why bother?  The first check in the loop would fail and
we'd bail out straightaway.)

The patch adds a parameter for disallowing the fallback.  I think it
makes sense to do this for the following code in the VEC_PERM_EXPR
folder:

	  /* Some targets are deficient and fail to expand a single
	     argument permutation while still allowing an equivalent
	     2-argument version.  */
	  if (need_mask_canon && arg2 == op2
	      && !can_vec_perm_p (TYPE_MODE (type), false, &sel)
	      && can_vec_perm_p (TYPE_MODE (type), false, &sel2))

since it's really testing whether the expand_vec_perm_const code expects
a particular form.

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

gcc/
	* optabs-query.h (can_vec_perm_p): Delete.
	(can_vec_perm_var_p, can_vec_perm_const_p): Declare.
	* optabs-query.c (can_vec_perm_p): Split into...
	(can_vec_perm_var_p, can_vec_perm_const_p): ...these two functions.
	(can_mult_highpart_p): Use can_vec_perm_const_p to test whether a
	particular selector is valid.
	* tree-ssa-forwprop.c (simplify_vector_constructor): Likewise.
	* tree-vect-data-refs.c (vect_grouped_store_supported): Likewise.
	(vect_grouped_load_supported): Likewise.
	(vect_shift_permute_load_chain): Likewise.
	* tree-vect-slp.c (vect_build_slp_tree_1): Likewise.
	(vect_transform_slp_perm_load): Likewise.
	* tree-vect-stmts.c (perm_mask_for_reverse): Likewise.
	(vectorizable_bswap): Likewise.
	(vect_gen_perm_mask_checked): Likewise.
	* fold-const.c (fold_ternary_loc): Likewise.  Don't take
	implementations of variable permutation vectors into account
	when deciding which selector to use.
	* tree-vect-loop.c (have_whole_vector_shift): Don't check whether
	vec_perm_const_optab is supported; instead use can_vec_perm_const_p
	with a false third argument.
	* tree-vect-generic.c (lower_vec_perm): Use can_vec_perm_const_p
	to test whether the constant selector is valid and can_vec_perm_var_p
	to test whether a variable selector is valid.

From-SVN: r256091
2018-01-02 18:26:06 +00:00
Richard Sandiford
4aae3cb355 Pass vec_perm_indices by reference
This patch makes functions take vec_perm_indices by reference rather
than value, since a later patch will turn vec_perm_indices into a class
that would be more expensive to copy.

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

gcc/
	* optabs-query.h (can_vec_perm_p): Take a const vec_perm_indices *.
	* optabs-query.c (can_vec_perm_p): Likewise.
	* fold-const.c (fold_vec_perm): Take a const vec_perm_indices &
	instead of vec_perm_indices.
	* tree-vectorizer.h (vect_gen_perm_mask_any): Likewise,
	(vect_gen_perm_mask_checked): Likewise,
	* tree-vect-stmts.c (vect_gen_perm_mask_any): Likewise,
	(vect_gen_perm_mask_checked): Likewise,

From-SVN: r256090
2018-01-02 18:25:57 +00:00
Richard Sandiford
3ea109a347 The vec_perm code falls back to doing byte-level permutes if element-level permutes aren't supported.
qimode_for_vec_perm

The vec_perm code falls back to doing byte-level permutes if
element-level permutes aren't supported.  There were two copies
of the code to calculate the mode, and later patches add another,
so this patch splits it out into a helper function.

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

gcc/
	* optabs-query.h (qimode_for_vec_perm): Declare.
	* optabs-query.c (can_vec_perm_p): Split out qimode search to...
	(qimode_for_vec_perm): ...this new function.
	* optabs.c (expand_vec_perm): Use qimode_for_vec_perm.

From-SVN: r256089
2018-01-02 18:25:45 +00:00
Thomas Koenig
a1d6c05238 re PR fortran/45689 ([F03] Missing transformational intrinsic in the trans_func_f2003 list)
2017-01-02  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/45689
	* intrinsic.c (add_function): Add gfc_simplify_maxloc and
	gfc_simplify_minloc to maxloc and minloc, respectively.
	* intrinsic.h: Add prototypes for gfc_simplify_minloc
	and gfc_simplify_maxloc.
	* simplify.c (min_max_chose): Adjust prototype.  Modify function
	to have a return value which indicates if the extremum was found.
	(is_constant_array_expr): Fix typo in comment.
	(simplify_minmaxloc_to_scalar): New function.
	(simplify_minmaxloc_nodim): New function.
	(new_array): New function.
	(simplify_minmaxloc_to_array): New function.
	(gfc_simplify_minmaxloc): New function.
	(simplify_minloc): New function.
	(simplify_maxloc): New function.

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

	PR fortran/45689
	* gfortran.dg/minloc_4.f90: New test case.
	* gfortran.dg/maxloc_4.f90: New test case.

From-SVN: r256088
2018-01-02 18:14:04 +00:00
Jakub Jelinek
0a552ae22a re PR c++/83556 (ICE in gimplify_expr, at gimplify.c:12004)
PR c++/83556
	* tree.c (replace_placeholders_r): Pass NULL as last argument to
	cp_walk_tree instead of d->pset.  If non-TREE_CONSTANT and
	non-PLACEHOLDER_EXPR tree has been seen already, set *walk_subtrees
	to false and return.
	(replace_placeholders): Pass NULL instead of &pset as last argument
	to cp_walk_tree.

	* g++.dg/cpp0x/pr83556.C: New test.

From-SVN: r256086
2018-01-02 19:04:19 +01:00
Thomas Koenig
a9ec0cfc36 re PR fortran/45689 ([F03] Missing transformational intrinsic in the trans_func_f2003 list)
2018-01-02  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/45689
	PR fortran/83650
	* simplify.c (gfc_simplify_cshift): Re-implement to allow full
	range of arguments.

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

	PR fortran/45689
	PR fortran/83650
	* gfortran.dg/simplify_cshift_1.f90: Correct erroneous case.
	* gfortran.dg/simplify_cshift_4.f90: New test.

From-SVN: r256084
2018-01-02 17:51:26 +00:00
Aaron Sawdey
7616c40b3f Add missing changelog entry:
2017-12-12  Aaron Sawdey  <acsawdey@linux.vnet.ibm.com>

        PR target/82190
        * config/rs6000/rs6000-string.c (expand_block_compare,
        expand_strn_compare): Fix set_mem_size() calls.

From-SVN: r256083
2018-01-02 11:02:17 -06:00
Marek Polacek
dd2ce397d3 re PR c++/83644 (ICE using type alias from recursive decltype in noexcept or return type)
PR c++/83644
	* g++.dg/cpp1z/pr83644.C: New test.

From-SVN: r256082
2018-01-02 17:02:14 +00:00
Aaron Sawdey
e698996f55 rtlanal.c (canonicalize_condition): Return 0 if final rtx does not have a conditional at the top.
2018-01-02  Aaron Sawdey  <acsawdey@linux.vnet.ibm.com>

        * rtlanal.c (canonicalize_condition): Return 0 if final rtx
        does not have a conditional at the top.

Forgot this changelog entry.

From-SVN: r256081
2018-01-02 10:58:05 -06:00
Aaron Sawdey
6aff9af1cb rtlanal.c (canonicalize_condition): Return 0 if final rtx does not have a conditional at the top.
* rtlanal.c (canonicalize_condition): Return 0 if final rtx
        does not have a conditional at the top.

From-SVN: r256079
2018-01-02 10:46:29 -06:00
Marek Polacek
6ff9491ae9 re PR c++/81860 (Call to undefined inline function involving inheriting constructors)
PR c++/81860
	* g++.dg/cpp0x/inh-ctor30.C: New test.

From-SVN: r256076
2018-01-02 15:05:09 +00:00
Nathan Sidwell
0e03860116 [C++ PATCH] tiny code cleanup
https://gcc.gnu.org/ml/gcc-patches/2018-01/msg00041.html
	* constexpr.c (cxx_bind_parameters_in_call): Remove unneeded local
	lval var.

From-SVN: r256075
2018-01-02 14:51:06 +00:00
Janne Blomqvist
2412750e79 PR libgfortran/83649 Chunk large reads and writes
It turns out that Linux never reads or writes more than 2147479552
bytes in a single syscall. For writes this is not a problem as
libgfortran already contains a loop around write() to handle short
writes. But for reads we cannot do this, since then read will hang if
we have a short read when reading from the terminal.  Also, there are
reports that macOS fails I/O's larger than 2 GB.  Thus, to work around
these issues do large reads/writes in chunks.

The testcase from the PR

program largewr
  integer(kind=1) :: a(2_8**31+1)
  a = 0
  a(size(a, kind=8)) = 1
  open(10, file="largewr.dat", access="stream", form="unformatted")
  write (10) a
  close(10)
  a(size(a, kind=8)) = 2
  open(10, file="largewr.dat", access="stream", form="unformatted")
  read (10) a
  if (a(size(a, kind=8)) == 1) then
    print *, "All is well"
  else
    print *, "Oh no"
  end if
end program largewr

fails on trunk but works with the patch.

Regtested on x86_64-pc-linux-gnu, committed to trunk.

libgfortran/ChangeLog:

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

	PR libgfortran/83649
	* io/unix.c (MAX_CHUNK): New define.
	(raw_read): For reads larger than MAX_CHUNK, loop.
	(raw_write): Write no more than MAX_CHUNK bytes per iteration.

From-SVN: r256074
2018-01-02 15:25:10 +02:00
Jan Hubicka
d555138e64 re PR target/81616 (Update -mtune=generic for the current Intel and AMD processors)
PR target/81616
	* config/i386/x86-tune-costs.h: Increase cost of integer load costs
	for generic 4->6.

From-SVN: r256073
2018-01-02 13:04:19 +00:00
Richard Biener
f76649a6dc ipa-inline.c (big_speedup_p): Fix expression.
2018-01-02  Richard Biener  <rguenther@suse.de>

	* ipa-inline.c (big_speedup_p): Fix expression.

From-SVN: r256072
2018-01-02 12:35:53 +00:00
Nathan Sidwell
5344af273a add comment about why valid
From-SVN: r256071
2018-01-02 12:35:02 +00:00
Jan Hubicka
e8e3054e50 re PR target/81616 (Update -mtune=generic for the current Intel and AMD processors)
PR target/81616
	* x86-tune-costs.h (generic_cost): Reduce cost of FDIV 20->17,
	cost of sqrt 20->14, DIVSS 18->13, DIVSD 32->17, SQRtSS 30->14
	and SQRTsD 58->18, cond_not_taken_branch_cost. 2->1. Increase
	cond_taken_branch_cost 3->4.

From-SVN: r256070
2018-01-02 09:31:47 +00:00
Richard Biener
c1177db4fa re PR lto/83452 (FAIL: gfortran.dg/save_6.f90 -O0 (test for excess errors))
2017-01-02  Richard Biener  <rguenther@suse.de>

	PR lto/83452
	* simple-object-elf.c (simple_object_elf_copy_lto_debug_section):
	Do not use UNDEF locals for removed symbols but instead just
	define them in the first prevailing section and with no name.
	Use the same gnu_lto_v1 name for all removed globals we promote to
	WEAK UNDEFs so hpux can use a stub to provide this symbol.  Clear
	sh_info and sh_link in removed sections.

From-SVN: r256069
2018-01-02 08:45:05 +00:00
GCC Administrator
d42e3a016b Daily bump.
From-SVN: r256068
2018-01-02 00:16:16 +00:00
Paul Thomas
f549bfb3db re PR fortran/83076 (ICE in gfc_deallocate_scalar_with_status, at fortran/trans.c:1598)
2018-01-01  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/83076
	* resolve.c (resolve_fl_derived0): Add caf_token fields for
	allocatable and pointer scalars, when -fcoarray selected.
	* trans-types.c (gfc_copy_dt_decls_ifequal): Copy the token
	field as well as the backend_decl.
	(gfc_get_derived_type): Flag GFC_FCOARRAY_LIB for module
	derived types that are not vtypes. Components with caf_token
	attribute are pvoid types. For a component requiring it, find
	the caf_token field and have the component token field point to
	its backend_decl.

	PR fortran/83319
	*trans-types.c (gfc_get_array_descriptor_base): Add the token
	field to the descriptor even when codimen not set.


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

	PR fortran/83076
	* gfortran.dg/coarray_45.f90 : New test.

	PR fortran/83319
	* gfortran.dg/coarray_46.f90 : New test.

From-SVN: r256065
2018-01-01 17:36:41 +00:00
Joseph Myers
3a60f9fd1a * es.po: Update.
From-SVN: r256059
2018-01-01 00:17:27 +00:00
GCC Administrator
712818a36b Daily bump.
From-SVN: r256058
2018-01-01 00:16:12 +00:00
Jakub Jelinek
1bfb3b8bfa re PR tree-optimization/83581 (ICE in expand_LOOP_VECTORIZED, at internal-fn.c:2397)
PR tree-optimization/83581
	* tree-loop-distribution.c (pass_loop_distribution::execute): Return
	TODO_cleanup_cfg if any changes have been made.

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

From-SVN: r256055
2018-01-01 00:53:17 +01:00
Jakub Jelinek
913884f792 re PR c/83595 (ICE: in linemap_macro_map_lookup, at libcpp/line-map.c:1008 on invalid code)
PR c/83595
	* c-parser.c (c_parser_braced_init, c_parser_initelt,
	c_parser_conditional_expression, c_parser_cast_expression,
	c_parser_sizeof_expression, c_parser_alignof_expression,
	c_parser_postfix_expression, c_parser_omp_declare_reduction,
	c_parser_transaction_expression): Use set_error () method instead
	of setting value member to error_mark_node.

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

From-SVN: r256054
2018-01-01 00:52:41 +01:00
Jakub Jelinek
0f3f0e4e97 re PR rtl-optimization/83608 (ICE in convert_move, at expr.c:229 in GIMPLE store merging pass)
PR middle-end/83608
	* expr.c (store_expr_with_bounds): Use simplify_gen_subreg instead of
	convert_modes if target mode has the right side, but different mode
	class.

	* g++.dg/opt/pr83608.C: New test.

From-SVN: r256053
2018-01-01 00:52:01 +01:00
Jakub Jelinek
c1329fc84c re PR tree-optimization/83609 (ICE in read_complex_part at gcc/expr.c:3202)
PR middle-end/83609
	* expr.c (expand_assignment): Fix up a typo in simplify_gen_subreg
	last argument when extracting from CONCAT.  If either from_real or
	from_imag is NULL, use expansion through memory.  If result is not
	a CONCAT and simplify_gen_subreg fails, try to simplify_gen_subreg
	the parts directly to inner mode, if even that fails, use expansion
	through memory.

	* gcc.dg/pr83609.c: New test.
	* g++.dg/opt/pr83609.C: New test.

From-SVN: r256052
2018-01-01 00:51:14 +01:00