Commit Graph

169189 Commits

Author SHA1 Message Date
Jakub Jelinek eeb31391b7 combine: Fix find_split_point handling of constant store into ZERO_EXTRACT [PR93908]
git is miscompiled on s390x-linux with -O2 -march=zEC12 -mtune=z13.
I've managed to reduce it into the following testcase.  The problem is that
during combine we see the s->k = -1; bitfield store and change the SET_SRC
from a pseudo into a constant:
(set (zero_extract:DI (mem/j:HI (plus:DI (reg/v/f:DI 60 [ s ])
                (const_int 10 [0xa])) [0 +0 S2 A16])
        (const_int 2 [0x2])
        (const_int 7 [0x7]))
    (const_int -1 [0xffffffffffffffff]))
This on s390x with the above option isn't recognized as valid instruction,
so find_split_point decides to handle it as IOR or IOR/AND.
src is -1, mask is 3 and pos is 7.
src != mask (this is also incorrect, we want to set all (both) bits in the
bitfield), so we go for IOR/AND, but instead of trying
mem = (mem & ~0x180) | ((-1 << 7) & 0x180)
we actually try
mem = (mem & ~0x180) | (-1 << 7)
and that is further simplified into:
mem = mem | (-1 << 7)
aka
mem = mem | 0xff80
which doesn't set just the 2-bit bitfield, but also many other bitfields
that shouldn't be touched.
We really should do:
mem = mem | 0x180
instead.
The problem is that we assume that no bits but those low len (2 here) will
be set in the SET_SRC, but there is nothing that can prevent that, we just
should ignore the other bits.

The following patch fixes it by masking src with mask, this way already
the src == mask test will DTRT, and as the code for or_mask uses
gen_int_mode, if the most significant bit is set after shifting it left by
pos, it will be properly sign-extended.

2020-02-25  Jakub Jelinek  <jakub@redhat.com>

	PR rtl-optimization/93908
	* combine.c (find_split_point): For store into ZERO_EXTRACT, and src
	with mask.

	* gcc.c-torture/execute/pr93908.c: New test.
2020-02-25 14:01:55 +01:00
Eric Botcazou a6b74eaedf Fix link failure with debug info in LTO mode
This fixes a regression whereby the program fails to link with debug
info in LTO mode because of an undefined reference to a symbol coming
from the object files containing the early debug info.

	* dwarf2out.c (dwarf2out_size_function): Run in early-DWARF mode.
2020-02-25 12:44:19 +01:00
Roman Zhuykov 468664e1b7 doc: backport proper description of --enable-checking behavior
This patch rewords the whole description to fix minor issues:
 - documents 'gimple' and 'types' checks,
 - clarifies what happens when option is used without '=list',
 - fixes inaccurate wrong wording about release snapshots,
 - describes that release checks can only be disabled explicitly.

	Backport from master
	2020-02-24  Roman Zhuykov  <zhroma@ispras.ru>

	* doc/install.texi (--enable-checking): Properly document current
	behavior.
	(--enable-stage1-checking): Minor clarification about bootstrap.
2020-02-25 14:32:42 +03:00
GCC Administrator 788483065b Daily bump. 2020-02-25 00:18:29 +00:00
Richard Sandiford f9be6e10c9 vect: Fix offset calculation for -ve strides [PR93767]
This PR is a regression caused by r256644, which added support for alias
checks involving variable strides.  One of the changes in that commit
was to split the access size out of the segment length.  The PR shows
that I hadn't done that correctly for the handling of negative strides
in vect_compile_time_alias.  The old code was:

      const_length_a = (-wi::to_poly_wide (segment_length_a)).force_uhwi ();
      offset_a = (offset_a + vect_get_scalar_dr_size (a)) - const_length_a;

where vect_get_scalar_dr_size (a) was cancelling out the subtraction
of the access size inherent in "- const_length_a".  Taking the access
size out of the segment length meant that the addition was no longer
needed/correct.

2020-02-24  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	Backport from mainline
	2020-02-19  Richard Sandiford  <richard.sandiford@arm.com>

	PR tree-optimization/93767
	* tree-vect-data-refs.c (vect_compile_time_alias): Remove the
	access-size bias from the offset calculations for negative strides.

gcc/testsuite/
	Backport from mainline
	2020-02-19  Richard Sandiford  <richard.sandiford@arm.com>

	PR tree-optimization/93767
	* gcc.dg/vect/pr93767.c: New test.
2020-02-24 21:24:11 +00:00
Mark Eggleston ba74009251 fortran: ICE using SHAPE with FINDLOC PR93835
Backported from mainline
	2020-02-24  Mark Eggleston  <markeggleston@gcc.gnu.org>

	PR fortran/93835
	* simplify.c (simplify_findloc_nodim) : Fix whitespace issues.
	(gfc_simplify_shape) : Create and initialise one shape value
	for the result expression. Set shape value with the rank of
	the source array.

	PR fortran/93835
	* gfortran.dg/pr77351.f90 : Check for one error instead of two.
	* gfortran.dg/pr93835.f08 : New test.
2020-02-24 15:53:24 +00:00
Bernd Edlinger 8389fcc4c1 Avoid collect2 calling signal unsafe functions and/or unlink with uninitialized memory
2020-02-24  Bernd Edlinger  <bernd.edlinger@hotmail.de>

	* collect2.c (tool_cleanup): Avoid calling not signal-safe
	functions.
	(maybe_run_lto_and_relink): Avoid possible signal handler
	access to unintialzed memory (lto_o_files).
2020-02-24 14:43:06 +01:00
Peter Bergner 066184a282 rs6000: Fix infinite loop building ghostscript and icu [PR93658]
Fix rs6000_legitimate_address_p(), which erroneously marks a valid Altivec
address as being invalid, which causes LRA's process_address()  to go into
an infinite loop spilling the same address over and over again.
Include Mike's earlier commits that fix bugs this patch exposes.

	Backport from master
	2020-02-20  Peter Bergner  <bergner@linux.ibm.com>

	PR target/93658
	* config/rs6000/rs6000.c (rs6000_legitimate_address_p): Handle VSX
	vector modes.

	* gcc.target/powerpc/pr93658.c: New test.
2020-02-23 18:31:56 -06:00
Michael Meissner 428a4feef8 Adjust how variable vector extraction is done.
Backport from master
	2020-02-03  Michael Meissner  <meissner@linux.ibm.com>

	* config/rs6000/rs6000.c (get_vector_offset): New helper function
	to calculate the offset in memory from the start of a vector of a
	particular element.  Add code to keep the element number in
	bounds if the element number is variable.
	(rs6000_adjust_vec_address): Move calculation of offset of the
	vector element to get_vector_offset.
	(rs6000_split_vec_extract_var): Do not do the initial AND of
	element here, move the code to get_vector_offset.

Fix PR 93568 (thinko)

	Backport from master
	2020-02-05  Michael Meissner  <meissner@linux.ibm.com>

	PR target/93568
	* config/rs6000/rs6000.c (get_vector_offset): Fix Q constraint assert
	to use MEM.
2020-02-23 18:31:56 -06:00
Michael Meissner 48558cdf49 Fix bad code of vector extract of PC-relative address with variable element #.
Backport from master
	2020-01-06  Michael Meissner  <meissner@linux.ibm.com>

	* config/rs6000/vsx.md (vsx_extract_<mode>_var, VSX_D iterator):
	Use 'Q' for doing vector extract from memory.
	(vsx_extract_v4sf_var): Use 'Q' for doing vector extract from
	memory.
	(vsx_extract_<mode>_var, VSX_EXTRACT_I iterator): Use 'Q' for
	doing vector extract from memory.
	(vsx_extract_<mode>_<VS_scalar>mode_var): Use 'Q' for doing vector
	extract from memory.
2020-02-23 18:31:56 -06:00
GCC Administrator 9f2a74ab43 Daily bump. 2020-02-24 00:18:31 +00:00
GCC Administrator 6900c1ec9a Daily bump. 2020-02-23 00:18:39 +00:00
Thomas König c080a6fb6f Use au->lock exclusively for locking in async I/O.
2020-02-18  Thomas Koenig  <tkoenig@gcc.gnu.org>

	Backport from trunk
	PR fortran/93599
	* io/async.c (destroy_adv_cond): Do not destroy lock.
	(async_io): Make sure au->lock is locked for finishing of thread.
	Do not lock/unlock around signalling emptysignal. Unlock au->lock
	before return.
	(init_adv_cond): Do not initialize lock.
	(enqueue_transfer): Unlock after signal.
	(enqueue_done_id): Likewise.
	(enqueue_done): Likewise.
	(enqueue_close): Likewise.
	(enqueue_data_transfer): Likewise.
	(async_wait_id): Do not lock/unlock around signalling au->work.
	(async_wait): Unlock after signal.
	* io/async.h (SIGNAL): Add comment about needed au->lock.
	Remove locking/unlocking of advcond->lock.
	(WAIT_SIGNAL_MUTEX): Add comment. Remove locking/unlocking of
	advcond->lock.  Unlock mutex only at the end.  Loop on
	__ghread_cond_wait returning zero.
	(REVOKE_SIGNAL): Add comment. Remove locking/unlocking of
	advcond->lock.
	(struct adv_cond): Remove mutex from struct.
2020-02-22 12:31:18 +01:00
GCC Administrator 3004aba7a0 Daily bump. 2020-02-22 00:18:28 +00:00
John David Anglin 4ccda0308e Fix handling of floating-point homogeneous aggregates.
2020-02-21  John David Anglin  <danglin@gcc.gnu.org>

	* gcc/config/pa/pa.c (pa_function_value): Fix check for word and
	double-word size when handling aggregate return values.
	* gcc/config/pa/som.h (ASM_DECLARE_FUNCTION_NAME): Fix to indicate
	that homogeneous SFmode and DFmode aggregates are passed and returned
	in general registers.
2020-02-21 23:34:09 +00:00
GCC Administrator 8b3c0979ea Daily bump. 2020-02-21 00:18:50 +00:00
Uros Bizjak bd2537ed5d i386: Fix *vec_extractv2sf_1 and *vec_extractv2sf_1 shufps alternative [PR93828]
shufps moves two of the four packed single-precision floating-point values
from *destination* operand (first operand) into the low quadword of the
destination operand.  Match source operand to the destination.

	PR target/93828
	* config/i386/mmx.md (*vec_extractv2sf_1): Match source operand
	to destination operand for shufps alternative.
	(*vec_extractv2si_1): Ditto.
2020-02-20 21:58:57 +01:00
H.J. Lu f55bf4ddbf i386: Skip ENDBR32 at the target function entry
Skip ENDBR32 at the target function entry when initializing trampoline.

Tested on Linux/x86-64 CET machine with and without -m32.

gcc/

	Backport from master
	PR target/93656
	* config/i386/i386.c (ix86_trampoline_init): Skip ENDBR32 at
	the target function entry.

gcc/testsuite/

	Backport from master
	PR target/93656
	* gcc.target/i386/pr93656.c: New test.

(cherry picked from commit 1d69147af2)
2020-02-20 03:05:27 -08:00
GCC Administrator 2ee6afc2b4 Daily bump. 2020-02-20 00:19:06 +00:00
Mark Eggleston 00244172f8 [fortran] xfail no longer necessary in typebound_call_22.f03
PR91984 changes resulted in an expected failure. Backport of PR92113
negated the need for the xfail.

gcc/testsuite/ChangeLog

	* typebound_call_22.d03 : Remove xfail clause.
2020-02-19 16:19:54 +00:00
Mark Eggleston 44ea6508f1 [Fortran] ICE assign character pointer to non target PR93714
An ICE occurred if an attempt was made to assign a pointer to a
character variable that has an length incorrectly specified using
a real constant and does not have the target attribute.

	Backported from mainline
	2020-02-18  Mark Eggleston  <markeggleston@gcc.gnu.org>

	PR fortran/93714
	* expr.c (gfc_check_pointer_assign): Move check for
	matching character length to after checking the lvalue
	attributes for target or pointer.

	PR fortran/93714
	* gfortran.dg/char_pointer_assign_6.f90: Look for no target
	message instead of length mismatch.
	* gfortran.dg/pr93714_1.f90
	* gfortran.dg/pr93714_2.f90
2020-02-19 09:36:42 +00:00
liuhongt fa463e6f42 Add -mavx512vbmi2 to i386-2.C and i386-3.C
2020-02-18  Hongtao Liu  <hongtao.liu@intel.com>

gcc/testsuite/
	* g++.dg/other/i386-2.C: Add -mavx512vbmi2.
	* g++.dg/other/i386-3.C: Ditto.
2020-02-19 10:13:29 +08:00
GCC Administrator 9f2bbf581e Daily bump. 2020-02-19 00:18:36 +00:00
Richard Sandiford 2408b93a10 Check for bitwise identity when encoding VECTOR_CSTs [PR92768]
This PR shows that we weren't checking for bitwise-identical values
when trying to encode a VECTOR_CST, so -0.0 was treated the same as
0.0 for -fno-signed-zeros.  The patch adds a new OEP flag to select
that behaviour.

2020-02-18  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	Backport from mainline
	2019-12-05  Richard Sandiford  <richard.sandiford@arm.com>

	PR middle-end/92768
	* tree-core.h (OEP_BITWISE): New flag.
	* fold-const.c (operand_compare::operand_equal_p): Handle it.
	* tree-vector-builder.h (tree_vector_builder::equal_p): Pass it.

gcc/testsuite/
	PR middle-end/92768
	* gcc.dg/pr92768.c: New test.
2020-02-18 12:26:03 +00:00
Richard Sandiford 52db14c1f7 Reject tail calls that read from an escaped RESULT_DECL [PR90313]
In this PR we have two return paths from a function "map".  The common
code sets <result> to the value returned by one path, while the other
path does:

   <retval> = map (&<retval>, ...);

We treated this call as tail recursion, losing the copy semantics
on the value returned by the recursive call.

We'd correctly reject the same thing for variables:

   local = map (&local, ...);

The problem is that RESULT_DECLs didn't get the same treatment.

2020-02-18  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	Backport from mainline
	2019-08-09  Richard Sandiford  <richard.sandiford@arm.com>

	PR middle-end/90313
	* tree-tailcall.c (find_tail_calls): Reject calls that might
	read from an escaped RESULT_DECL.

gcc/testsuite/
	PR middle-end/90313
	* g++.dg/torture/pr90313.cc: New test.
2020-02-18 12:26:02 +00:00
Mark Eggleston 5601394812 [fortran] ICE in gfc_validate_kind(): Got bad kind [PR93580]
Caused by using invalid part_refs in kind specifications,
e.g. %re or %im on non-complex expressions and %len on
non character expressions.

Check whether %re, %im and %len are valid when checking
kind specification.

The original patch from Steven G. Kargl  <kargl@gcc.gnu.org> only
checked for %re and %im.

	Backported from mainline
	2020-02-18  Mark Eggleston <markeggleston@gcc.gnu.org>

	PR fortran/93580
	* primary.c (gfc_match_varspec): If the symbol following %
	is re or im and the primary expression type is not BT_COMPLEX
	issue an error. If the symbol is len and the primary
	expression type is not BT_CHARACTER is an error.

	PR fortran/93580
	* gfortran.dg/dg/pr93580.f90: New test.
2020-02-18 10:56:38 +00:00
Richard Sandiford e129cd5283 predcom: Fix invalid store-store commoning [PR93434]
predcom has the following code to stop one rogue load from
interfering with other store-load opportunities:

      /* If A is read and B write or vice versa and there is unsuitable
	 dependence, instead of merging both components into a component
	 that will certainly not pass suitable_component_p, just put the
	 read into bad component, perhaps at least the write together with
	 all the other data refs in it's component will be optimizable.  */

But when store-store commoning was added later, this had the effect
of ignoring loads that occur between two candidate stores.

There is code further up to handle loads and stores with unknown
dependences:

      /* Don't do store elimination if there is any unknown dependence for
	 any store data reference.  */
      if ((DR_IS_WRITE (dra) || DR_IS_WRITE (drb))
	  && (DDR_ARE_DEPENDENT (ddr) == chrec_dont_know
	      || DDR_NUM_DIST_VECTS (ddr) == 0))
	eliminate_store_p = false;

But the store-load code above skips loads for *known* dependences
if (a) the load has already been marked "bad" or (b) the data-ref
machinery knows the dependence distance, but determine_offsets
can't handle the combination.

(a) happens to be the problem in the testcase, but a different
sequence could have given (b) instead.  We have writes to individual
fields of a structure and reads from the whole structure.  Since
determine_offsets requires the types to be the same, it returns false
for each such read/write combination.

This patch records which components have had loads removed and
prevents store-store commoning for them.  It's a bit too pessimistic,
since there shouldn't be a problem if a "bad" load dominates all stores
in a component.  But (a) we can't AFAIK use pcom_stmt_dominates_stmt_p
here and (b) the handling for that case would probably need to be
removed again if we handled more exotic cases in future.

2020-02-18  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	Backport from mainline
	2020-01-28  Richard Sandiford  <richard.sandiford@arm.com>

	PR tree-optimization/93434
	* tree-predcom.c (split_data_refs_to_components): Record which
	components have had aliasing loads removed.  Prevent store-store
	commoning for all such components.

gcc/testsuite/
	PR tree-optimization/93434
	* gcc.c-torture/execute/pr93434.c: New test.
2020-02-18 08:52:01 +00:00
Richard Sandiford 84a4651717 Don't pass booleans as mask types to simd clones [PR92710]
In this PR we assigned a vector mask type to the result of a comparison
and then tried to pass that mask type to a simd clone, which expected
a normal (non-mask) type instead.

This patch simply punts on call arguments that have a mask type.
A better fix would be to pattern-match the comparison to a COND_EXPR,
like we would if the comparison was stored to memory, but doing that
isn't gcc 9 or 10 material.

Note that this doesn't affect x86_64-linux-gnu because the ABI promotes
bool arguments to ints.

2020-02-18  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	Backport from mainline
	2019-11-29  Richard Sandiford  <richard.sandiford@arm.com>

	PR tree-optimization/92710
	* tree-vect-stmts.c (vectorizable_simd_clone_call): Reject
	vector mask arguments.

gcc/testsuite/
	PR tree-optimization/92710
	* gcc.dg/vect/pr92710.c: New test.
2020-02-18 08:52:00 +00:00
Richard Sandiford 2d8ea3a0a6 Fix SLP downward group access classification [PR92420]
This PR was caused by the SLP handling in get_group_load_store_type
returning VMAT_CONTIGUOUS rather than VMAT_CONTIGUOUS_REVERSE for
downward groups.

A more elaborate fix would be to try to combine the reverse permutation
into SLP_TREE_LOAD_PERMUTATION for loads, but that's really a follow-on
optimisation and not backport material.  It might also not necessarily
be a win, if the target supports (say) reversing and odd/even swaps
as independent permutes but doesn't recognise the combined form.

2020-02-18  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	Backport from mainline
	2019-11-11  Richard Sandiford  <richard.sandiford@arm.com>

	PR tree-optimization/92420
	* tree-vect-stmts.c (get_negative_load_store_type): Move further
	up file.
	(get_group_load_store_type): Use it for reversed SLP accesses.

gcc/testsuite/
	PR tree-optimization/92420
	* gcc.dg/vect/pr92420.c: New test.
2020-02-18 08:51:59 +00:00
Prathamesh Kulkarni 65709f4b93 re PR target/90724 (ICE with __sync_bool_compare_and_swap with -march=armv8.2-a+sve)
2020-02-18  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	Backport from mainline
	2019-08-21  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>

	PR target/90724
	* config/aarch64/aarch64.c (aarch64_gen_compare_reg_maybe_ze): Force y
	in reg if it fails aarch64_plus_operand predicate.
2020-02-18 08:51:58 +00:00
GCC Administrator e28336b595 Daily bump. 2020-02-18 00:18:43 +00:00
liuhongt 0692bc0ca7 Add Changelog entries to relavent Changelog files for my last commit. 2020-02-17 08:55:17 +08:00
GCC Administrator a63e65cd14 Daily bump. 2020-02-17 00:18:48 +00:00
Uros Bizjak bfa537a2ff i386: Fix atan2l argument order [PR93743]
PR target/93743
	* config/i386/i386.md (atan2xf3): Swap operands 1 and 2.
	(atan2<mode>3): Update operand order in the call to gen_atan2xf3.

testsuite/ChangeLog:

	PR target/93743
	* gcc.target/i386/pr93743.c : New test.
2020-02-16 23:43:22 +01:00
GCC Administrator 1e85e18ab7 Daily bump. 2020-02-16 00:18:33 +00:00
Jakub Jelinek 4980553313 match.pd: Disallow side-effects in GENERIC for non-COND_EXPR to COND_EXPR simplifications [PR93744]
As the following testcases show (the first one reported, last two
found by code inspection), we need to disallow side-effects
in simplifications that turn some unconditional expression into conditional
one.  From my little understanding of genmatch.c, it is able to
automatically disallow side effects if the same operand is used multiple
times in the match pattern, maybe if it is used multiple times in the
replacement pattern, and if it is used in conditional contexts in the match
pattern, could it be taught to handle this case too?  If yes, perhaps
just the first hunk could be usable for 8/9 backports (+ the testcases).

2020-02-15  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/93744
	* match.pd (((m1 >/</>=/<= m2) * d -> (m1 >/</>=/<= m2) ? d : 0,
	A - ((A - B) & -(C cmp D)) -> (C cmp D) ? B : A,
	A + ((B - A) & -(C cmp D)) -> (C cmp D) ? B : A): For GENERIC, make
	sure @2 in the first and @1 in the other patterns has no side-effects.

	* gcc.c-torture/execute/pr93744-1.c: New test.
	* gcc.c-torture/execute/pr93744-2.c: New test.
	* gcc.c-torture/execute/pr93744-3.c: New test.
2020-02-15 13:22:10 +01:00
GCC Administrator 2d625a6d4b Daily bump. 2020-02-15 00:19:32 +00:00
Eric Botcazou c1379a1c64 Fix problematic TLS sequences for the Solaris linker
This is an old thinko pertaining to the interaction between TLS
sequences and delay slot filling: the compiler knows that it cannot
put instructions with TLS relocations into delay slots with the
original Sun TLS model, but it tests TARGET_SUN_TLS in this context,
which depends only on the assembler.  So if the compiler is configured
with the GNU assembler and the Solaris linker, then TARGET_GNU_TLS is
set instead and the limitation is not enforced.

	PR target/93704
	* config/sparc/sparc.c (eligible_for_call_delay): Test HAVE_GNU_LD
	in conjunction with TARGET_GNU_TLS in early return.
2020-02-14 19:26:46 +01:00
Jakub Jelinek f0a72494ea c++: Fix thinko in enum_min_precision [PR61414]
When backporting the PR61414 fix to 8.4, I've noticed that the caching
of prec is actually broken, as it would fail to actually store the computed
precision into the hash_map's value and so next time we'd think the enum needs
0 bits.

2020-02-14  Jakub Jelinek  <jakub@redhat.com>

	PR c++/61414
	* class.c (enum_min_precision): Change prec type from int to int &.

	* g++.dg/cpp0x/enum39.C: New test.
2020-02-14 17:41:42 +01:00
Alexander Monakov 0f7b7aeb71 sel-sched: allow negative insn priority (PR 88879)
PR rtl-optimization/88879
	* sel-sched.c (sel_target_adjust_priority): Remove assert.
2020-02-14 16:55:27 +03:00
Richard Biener b8c42b4d0a middle-end/90648 fend off builtin calls with not enough arguments from match
This adds guards to genmatch generated code before accessing call
expression or stmt arguments that might be out of bounds when
the user provided bogus prototypes for what we consider builtins.

2020-02-05  Richard Biener  <rguenther@suse.de>

	PR middle-end/90648
	* genmatch.c (dt_node::gen_kids_1): Emit number of argument
	checks before matching calls.

	* gcc.dg/pr90648.c: New testcase.
2020-02-14 14:35:26 +01:00
Richard Biener b00c322804 tree-optimization/93381 fix integer offsetting in points-to analysis
We were incorrectly assuming a merge operation is conservative enough
for not explicitely handled operations but we also need to consider
offsetting within fields when field-sensitive analysis applies.

2020-01-22  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/93381
	* tree-ssa-structalias.c (find_func_aliases): Assume offsetting
	throughout, handle all conversions the same.

	* gcc.dg/torture/pr93381.c: New testcase.
2020-02-14 11:50:15 +01:00
Richard Biener 03d2b1d797 tree-optimization/93439 move clique bookkeeping to OMP expansion
Autopar was doing clique bookkeeping too early when creating destination
functions but then later introducing new cliques via versioning loops.
The following moves the bookkeeping to the actual outlining process.

2020-02-14  Richard Biener  <rguenther@suse.de>

	Backport from mainline
	2020-01-28  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/93439
	* tree-parloops.c (create_loop_fn): Move clique bookkeeping...
	* tree-cfg.c (move_sese_region_to_fn): ... here.
	(verify_types_in_gimple_reference): Verify used cliques are
	tracked.

	* gfortran.dg/graphite/pr93439.f90: New testcase.
2020-02-14 11:01:50 +01:00
Richard Biener 3bcda566d6 middle-end/93054 deal with undefs in call gimplification
2020-02-14  Richard Biener  <rguenther@suse.de>

	Backport from mainline
	2020-01-09  Richard Biener  <rguenther@suse.de>

	PR middle-end/93054
	* gimplify.c (gimplify_expr): Deal with NOP definitions.

	* gcc.dg/pr93054.c: New testcase.
2020-02-14 11:01:50 +01:00
Richard Biener 794bb8c2f5 debug/92763 keep DIEs that might be used in DW_TAG_inlined_subroutine
We were pruning type-local subroutine DIEs if their context is unused
despite us later needing those DIEs as abstract origins for inlines.
The patch makes code already present for -fvar-tracking-assignments
unconditional.

2020-02-14  Richard Biener  <rguenther@suse.de>

	Backport from mainline
	2020-01-20  Richard Biener  <rguenther@suse.de>

	PR debug/92763
	* dwarf2out.c (prune_unused_types): Unconditionally mark
	called function DIEs.

	* g++.dg/debug/pr92763.C: New testcase.
2020-02-14 11:01:50 +01:00
Richard Biener 4230afc0f4 tree-optimization/92704 fix ifcvt ICE with loops without stores
2020-02-14  Richard Biener  <rguenther@suse.de>

	Backport from mainline
	2019-11-29  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/92704
	* tree-if-conv.c (combine_blocks): Deal with virtual PHIs
	in loops performing only loads.

	* gcc.dg/torture/pr92704.c: New testcase.
2020-02-14 11:01:49 +01:00
Richard Biener c6480e01fc middle-end/92674 delay purging EH edges when folding during inlining
2020-02-14  Richard Biener  <rguenther@suse.de>

	Backport from mainline
	2019-11-27  Richard Biener  <rguenther@suse.de>

	PR middle-end/92674
	* tree-inline.c (expand_call_inline): Delay purging EH/abnormal
	edges and instead record blocks in bitmap.
	(gimple_expand_calls_inline): Adjust.
	(fold_marked_statements): Delay EH cleanup until all folding is
	done.
	(optimize_inline_calls): Do EH/abnormal cleanup for calls after
	inlining finished.
2020-02-14 11:01:49 +01:00
liuhongt d7ab361df6 Intrinsic macro of vpshr* and vpshl* lack a closing parenthesis which would cause failure in O0.
2020-02-14 Hongtao Liu  <hongtao.liu@intel.com>

gcc/
	PR target/93724
	* config/i386/avx512vbmi2intrin.h
	(_mm512_shrdi_epi16, _mm512_mask_shrdi_epi16,
	_mm512_maskz_shrdi_epi16, _mm512_shrdi_epi32,
	_mm512_mask_shrdi_epi32, _mm512_maskz_shrdi_epi32,
	_m512_shrdi_epi64, _m512_mask_shrdi_epi64,
	_m512_maskz_shrdi_epi64, _mm512_shldi_epi16,
	_mm512_mask_shldi_epi16, _mm512_maskz_shldi_epi16,
	_mm512_shldi_epi32, _mm512_mask_shldi_epi32,
	_mm512_maskz_shldi_epi32, _mm512_shldi_epi64,
	_mm512_mask_shldi_epi64, _mm512_maskz_shldi_epi64): Fix typo
	of lacking a closing parenthesis.
	* config/i386/avx512vbmi2vlintrin.h
	(_mm256_shrdi_epi16, _mm256_mask_shrdi_epi16,
	_mm256_maskz_shrdi_epi16, _mm256_shrdi_epi32,
	_mm256_mask_shrdi_epi32, _mm256_maskz_shrdi_epi32,
	_m256_shrdi_epi64, _m256_mask_shrdi_epi64,
	_m256_maskz_shrdi_epi64, _mm256_shldi_epi16,
	_mm256_mask_shldi_epi16, _mm256_maskz_shldi_epi16,
	_mm256_shldi_epi32, _mm256_mask_shldi_epi32,
	_mm256_maskz_shldi_epi32, _mm256_shldi_epi64,
	_mm256_mask_shldi_epi64, _mm256_maskz_shldi_epi64,
	_mm_shrdi_epi16, _mm_mask_shrdi_epi16,
	_mm_maskz_shrdi_epi16, _mm_shrdi_epi32,
	_mm_mask_shrdi_epi32, _mm_maskz_shrdi_epi32,
	_mm_shrdi_epi64, _mm_mask_shrdi_epi64,
	_m_maskz_shrdi_epi64, _mm_shldi_epi16,
	_mm_mask_shldi_epi16, _mm_maskz_shldi_epi16,
	_mm_shldi_epi32, _mm_mask_shldi_epi32,
	_mm_maskz_shldi_epi32, _mm_shldi_epi64,
	_mm_mask_shldi_epi64, _mm_maskz_shldi_epi64): Ditto.

gcc/testsuite/
	* gcc.target/i386/avx512vbmi2-vpshld-1.c: New test.
	* gcc.target/i386/avx512vbmi2-vpshrd-1.c: Ditto.
	* gcc.target/i386/sse-12.c: Add -mavx512vbmi2.
	* gcc.target/i386/sse-13.c: Ditto.
	* gcc.target/i386/sse-14.c: Add -mavx512vbmi2 and tests.
	* gcc.target/i386/sse-22.c: Ditto.
2020-02-14 17:09:44 +08:00
GCC Administrator 7866f9ebf1 Daily bump. 2020-02-14 00:18:35 +00:00
Jakub Jelinek 7276dd4c74 c: Fix ICE with cast to VLA [93576]
The following testcase ICEs, because the PR84305 changes try to evaluate
the size earlier.  If size has side-effects, that is desirable, and the
side-effects will actually be wrapped in a SAVE_EXPR.  The problem on this
testcase is that there are no side-effects, and c_fully_fold doesn't fold
those COMPOUND_EXPRs to constant, and while before gimplification we unshare
trees found in the expressions, the unsharing doesn't involve TYPE_SIZE etc.
of used types.  Gimplification is destructive though, so when we gimplify
the two nested COMPOUND_EXPRs and then try to gimplify it the second time
for the TYPE_SIZEs, we ICE.
Now, we could use unshare_expr in what we push to *expr, SAVE_EXPRs and
their operands in there aren't unshared, but I really don't see a point of
evaluating expressions that don't have side-effects before, so instead
this just pushes there expressions that do have side-effects.

2020-02-13  Jakub Jelinek  <jakub@redhat.com>

	PR c/93576
	* c-decl.c (grokdeclarator): If this_size_varies, only push size into
	*expr if it has side effects.

	* gcc.dg/pr93576.c: New test.
2020-02-13 21:50:45 +01:00