Commit Graph

176634 Commits

Author SHA1 Message Date
Jakub Jelinek 800bcc8c00 openmp: Add basic library allocator support.
This patch adds very basic allocator support (omp_{init,destroy}_allocator,
omp_{alloc,free}, omp_[sg]et_default_allocator).
The plan is to use memkind (likely dlopened) for high bandwidth memory, but
that part isn't implemented yet, probably mlock for pinned memory and see
what other options there are for other kinds of memory.
For offloading targets, we need to decide if we want to support the
dynamic allocators (and on which targets), or if e.g. all we do is at compile
time replace omp_alloc/omp_free calls with constexpr predefined allocators
with something special.

And allocate directive and allocator/uses_allocators clauses are future work
too.

2020-05-19  Jakub Jelinek  <jakub@redhat.com>

	* omp.h.in (omp_uintptr_t): New typedef.
	(__GOMP_UINTPTR_T_ENUM): Define.
	(omp_memspace_handle_t, omp_allocator_handle_t, omp_alloctrait_key_t,
	omp_alloctrait_value_t, omp_alloctrait_t): New typedefs.
	(__GOMP_DEFAULT_NULL_ALLOCATOR): Define.
	(omp_init_allocator, omp_destroy_allocator, omp_set_default_allocator,
	omp_get_default_allocator, omp_alloc, omp_free): Declare.
	* libgomp.h (struct gomp_team_state): Add def_allocator field.
	(gomp_def_allocator): Declare.
	* libgomp.map (OMP_5.0.1): Export omp_set_default_allocator,
	omp_get_default_allocator, omp_init_allocator, omp_destroy_allocator,
	omp_alloc and omp_free.
	* team.c (gomp_team_start): Copy over ts.def_allocator.
	* env.c (gomp_def_allocator): New variable.
	(parse_wait_policy): Adjust function comment.
	(parse_allocator): New function.
	(handle_omp_display_env): Print OMP_ALLOCATOR.
	(initialize_env): Call parse_allocator.
	* Makefile.am (libgomp_la_SOURCES): Add allocator.c.
	* allocator.c: New file.
	* icv.c (omp_set_default_allocator, omp_get_default_allocator): New
	functions.
	* testsuite/libgomp.c-c++-common/alloc-1.c: New test.
	* testsuite/libgomp.c-c++-common/alloc-2.c: New test.
	* testsuite/libgomp.c-c++-common/alloc-3.c: New test.
	* Makefile.in: Regenerated.
2020-05-19 10:11:01 +02:00
Martin Liska c3b44e3408
Add gcc-verify alias.
* gcc-git-customization.sh: Add gcc-verify alias
	that uses contrib/gcc-changelog/git_check_commit.py.
2020-05-19 09:19:18 +02:00
Kito Cheng f908b69cfd RISC-V: Handle implied extension for -march parser.
- Implied rule are introduced into latest RISC-V ISA spec.

  - Only implemented D implied F-extension. Zicsr and Zifence are not
    implement yet, so the rule not included in this patch.

  - Pass preprocessed arch string to arch.

  - Verified with binutils 2.30 and 2.34.

gcc/ChangeLog

	* common/config/riscv/riscv-common.c (riscv_implied_info_t): New.
	(riscv_implied_info): New.
	(riscv_subset_list): Add handle_implied_ext.
	(riscv_subset_list::to_string): New parameter version_p to
	control output format.
	(riscv_subset_list::handle_implied_ext): New.
	(riscv_subset_list::parse_std_ext): Call handle_implied_ext.
	(riscv_arch_str): New parameter version_p to control output format.
	(riscv_expand_arch): New.
	* config/riscv/riscv-protos.h (riscv_arch_str): New parameter,
	version_p.
	* config/riscv/riscv.h (riscv_expand_arch): New,
	(EXTRA_SPEC_FUNCTIONS): Define.
	(ASM_SPEC): Transform -march= via riscv_expand_arch.

gcc/testsuite/ChangeLog

	* gcc.target/riscv/arch-6.c: New.
	* gcc.target/riscv/attribute-11.c: New.
	* gcc.target/riscv/attribute-12.c: New.
2020-05-19 14:31:58 +08:00
Kito Cheng ca1a9763a1 RISC-V: Update march parser
- The arch string rule has changed in latest spec, it introduced new
   multi-letter extension prefix with 'h' and 'z', and drop `sx`. also
   adjust parsing order for 's' and 'x'.

gcc/ChangeLog

	* riscv-common.c (parse_sv_or_non_std_ext): Rename to
	parse_multiletter_ext.
	(parse_multiletter_ext): Add parsing `h` and `z`, drop `sx`,
	adjust parsing order for 's' and 'x'.

gcc/testsuite/ChangeLog

	* gcc.target/riscv/arch-3.c: Adjust option.
	* gcc.target/riscv/arch-5.c: New.
	* gcc.target/riscv/attribute-9.c: Adjust option and test
	condition.
2020-05-19 14:31:56 +08:00
Richard Biener a4b48fc47c cost invariant nodes from vect_slp_analyze_node_operations SLP walk
2020-05-19  Richard Biener  <rguenther@suse.de>

	* tree-vectorizer.h (_slp_tree::vectype): Add field.
	(SLP_TREE_VECTYPE): New.
	* tree-vect-slp.c (vect_create_new_slp_node): Initialize
	SLP_TREE_VECTYPE.
	(vect_create_new_slp_node): Likewise.
	(vect_prologue_cost_for_slp): Move here from tree-vect-stmts.c
	and simplify.
	(vect_slp_analyze_node_operations): Walk nodes children for
	invariant costing.
	(vect_get_constant_vectors): Use local scope op variable.
	* tree-vect-stmts.c (vect_prologue_cost_for_slp_op): Remove here.
	(vect_model_simple_cost): Adjust.
	(vect_model_store_cost): Likewise.
	(vectorizable_store): Likewise.
2020-05-19 07:59:51 +02:00
Patrick Palka 573e5f0500 c++: Enable spec_hasher table sanitization [PR87847]
It looks like hash table sanitization is now safe to enable for the
decl_specializations and type_specializations tables, probably ever
since PR94454 was fixed.

gcc/cp/ChangeLog:

	PR c++/87847
	* pt.c (init_template_processing): Enable sanitization for
	decl_specializations and type_specializations.
2020-05-18 23:50:32 -04:00
Patrick Palka 864fed4a49 c++: Explain fn template argument type/value mismatches [PR66439]
In fn_type_unifcation, we are passing NULL_TREE as the 'in_decl'
parameter to coerce_template_parms, and this is causing template
type/value mismatch error messages to get suppressed regardless of the
value of 'complain'.

This means that when substitution into a function template fails due to
a type/value mismatch between a template parameter and the provided
template argument, we just say "template argument deduction/substitution
failed:" without a followup explanation of the failure.

Fix this by passing 'fn' instead of NULL_TREE to coerce_template_parms.

gcc/cp/ChangeLog:

	PR c++/66439
	* pt.c (fn_type_unification): Pass 'fn' instead of NULL_TREE as
	the 'in_decl' parameter to coerce_template_parms.

gcc/testsuite/ChangeLog:

	PR c++/66439
	* g++.dg/cpp2a/concepts-ts4.C: Expect a "type/value mismatch"
	diagnostic.
	* g++.dg/cpp2a/concepts-ts6.C: Likewise.
	* g++.dg/template/error56.C: Likewise.
	* g++.dg/template/error59.C: New test.

libstdc++-v3/ChangeLog:

	PR c++/66439
	* testsuite/20_util/pair/astuple/get_neg.cc: Prune "type/value
	mismatch" messages.
	* testsuite/20_util/tuple/element_access/get_neg.cc: Likewise.
2020-05-18 23:50:14 -04:00
GCC Administrator 489fb00b14 Daily bump. 2020-05-19 00:16:28 +00:00
Marek Polacek 2d4e1e144c c++: ICE when shortening right shift [PR94955]
Since r10-6527 fold_for_warn calls maybe_constant_value, which means it
can fold more than it previously could.  In this testcase it means that
cp_build_binary_op/RSHIFT_EXPR set short_shift because now we were able
to fold op1 to an INTEGER_CST.  But then when actually performing the
shortening we crashed because cp_fold_rvalue wasn't able to fold as much
as f_f_w and so tree_int_cst_sgn crashed on a NOP_EXPR.  Therefore the
calls should probably match.

	PR c++/94955
	* typeck.c (cp_build_binary_op): Use fold_for_warn instead of
	cp_fold_rvalue.

	* g++.dg/cpp0x/constexpr-shift2.C: New test.
2020-05-18 19:01:54 -04:00
Marek Polacek bf732686c0 c++: ICE with -Wall and constexpr if [PR94937]
An ICE arises here because we call cp_get_callee_fndecl_nofold in a
template, and we've got a CALL_EXPR whose CALL_EXPR_FN is a BASELINK.
This tickles the INDIRECT_TYPE_P assert in cp_get_fndecl_from_callee.

Fixed by turning the assert into a condition and returning NULL_TREE
in that case.

	PR c++/94937
	* cvt.c (cp_get_fndecl_from_callee): Return NULL_TREE if the function
	type is not INDIRECT_TYPE_P.
	* decl.c (omp_declare_variant_finalize_one): Call
	cp_get_callee_fndecl_nofold instead of looking for the function decl
	manually.

	* g++.dg/cpp1z/constexpr-if34.C: New test.
	* g++.dg/cpp2a/is-constant-evaluated10.C: New test.
2020-05-18 18:53:38 -04:00
Martin Sebor 8edf0adb66 PR middle-end/92815 - spurious -Wstringop-overflow writing into a flexible array of an extern struct
Adjust test to avoid failures in ILP32 mode.

gcc/testsuite/ChangeLog:

	PR middle-end/92815
	* gcc.dg/builtin-object-size-20.c: Adjust to avoid failures in
	ILP32 mode.
2020-05-18 16:31:13 -06:00
Marek Polacek 5d2246a32c c++: Sorry about type-dependent arg for __builtin_has_attribute [PR90915]
Until 92104 is fixed, let's sorry rather than crash.

	PR c++/90915
	* parser.c (cp_parser_has_attribute_expression): Sorry on a
	type-dependent argument.

	* g++.dg/ext/builtin-has-attribute.C: New test.
2020-05-18 18:07:18 -04:00
Martin Sebor 7a41fcde6c PR middle-end/92815 - spurious -Wstringop-overflow writing into a flexible array of an extern struct
gcc/ChangeLog:

	PR middle-end/92815
	* tree-object-size.c (decl_init_size): New function.
	(addr_object_size): Call it.
	* tree.h (last_field): Declare.
	(first_field): Add attribute nonnull.

gcc/testsuite/ChangeLog:

	PR middle-end/92815
	* gcc.dg/Warray-bounds-56.c: Remove xfails.
	* gcc.dg/builtin-object-size-20.c: New test.
	* gcc.dg/builtin-object-size-21.c: New test.
2020-05-18 15:24:12 -06:00
Martin Sebor 3956244c58 PR middle-end/94940 - spurious -Warray-bounds for a zero length array member of union
gcc/testsuite/ChangeLog:

	PR middle-end/94940
	* gcc.dg/Warray-bounds-61.c: New test.

gcc/ChangeLog:

	PR middle-end/94940
	* tree-vrp.c (vrp_prop::check_mem_ref): Remove unreachable code.
	* tree.c (component_ref_size): Correct the handling or array members
	of unions.
	Drop a pointless test.
	Rename a local variable.
2020-05-18 15:07:48 -06:00
Joseph Myers 628bb80408 Update gcc sv.po.
* sv.po: Update.
2020-05-18 20:50:35 +00:00
Marek Polacek ae8ed736ad c++: Implement DR 1512, Pointer comparison vs qual convs [PR87699]
This patch resolves DR 1512 (and, by turn, DR 583).  This entails:

1) Relational pointer comparisons against null pointer constants have
   been made ill-formed:

   void f(char *p) {
      if (p > 0)
	// ...
   }

   was always invalid in C but was -- accidentally -- allowed in C++.

2) This was ill-formed:

   bool foo(int** x, const int** y) {
     return x < y;
   }

   because 'int**' couldn't be converted to 'const int**'.  This was
   fixed by re-defining a generic composite pointer type.  The composite
   type of these two pointers will be 'const int *const *', to which
   both pointers can be converted.

3) The overload descriptions for built-in operators were adjusted,
   because objects of type std::nullptr_t cannot be used with relational
   operators any more.

I fixed 1) by adjusting cp_build_binary_op; we already had a warning
for it so made it a hard error now.

Then 2) required tweaking composite_pointer_type_r.  [expr.type] defines
the composite pointer type by using the "cv-combined type."  We didn't
implement the [conv.qual]/3.3 part; previously the composite type of
'int**' and 'const int**' was 'const int**', so this didn't compile:

    void f(const int **p, int **q) {
      true ? p : q;
    }

I wrote a more extensive test for this which uses decltype and some
template magic to check the composite type, see composite-ptr-type.C.
We still don't handle everything that [expr.type] requires us to,
but it's pretty close.

And finally 3) was handled in add_builtin_candidate.  Turned out we
weren't creating built-in operator candidates when the type was
std::nullptr_t at all.  We should, for == and !=.  Tested in builtin4.C.
In passing, I'm fixing some of the comments too.

	DR 1512
	PR c++/87699
	* call.c (add_builtin_candidate) <case EQ_EXPR>: Create candidate
	operator functions when type is std::nullptr_t for ==/!=.
	* typeck.c (composite_pointer_type_r): Add bool a * parameter.  Use it
	to maybe add "const" to the pointer type.
	(composite_pointer_type): Update the call to composite_pointer_type_r.
	(cp_build_binary_op): Turn two warning_at into error_at.  Print the
	types.

	* g++.dg/cpp0x/constexpr-array-ptr10.C: Change dg-warning to dg-error
	and adjust the expected messages in dg-error.
	* g++.dg/expr/composite-ptr-type.C: New test.
	* g++.dg/expr/ptr-comp1.C: New test.
	* g++.dg/expr/ptr-comp2.C: New test.
	* g++.dg/expr/ptr-comp3.C: New test.
	* g++.dg/overload/builtin4.C: New test.
	* g++.dg/warn/Wextra-3.C: Change dg-warning to dg-error.
2020-05-18 16:26:06 -04:00
Jason Merrill 295790712f c++: Create fewer SAVE_EXPR.
In a couple of places in build_over_call we were calling
cp_stabilize_reference but only using the result once, so it isn't needed.

gcc/cp/ChangeLog
2020-05-18  Jason Merrill  <jason@redhat.com>

	* call.c (build_over_call): Remove unnecessary
	cp_stabilize_reference.
2020-05-18 16:17:59 -04:00
Marek Polacek 100fdb1f09 c++: Don't add built-in operator for ++ on bool.
This feels extremely obscure but at least it's an opportunity to fix the
comments.  P0002R1 removed deprecated operator++(bool) in C++17 so let's
avoid adding a builtin overload candidate for ++ when the type is bool.

	* call.c (add_builtin_candidate): Don't create a builtin overload
	candidate for ++ when type is bool in C++17.

	* g++.dg/overload/builtin5.C: New test.
2020-05-18 15:50:12 -04:00
Marek Polacek 642dc602f8 c++: Regenerate cp/cfns.h.
Current cfns.h includes register-qualified variables and that wouldn't
play well when bootstrapping with GCC that uses the C++17 dialect,
because 'register' was removed in C++17.  Regenerating it using the
command specified in cfns.h luckily cleaned this up.

	* cfns.h: Regenerated.
2020-05-18 15:47:30 -04:00
Douglas Rupp c917584aa9 Require powerpc_vsx_ok in gcc.target/powerpc/pr71763.c
We're getting an error when running this test on PowerPC VxWorks 7,
due to an unexpected warning:

    | Excess errors:
    | cc1: warning: '-mvsx' and '-mno-altivec' are incompatible

The warning comes from a combination of factors:
  - The test itself uses -mvsx explicitly via the following directive:
       // { dg-options "-O1 -mvsx" }
  - Our toolchain was configured so as to make -mno-altivec
    the default;
  - These two options are mutually exclusive.

This commit adds a powerpc_vsx_ok dg-require-effective-target directive
to that test, and thus making it UNSUPPORTED instead.

Tested on PowerPC VxWorks 7. Also tested on PowerPC ELF as well,
a platform where we do not make -mno-altivec the default, to verify
that the test continues to run as usual in that case.

gcc/testsuite/

        * gcc.target/powerpc/pr71763.c: Require powerpc_vsx_ok.
2020-05-18 11:43:48 -07:00
Jason Merrill 5329b59a2e bootstrap: Update requirement to C++11.
There was general agreement last November that we would move to allowing
C++11 features to be used in GCC 11; this patch implements that direction.

ChangeLog
2020-05-18  Jason Merrill  <jason@redhat.com>

	* configure.ac: Update bootstrap dialect to -std=c++11.

config/ChangeLog
2020-05-18  Jason Merrill  <jason@redhat.com>

	* ax_cxx_compile_stdcxx.m4: Import from autoconf archive with
	an adjustment to try the default mode.

gcc/ChangeLog
2020-05-18  Jason Merrill  <jason@redhat.com>

	* aclocal.m4: Add ax_cxx_compile_stdcxx.m4.
	* configure.ac: Use AX_CXX_COMPILE_STDCXX(11).
2020-05-18 14:29:18 -04:00
Harald Anlauf e5abd1cb91 PR fortran/95053 - division by zero constants
Partially revert the fix for PR93499.  Replace by checks for valid
	expressions in the declaration of array shape and PDT KIND and LEN
	expressions at a later stage.

gcc/fortran/

2020-05-18  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/95053
	* arith.c (gfc_divide): Revert hunk introduced by patch for
	PR93499.
	* decl.c (variable_decl): Generate error for array shape not being
	an INTEGER constant.
	(gfc_get_pdt_instance): Generate error if KIND or LEN expressions
	in declaration of a PDT instance do not simplify to INTEGER
	constants.

gcc/testsuite/

2020-05-18  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/95053
	* gfortran.dg/dec_structure_23.f90: Adjust to new error messages.
	* gfortran.dg/pr93499.f90: Adjust to new error messages.
	* gfortran.dg/pr95053_2.f90: New test.
	* gfortran.dg/pr95053_3.f90: New test.
2020-05-18 20:27:29 +02:00
Stefan Schulze Frielinghaus 2c832ffedf tree-optimization: Fix use of uninitialized variables warnings [PR94952]
While bootstrapping GCC on S/390 with --enable-checking=release several
warnings about use of uninitialized variables bitpos, bitregion_start, and
bitregion_end of function pass_store_merging::process_store are raised.
According to PR94952 these seem to be false positives which are silenced by
initialising the mentioned variables.

Bootstrapped on S/390.  Ok for master and releases/gcc-10 assuming that
regtest succeeds (still running but I don't see a reason why it
should fail)?

gcc/ChangeLog:

2020-05-18  Stefan Schulze Frielinghaus  <stefansf@linux.ibm.com>

	PR tree-optimization/94952
	* gimple-ssa-store-merging.c (pass_store_merging::process_store):
	Initialize variables bitpos, bitregion_start, and bitregion_end in
	order to silence warnings about use of uninitialized variables.
2020-05-18 20:04:25 +02:00
Marek Polacek be464161b4 c++: Add test for c++/95143
Already fixed by r10-8124-gceae6a13366d9646e172fc943fe8e221b70f0920.

	PR c++/95143
	* g++.dg/cpp0x/sfinae66.C: New test.
2020-05-18 13:50:39 -04:00
Carl Love 24f68831d2 pr94833, fix vec_first_match_index for nulls
gcc/ChangeLog

2020-04-30  Carl Love  <cel@us.ibm.com>

	PR target/94833
	* config/rs6000/vsx.md (define_expand): Fix instruction generation for
	first_match_index_<mode>.
	* testsuite/gcc.target/powerpc/builtins-8-p9-runnable.c (main): Add
	additional test cases with zero vector elements.
2020-05-18 12:14:40 -05:00
Uros Bizjak 8f17461bdf i386: Avoid reversing a non-trapping comparison to a trapping one [PR95169]
gcc/ChangeLog:

	PR target/95169
	* config/i386/i386-expand.c (ix86_expand_int_movcc):
	 Avoid reversing a non-trapping comparison to a trapping one.

testsuite/ChangeLog:

	PR target/95169
	* gcc.target/i386/pr95169.c: New test.
2020-05-18 17:52:14 +02:00
Alex Coplan 8b8f311726 [arm] Don't generate invalid LDRD insns
This fixes a bug in the arm backend where GCC generates invalid LDRD
instructions. The LDRD instruction requires the first transfer register to be
even, but GCC attempts to use odd registers here. For example, with the
following C code:

    struct c {
      double a;
    } __attribute((aligned)) __attribute((packed));
    struct c d;
    struct c f(struct c);
    void e() { f(d); }

The struct d is passed in registers r1 and r2 to the function f, and GCC
attempted to do this with a LDRD instruction when compiling with -march=armv7-a
on a soft float toolchain.

The fix is analogous to the corresponding one for STRD in the same function:
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=52057dc4ac5295caebf83147f688d769c93cbc8d

2020-05-18  Alex Coplan  <alex.coplan@arm.com>

gcc/:
	* config/arm/arm.c (output_move_double): Fix codegen when loading into
	a register pair with an odd base register.

gcc/testsuite/:
	* gcc.c-torture/compile/packed-aligned-1.c: New test.
	* gcc.c-torture/execute/packed-aligned.c: New test.
2020-05-18 16:31:43 +01:00
Uros Bizjak 94f687bd9a i386: Improve vector mode and TFmode ABS and NEG patterns
gcc/ChangeLog:

2020-05-18  Uroš Bizjak  <ubizjak@gmail.com>

	* config/i386/i386-expand.c (ix86_expand_fp_absneg_operator):
	Do not emit FLAGS_REG clobber for TFmode.
	* config/i386/i386.md (*<code>tf2_1): Rewrite as
	define_insn_and_split.  Mark operands 1 and 2 commutative.
	(*nabstf2_1): Ditto.
	(absneg SSE splitter): Use MODEF mode iterator instead of SSEMODEF.
	Do not swap memory operands.  Simplify RTX generation.
	(neg abs SSE splitter): Ditto.
	* config/i386/sse.md (*<code><mode>2): Mark operands 1 and 2
	commutative.  Do not swap operands.  Simplify RTX generation.
	(*nabs<mode>2): Ditto.
2020-05-18 17:25:39 +02:00
Richard Biener cfaf0edbb1 fixup BB vectorization constant generation place
This adjusts the way we compute the stmt insert location for
invariants in BB vectorization context to deal with eventually
sharing invariant SLP nodes for multiple uses.  We can no longer
use a single use stmt location then but there's a simple way out.

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

	* tree-vect-slp.c (vect_slp_bb): Start after labels.
	(vect_get_constant_vectors): Really place init stmt after scalar defs.
	* tree-vect-stmts.c (vect_init_vector_1): Insert before
	region begin.
2020-05-18 15:31:05 +02:00
H.J. Lu d83e28f47f x86: Update Intel processor detection
Add cpu model numbers for Intel Airmont, Tremont, Comet Lake, Ice Lake
and Tiger Lake processor families.

	* config/i386/driver-i386.c (host_detect_local_cpu): Support
	Intel Airmont, Tremont, Comet Lake, Ice Lake and Tiger Lake
	processor families.
2020-05-18 05:35:56 -07:00
Alex Coplan 9a4a0a5b0e MAINTAINERS: Add myself for write after approval.
2020-05-18  Alex Coplan  <alex.coplan@arm.com>

* MAINTAINERS (Write After Approval): Add myself.
2020-05-18 12:21:17 +01:00
Richard Biener fe168751c5 middle-end/95171 - inlining of trapping compare into non-call EH fn
This fixes always-inlining across -fnon-call-exception boundaries
for conditions which we do not allow to throw.

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

	PR middle-end/95171
	* tree-inline.c (remap_gimple_stmt): Split out trapping compares
	when inlining into a non-call EH function.

	* gcc.dg/pr95171.c: New testcase.
2020-05-18 12:27:53 +02:00
Richard Biener 52a0f83980 tree-optimization/95172 - avoid mixing conditionalized and ordered SM
The following testcase shows a missed optimization that then leads to
wrong-code when issueing SMed stores on exits.  When we were able to
compute an ordered sequence of stores for an exit we need to emit
that in the correct order and we can emit it disregarding to any
conditional for whether a store actually happened (we know it did).
We can also improve detection as of whether we need conditional
processing at all.  Both parts fix the testcase.

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

	PR tree-optimization/95172
	* tree-ssa-loop-im.c (execute_sm): Get flag whether we
	eventually need the conditional processing.
	(execute_sm_exit): When processing an orderd sequence
	avoid doing any conditional processing.
	(hoist_memory_references): Pass down whether all edges
	have ordered processing for a ref to execute_sm.

	* gcc.dg/torture/pr95172.c: New testcase.
2020-05-18 11:53:10 +02:00
GCC Administrator 03d549090e Daily bump. 2020-05-18 00:16:18 +00:00
Iain Sandoe 2b9a271b2d coroutines: Avoid a maybe used uninitialized warning. NFC.
This avoids a (bogus) warning that occurs with some bootstrap
compilers.

gcc/cp/ChangeLog:

2020-05-17  Iain Sandoe  <iain@sandoe.co.uk>

	* coroutines.cc (morph_fn_to_coro): Initialize the
	gro variable.
2020-05-17 19:59:40 +01:00
Jeff Law 4c1b27f961 Use pc_or_label_operand to collapse a couple more patterns in preparation for the cc0->CC_REG transition.
* config/h8300/predicates.md (pc_or_label_operand): New predicate.
	* config/h8300/jumpcall.md (branch_true, branch_false): Consolidate
	into a single pattern using pc_or_label_operand.
	* config/h8300/combiner.md (bit branch patterns): Likewise.
	* config/h8300/peepholes.md (HImode and SImode branches): Likewise.
2020-05-17 13:22:38 -04:00
H.J. Lu 266f44a91c x86: Allow V1TI vector register pushes
Add V1TI vector register push and split it after reload to a sequence
of:

(set (reg:P SP_REG) (plus:P SP_REG) (const_int -8)))
(set (match_dup 0) (match_dup 1))

so that STV pass can convert TI mode integer push to V1TI vector register
push.  Rename has_non_address_hard_reg to pseudo_reg_set, combine calls
of single_set and has_non_address_hard_reg to pseudo_reg_set, to ignore
pseudo register push.

Remove c-c++-common/dfp/func-vararg-mixed-2.c since it is compiled with
-mpreferred-stack-boundary=2 and leads to segfault:

Dump of assembler code for function __bid_nesd2:
   0x08049210 <+0>:	endbr32
   0x08049214 <+4>:	push   %esi
   0x08049215 <+5>:	push   %ebx
   0x08049216 <+6>:	call   0x8049130 <__x86.get_pc_thunk.bx>
   0x0804921b <+11>:	add    $0x8de5,%ebx
   0x08049221 <+17>:	sub    $0x20,%esp
   0x08049224 <+20>:	mov    0x30(%esp),%esi
   0x08049228 <+24>:	pushl  0x2c(%esp)
   0x0804922c <+28>:	call   0x804e600 <__bid32_to_bid64>
   0x08049231 <+33>:	mov    %esi,(%esp)
   0x08049234 <+36>:	movd   %edx,%xmm1
   0x08049238 <+40>:	movd   %eax,%xmm0
   0x0804923c <+44>:	punpckldq %xmm1,%xmm0
=> 0x08049240 <+48>:	movaps %xmm0,0x10(%esp)
   0x08049245 <+53>:	call   0x804e600 <__bid32_to_bid64>
   0x0804924a <+58>:	push   %edx
   0x0804924b <+59>:	push   %eax
   0x0804924c <+60>:	pushl  0x1c(%esp)
   0x08049250 <+64>:	pushl  0x1c(%esp)
   0x08049254 <+68>:	call   0x804b260 <__bid64_quiet_not_equal>
   0x08049259 <+73>:	add    $0x34,%esp
   0x0804925c <+76>:	pop    %ebx
   0x0804925d <+77>:	pop    %esi
   0x0804925e <+78>:	ret

when libgcc is compiled with -msse2.  According to GCC manual:

'-mpreferred-stack-boundary=NUM'
     Attempt to keep the stack boundary aligned to a 2 raised to NUM
     byte boundary.  If '-mpreferred-stack-boundary' is not specified,
     the default is 4 (16 bytes or 128-bits).

     *Warning:* If you use this switch, then you must build all modules
     with the same value, including any libraries.  This includes the
     system libraries and startup modules.

c-c++-common/dfp/func-vararg-mixed-2.c, which was added by

commit 3b2488ca6e
Author: H.J. Lu <hongjiu.lu@intel.com>
Date:   Wed Jul 30 19:24:02 2008 +0000

    func-vararg-alternate-d128-2.c: New.

    2008-07-30  H.J. Lu  <hongjiu.lu@intel.com>
                Joey Ye  <joey.ye@intel.com>

            * gcc.dg/dfp/func-vararg-alternate-d128-2.c: New.
            * gcc.dg/dfp/func-vararg-mixed-2.c: Likewise.

isn't expected to work with libgcc.

gcc/

	PR target/95021
	* config/i386/i386-features.c (has_non_address_hard_reg):
	Renamed to ...
	(pseudo_reg_set): This.  Return the SET expression.  Ignore
	pseudo register push.
	(general_scalar_to_vector_candidate_p): Combine single_set and
	has_non_address_hard_reg calls to pseudo_reg_set.
	(timode_scalar_to_vector_candidate_p): Likewise.
	* config/i386/i386.md (*pushv1ti2): New pattern.

gcc/testsuite/

	PR target/95021
	* c-c++-common/dfp/func-vararg-mixed-2.c: Removed.
	* gcc.target/i386/pr95021-1.c: New test.
	* gcc.target/i386/pr95021-2.c: Likewise.
	* gcc.target/i386/pr95021-3.c: Likewise.
	* gcc.target/i386/pr95021-4.c: Likewise.
	* gcc.target/i386/pr95021-5.c: Likewise.
2020-05-17 10:10:47 -07:00
Iain Buclaw e977a5df5b libphobos: Merge upstream druntime 5cc061a8, phobos 64ed4684f
- core.cpuid has been fixed to not use i7 detection on AMD processors.
- std.net.curl has been fixed to correctly handle HTTP/2 status lines.
- std.zip has had a test fixed to not rely on unzip being installed.

Fixes: PR d/95166
       PR d/95167
       PR d/95168

Reviewed-on: https://github.com/dlang/druntime/pull/3107
	     https://github.com/dlang/phobos/pull/7486
2020-05-17 18:49:19 +02:00
H.J. Lu cc558e2801 x86: Add gcc.target/i386/strncmp-1.c
Add a strncmp test for the cmpstrn pattern with neither of the strings
is a constant string.  We can expand the cmpstrn pattern to "repz cmpsb"
only if one of the strings is a constant so that expand_builtin_strncmp()
can write the length argument to be the minimum of the const string
length and the actual length argument.  Otherwise, "repz cmpsb" may pass
the 0 byte.

	* gcc.target/i386/strncmp-1.c: New test.
2020-05-17 06:52:14 -07:00
Aldy Hernandez e7e785dfec Revert previous patch:
2020-05-17  Aldy Hernandez  <aldyh@redhat.com>

	* tree-vrp.c (operand_less_p): Move to...
	* vr-values.c (operand_less_p): ...here.
	* tree-vrp.h (operand_less_p): Remove.
2020-05-17 13:56:55 +02:00
Aldy Hernandez 8bfc81876f Move operand_less_p to vr-values.c. 2020-05-17 13:46:32 +02:00
Aldy Hernandez 5b461bdb48 Remove vrp_insert::live_on_edge declaration.
* tree-vrp.c (class vrp_insert): Remove prototype for
	live_on_edge.
2020-05-17 13:43:36 +02:00
Aldy Hernandez f119b4e631 More refactoring of tree-vrp.c.
New class live_names to maintain the set of SSA names live.

Fix whitespace in vrp_insert.

Move a few more methods related to ASSERT_EXPR insertion into vrp_insert.
2020-05-17 11:14:39 +02:00
Aldy Hernandez 65d44272bd Move array bounds checking out of vrp_prop and into its own class. 2020-05-17 11:05:30 +02:00
GCC Administrator add058cf93 Daily bump. 2020-05-17 00:16:17 +00:00
Iain Sandoe 5ef067eb14 coroutines: Implicitly movable objects should use move CTORs for co_return.
This is a case where the standard contains conflicting information.
after discussion between implementators, the accepted intent is of
[class.copy.elision].  This amends the handling of co_return statements
to follow that.

gcc/cp/ChangeLog:

2020-05-16  Iain Sandoe  <iain@sandoe.co.uk>

	* coroutines.cc (finish_co_return_stmt): Implement rules
	from [class.copy.elision] /3.

gcc/testsuite/ChangeLog:

2020-05-16  Iain Sandoe  <iain@sandoe.co.uk>

	* g++.dg/coroutines/co-return-syntax-10-movable.C: New test.
2020-05-16 19:59:39 +01:00
Jeff Law f5b461d453 Consolidate a couple peepholes and improve peepholes that combine stack allocations with stack stores.
* config/h8300/h8300.md (SFI iterator): New iterator for
	SFmode and SImode.
	* config/h8300/peepholes.md (memory comparison): Use mode
	iterator to consolidate 3 patterns into one.
	(stack allocation and stack store): Handle SFmode.  Handle
	8 byte allocations.
2020-05-16 00:50:53 -04:00
GCC Administrator 53b4d52f11 Daily bump. 2020-05-16 00:16:18 +00:00
Patrick Palka 115232b778 c++: decltype of invalid non-dependent expr [PR57943]
We sometimes fail to reject an invalid non-dependent operand to decltype
when inside a template, because finish_decltype_type resolves the
decltype to the TREE_TYPE of the operand before we ever instantiate and
fully process the operand.  Fix this by adding a call to
instantiate_non_dependent_expr_sfinae in finish_decltype_type.

gcc/cp/ChangeLog:

	PR c++/57943
	* semantics.c (finish_decltype_type): Call
	instantiate_non_dependent_expr_sfinae on the expression.

gcc/testsuite/ChangeLog:

	PR c++/57943
	* g++.dg/cpp0x/decltype76.C: New test.
2020-05-15 18:51:11 -04:00
Joseph Myers 9d495e7250 Update cpplib sv.po.
* sv.po: Update.
2020-05-15 22:40:40 +00:00