Commit Graph

190985 Commits

Author SHA1 Message Date
Claudiu Zissulescu 68a650ba57 arc: Add DWARF2 alternate CFA column.
Add DWARF 2 CFA column which tracks the return address from a signal
handler context.  This value must not correspond to a hard register
and must be out of the range of DWARF_FRAME_REGNUM().

gcc/
	* config/arc/arc.h (DWARF_FRAME_REGNUM): Update definition.
	(DWARF_FRAME_RETURN_COLUMN): Use RETURN_ADDR_REGNUM macro.
	(INCOMING_RETURN_ADDR_RTX): Likewise.
	(DWARF_ALT_FRAME_RETURN_COLUMN): Define.

gcc/testsuite/
	* gcc.target/arc/cancel-1.c: New file.

libgcc/
	* config/arc/linux-unwind.h (arc_fallback_frame_state): Use
	DWARF_ALT_FRAME_RETURN_COLUMN macro.

Signed-off-by: Claudiu Zissulescu <claziss@synopsys.com>
2022-01-14 12:24:52 +02:00
Claudiu Zissulescu b3989a7b10 arc: Update stack size computation when accumulator registers are available.
When accumulator registers are available in a processor, they need to
be save onto stack durring interrupts.  We were already doing so, but
the stack size was wrongly computed in the case other than ARC600.

gcc/

	* config/arc/arc.c (arc_compute_frame_size): Remove condition when
	computin checking accumulator regs.
	(arc_expand_prologue): Update comments.
	(arc_expand_epilogue): Likewise.

Signed-off-by: Claudiu Zissulescu <claziss@synopsys.com>
2022-01-14 12:24:51 +02:00
Jonathan Wakely 9a0b518a82 libstdc++: Add C++20 std::make_shared enhancements (P0674R1)
This adds the overloads of std::make_shared and std::allocate_shared for
creating arrays, added to C++20 by P0674R1.

It also adds std::make_shared_for_overwrite, added to C++20 by P1020R1
(and renamed by P1973R1). The std::make_unique_for_overwite overloads
are already supported.

The original std::make_shared overload is changed to construct a
shared_ptr directly instead of calling std::allocate_shared. This
removes a function call at runtime, and avoids having to do overload
resolution for std::allocate_shared, now that there are five overloads
of it.

Allocating a shared array is done by a new __shared_count constructor.
An array is allocated with space for additional elements at the end and
an instance of new _Sp_counted_array class template is constructed in
that unused capacity.

The non-array form of std::make_shared_for_overwrite uses the same
__shared_count constructor as the original std::make_shared overload,
but a new partial specialization of _Sp_counted_ptr_inplace is selected
when the allocator's value_type is the new _Sp_overwrite_tag type. That
new partial specialization default-initializes its contained object and
destroys it with a destructor call rather than using the allocator.

Despite being C++20 features, this implementation only uses concepts
conditionally, with workarounds when they are not supported. This allows
it to work with older non-GCC compilers (Clang 9 and icc 2021). At some
point we can simplify the code by removing the workarounds.

libstdc++-v3/ChangeLog:

	* include/bits/shared_ptr.h (__cpp_lib_shared_ptr_weak_type):
	Correct type of macro value.
	(shared_ptr): Add additional friend declarations.
	(make_shared, allocate_shared): Constrain existing overloads and
	remove static_assert.
	* include/bits/shared_ptr_base.h (__cpp_lib_smart_ptr_for_overwrite):
	New macro.
	(_Sp_counted_ptr_inplace<T, Alloc, Lp>): New partial
	specialization for use with make_shared_for_overwrite.
	(__cpp_lib_shared_ptr_arrays): Update value for C++20.
	(_Sp_counted_array_base): New class template.
	(_Sp_counted_array): New class template.
	(__shared_count(_Tp*&, const _Sp_counted_array_base&, _Init)):
	New constructor for allocating shared arrays.
	(__shared_ptr(const _Sp_counted_array_base&, _Init)): Likewise.
	* include/std/version (__cpp_lib_shared_ptr_weak_type): Correct
	type.
	(__cpp_lib_shared_ptr_arrays): Update value for C++20.
	(__cpp_lib_smart_ptr_for_overwrite): New macro.
	* testsuite/20_util/shared_ptr/creation/99006.cc: Adjust
	expected errors.
	* testsuite/20_util/shared_ptr/creation/array.cc: New test.
	* testsuite/20_util/shared_ptr/creation/overwrite.cc: New test.
	* testsuite/20_util/shared_ptr/creation/version.cc: New test.
	* testsuite/20_util/unique_ptr/creation/for_overwrite.cc: Check
	feature test macro. Test non-trivial default-initialization.
2022-01-14 10:14:25 +00:00
Jonathan Wakely fc6f1128ae libstdc++: Ignore cv-quals when std::allocator<void> constructs
When I added the std::allocator_traits<std::allocator<void>>
specialization it broke code like this:

  std::allocate_shared<const int>(std::allocator<void>());

The problem is that allocator_traits<allocator<void>>::construct(a, p)
now uses std::_Construct(p), which only does a static_cast<void*>(p) and
so fails if the pointer has cv-quals.

This changes std::_Construct (and the related std::_Construct_novalue)
to use a C-style cast to (void*) which matches the effects of the
"voidify" helper in the C++20 standard.

libstdc++-v3/ChangeLog:

	* include/bits/stl_construct.h (_Construct, _Construct_novalue):
	Also cast away cv-qualifiers when converting pointer to void.
	* testsuite/20_util/allocator/void.cc: Test construct function
	with cv-qualified types.
2022-01-14 10:14:25 +00:00
Jonathan Wakely d67ba1dce9 libstdc++: Use std::construct_at in std::common_iterator [PR103992]
This should have been done as part of the LWG 3574 changes.

libstdc++-v3/ChangeLog:

	PR libstdc++/103992
	* include/bits/stl_iterator.h (common_iterator): Use
	std::construct_at instead of placement new.
	* testsuite/24_iterators/common_iterator/1.cc: Check copy
	construction is usable in constant expressions.
2022-01-14 10:14:24 +00:00
Jonathan Wakely 7f390f11b4 libstdc++: Document new std::random_device tokens
libstdc++-v3/ChangeLog:

	* doc/xml/manual/status_cxx2011.xml: Document new tokens
	accepted by std::random_device constructor.
	* doc/html/manual/status.html: Regenerate.
2022-01-14 10:14:24 +00:00
Roger Sayle 51e9e8a2e2 x86_64: Improvements to arithmetic right shifts of V1TImode values.
This patch to the i386 backend's ix86_expand_v1ti_ashiftrt provides
improved (shorter) implementations of V1TI mode arithmetic right shifts
for constant amounts between 111 and 126 bits.  The significance of
this range is that this functionality is useful for (eventually)
providing sign extension from HImode and QImode to V1TImode.

For example, x>>112 (to sign extend a 16-bit value), was previously
generated as a four operation sequence:

        movdqa  %xmm0, %xmm1		// word    7 6 5 4 3 2 1 0
        psrad   $31, %xmm0		// V8HI = [S,S,?,?,?,?,?,?]
        psrad   $16, %xmm1		// V8HI = [S,X,?,?,?,?,?,?]
        punpckhqdq      %xmm0, %xmm1	// V8HI = [S,S,?,?,S,X,?,?]
        pshufd  $253, %xmm1, %xmm0	// V8HI = [S,S,S,S,S,S,S,X]

with this patch, we now generates a three operation sequence:

        psrad   $16, %xmm0		// V8HI = [S,X,?,?,?,?,?,?]
        pshufhw $254, %xmm0, %xmm0	// V8HI = [S,S,S,X,?,?,?,?]
        pshufd  $254, %xmm0, %xmm0	// V8HI = [S,S,S,S,S,S,S,X]

The correctness of generated code is confirmed by the existing
run-time test gcc.target/i386/sse2-v1ti-ashiftrt-1.c in the testsuite.
This idiom is safe to use for shifts by 127, but that case gets handled
by a two operation sequence earlier in this function.

2022-01-14  Roger Sayle  <roger@nextmovesoftware.com>
	    Uroš Bizjak  <ubizjak@gmail.com>

gcc/ChangeLog
	* config/i386/i386-expand.c (ix86_expand_v1ti_to_ti): Use force_reg.
	(ix86_expand_ti_to_v1ti): Use force_reg.
	(ix86_expand_v1ti_shift): Use force_reg.
	(ix86_expand_v1ti_rotate): Use force_reg.
	(ix86_expand_v1ti_ashiftrt): Provide new three operation
	implementations for shifts by 111..126 bits.  Use force_reg.
2022-01-14 10:08:26 +00:00
Martin Liska 89b4e316a0 ARM: fix -Wformat= error
gcc/ChangeLog:

	* common/config/arm/arm-common.c (arm_target_mode): Fix
	warning: unterminated quoting directive [-Wformat=].
2022-01-14 09:17:37 +01:00
Siddhesh Poyarekar 17df585a3a tree-optimization/104009: Conservative underflow estimate in object size
Restrict negative offset computation only to dynamic object sizes, where
size expressions are accurate and not a maximum/minimum estimate and in
cases where negative offsets definitely mean an underflow, e.g. in
MEM_REF of the whole object with negative ofset in addr_object_size.

This ends up missing some cases where __builtin_object_size could have
come up with more precise results, so tests have been adjusted to
reflect that.

gcc/ChangeLog:

	PR tree-optimization/104009
	* tree-object-size.c (compute_builtin_object_size): Bail out on
	negative offset.
	(plus_stmt_object_size): Return maximum of wholesize and minimum
	of 0 for negative offset.

gcc/testsuite/ChangeLog:

	PR tree-optimization/104009
	* gcc.dg/builtin-object-size-1.c (test10): New test.
	* gcc.dg/builtin-object-size-3.c (test10): Likewise.
	(test9): Expect zero size for negative offsets.
	* gcc.dg/builtin-object-size-4.c (test8): Likewise.
	* gcc.dg/builtin-object-size-5.c (test7): Drop test for
	__builtin_object_size.

Signed-off-by: Siddhesh Poyarekar <siddhesh@gotplt.org>
2022-01-14 11:51:44 +05:30
liuhongt b77e3b4e45 Fix ICE of unrecognizable insn. [PR target/104001]
For define_insn_and_split "*xor2andn":

1. Refine predicate of operands[0] from nonimmediate_operand to
register_operand.
2. Remove TARGET_AVX512BW from condition to avoid kmov when TARGET_BMI
is not available.

gcc/ChangeLog:

	PR target/104001
	PR target/94790
	PR target/104014
	* config/i386/i386.md (*xor2andn): Refine predicate of
	operands[0] from nonimmediate_operand to
	register_operand, remove TARGET_AVX512BW from condition.

gcc/testsuite/ChangeLog:

	* gcc.target/i386/pr104001.c: New test.
2022-01-14 13:02:26 +08:00
David Malcolm b31cec9c22 Add __attribute__ ((tainted_args))
This patch adds a new __attribute__ ((tainted_args)) to the C/C++ frontends.

It can be used on function decls: the analyzer will treat as tainted
all parameters to the function and all buffers pointed to by parameters
to the function.  Adding this in one place to the Linux kernel's
__SYSCALL_DEFINEx macro allows the analyzer to treat all syscalls as
having tainted inputs.  This gives some coverage of system calls without
needing to "teach" the analyzer about "__user" - an example of the use
of this can be seen in CVE-2011-2210, where given:

 SYSCALL_DEFINE5(osf_getsysinfo, unsigned long, op, void __user *, buffer,
                 unsigned long, nbytes, int __user *, start, void __user *, arg)

the analyzer will treat the nbytes param as under attacker control, and
can complain accordingly:

taint-CVE-2011-2210-1.c: In function 'sys_osf_getsysinfo':
taint-CVE-2011-2210-1.c:69:21: warning: use of attacker-controlled value
  'nbytes' as size without upper-bounds checking [CWE-129] [-Wanalyzer-tainted-size]
   69 |                 if (copy_to_user(buffer, hwrpb, nbytes) != 0)
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Additionally, the patch allows the attribute to be used on field decls:
specifically function pointers.  Any function used as an initializer
for such a field gets treated as being called with tainted arguments.
An example can be seen in CVE-2020-13143, where adding
__attribute__((tainted_args)) to the "store" callback of
configfs_attribute:

  struct configfs_attribute {
    /* [...snip...] */
    ssize_t (*store)(struct config_item *, const char *, size_t)
      __attribute__((tainted_args));
    /* [...snip...] */
  };

allows the analyzer to see:

 CONFIGFS_ATTR(gadget_dev_desc_, UDC);

and treat gadget_dev_desc_UDC_store as having tainted arguments, so that
it complains:

taint-CVE-2020-13143-1.c: In function 'gadget_dev_desc_UDC_store':
taint-CVE-2020-13143-1.c:33:17: warning: use of attacker-controlled value
  'len + 18446744073709551615' as offset without upper-bounds checking [CWE-823] [-Wanalyzer-tainted-offset]
   33 |         if (name[len - 1] == '\n')
      |             ~~~~^~~~~~~~~

As before this currently still needs -fanalyzer-checker=taint (in
addition to -fanalyzer).

gcc/analyzer/ChangeLog:
	* engine.cc: Include "stringpool.h", "attribs.h", and
	"tree-dfa.h".
	(mark_params_as_tainted): New.
	(class tainted_args_function_custom_event): New.
	(class tainted_args_function_info): New.
	(exploded_graph::add_function_entry): Handle functions with
	"tainted_args" attribute.
	(class tainted_args_field_custom_event): New.
	(class tainted_args_callback_custom_event): New.
	(class tainted_args_call_info): New.
	(add_tainted_args_callback): New.
	(add_any_callbacks): New.
	(exploded_graph::build_initial_worklist): Likewise.
	(exploded_graph::build_initial_worklist): Find callbacks that are
	reachable from global initializers, calling add_any_callbacks on
	them.

gcc/c-family/ChangeLog:
	* c-attribs.c (c_common_attribute_table): Add "tainted_args".
	(handle_tainted_args_attribute): New.

gcc/ChangeLog:
	* doc/extend.texi (Function Attributes): Note that "tainted_args" can
	be used on field decls.
	(Common Function Attributes): Add entry on "tainted_args" attribute.

gcc/testsuite/ChangeLog:
	* gcc.dg/analyzer/attr-tainted_args-1.c: New test.
	* gcc.dg/analyzer/attr-tainted_args-misuses.c: New test.
	* gcc.dg/analyzer/taint-CVE-2011-2210-1.c: New test.
	* gcc.dg/analyzer/taint-CVE-2020-13143-1.c: New test.
	* gcc.dg/analyzer/taint-CVE-2020-13143-2.c: New test.
	* gcc.dg/analyzer/taint-CVE-2020-13143.h: New test.
	* gcc.dg/analyzer/taint-alloc-3.c: New test.
	* gcc.dg/analyzer/taint-alloc-4.c: New test.
	* gcc.dg/analyzer/test-uaccess.h: New test.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
2022-01-13 20:18:20 -05:00
GCC Administrator ad3f0d0806 Daily bump. 2022-01-14 00:16:30 +00:00
Jakub Jelinek a24ced4a95 toplevel: Remove incorrectly added file
2022-01-13  Jakub Jelinek  <jakub@redhat.com>

	* Makefile.am: Remove.
2022-01-13 22:31:19 +01:00
Anthony Sharp b8ffa71e42 c++: warning for dependent template members [PR70417]
Add a helpful warning message for when the user forgets to
include the "template" keyword after ., -> or :: when
accessing a member in a dependent context, where the member is a
template.

	PR c++/70417

gcc/c-family/ChangeLog:

	* c.opt: Added -Wmissing-template-keyword.

gcc/cp/ChangeLog:

	* parser.c (cp_parser_id_expression): Handle
	-Wmissing-template-keyword.
	(struct saved_token_sentinel): Add modes to control what happens
	on destruction.
	(cp_parser_statement): Adjust.
	(cp_parser_skip_entire_template_parameter_list): New function that
	skips an entire template parameter list.
	(cp_parser_require_end_of_template_parameter_list): Rename old
	cp_parser_skip_to_end_of_template_parameter_list.
	(cp_parser_skip_to_end_of_template_parameter_list): Refactor to be
	called from one of the above two functions.
	(cp_parser_lambda_declarator_opt)
	(cp_parser_explicit_template_declaration)
	(cp_parser_enclosed_template_argument_list): Adjust.

gcc/ChangeLog:

	* doc/invoke.texi: Documentation for Wmissing-template-keyword.

gcc/testsuite/ChangeLog:

	* g++.dg/cpp0x/variadic-mem_fn2.C: Catch warning about missing
	template keyword.
	* g++.dg/template/dependent-name17.C: New test.
	* g++.dg/template/dependent-name18.C: New test.

Co-authored-by: Jason Merrill <jason@redhat.com>
2022-01-13 16:01:52 -05:00
Uros Bizjak 7a7d8c3f61 i386: Introduce V2QImode vectorized shifts [PR103861]
Add V2QImode shift operations and split them to synthesized
double HI/LO QImode operations with integer registers.

Also robustify arithmetic split patterns.

2022-01-13  Uroš Bizjak  <ubizjak@gmail.com>

gcc/ChangeLog:

	PR target/103861
	* config/i386/i386.md (*ashlqi_ext<mode>_2): New insn pattern.
	(*<any_shiftrt:insn>qi_ext<mode>_2): Ditto.
	* config/i386/mmx.md (<any_shift:insn>v2qi):
	New insn_and_split pattern.

gcc/testsuite/ChangeLog:

	PR target/103861
	* gcc.target/i386/pr103861.c (shl,ashr,lshr): New tests.
2022-01-13 20:49:01 +01:00
Robin Dapp b0e5163960 vect: Add bias parameter for partial vectorization
This introduces a bias parameter for the len_load/len_store ifns as well as
optabs that is meant to distinguish between Power and s390 variants.
PowerPC's instructions require a bias of 0, while in s390's case
vll/vstl do not support lengths of zero bytes and a bias of -1 must be used.

gcc/ChangeLog:

	* internal-fn.c (expand_partial_load_optab_fn): Add bias.
	(expand_partial_store_optab_fn): Likewise.
	(internal_len_load_store_bias): New function.
	* internal-fn.h (VECT_PARTIAL_BIAS_UNSUPPORTED): New define.
	(internal_len_load_store_bias): New function.
	* tree-vect-loop-manip.c (vect_set_loop_controls_directly): Set bias.
	(vect_set_loop_condition_partial_vectors): Add header_seq parameter.
	* tree-vect-loop.c (vect_verify_loop_lens): Verify bias.
	(vect_estimate_min_profitable_iters): Account for bias.
	(vect_get_loop_len): Add bias-adjusted length.
	* tree-vect-stmts.c (vectorizable_store): Use.
	(vectorizable_load): Use.
	* tree-vectorizer.h (struct rgroup_controls): Add bias-adjusted length.
	(LOOP_VINFO_PARTIAL_LOAD_STORE_BIAS): New macro.
	* config/rs6000/vsx.md: Use const0 bias predicate.
	* doc/md.texi: Document bias value.
2022-01-13 20:05:18 +01:00
Hafiz Abid Qadeer 69561fc781 Add support for allocate clause (OpenMP 5.0).
This patch adds support for OpenMP 5.0 allocate clause for fortran. It does not
yet support the allocator-modifier as specified in OpenMP 5.1. The allocate
clause is already supported in C/C++.

gcc/fortran/ChangeLog:

	* dump-parse-tree.c (show_omp_clauses): Handle OMP_LIST_ALLOCATE.
	* gfortran.h (OMP_LIST_ALLOCATE): New enum value.
	* openmp.c (enum omp_mask1): Add OMP_CLAUSE_ALLOCATE.
	(gfc_match_omp_clauses): Handle OMP_CLAUSE_ALLOCATE
	(OMP_PARALLEL_CLAUSES, OMP_DO_CLAUSES, OMP_SECTIONS_CLAUSES)
	(OMP_TASK_CLAUSES, OMP_TASKLOOP_CLAUSES, OMP_TARGET_CLAUSES)
	(OMP_TEAMS_CLAUSES, OMP_DISTRIBUTE_CLAUSES)
	(OMP_SINGLE_CLAUSES): Add OMP_CLAUSE_ALLOCATE.
	(OMP_TASKGROUP_CLAUSES): New.
	(gfc_match_omp_taskgroup): Use OMP_TASKGROUP_CLAUSES instead of
	OMP_CLAUSE_TASK_REDUCTION.
	(resolve_omp_clauses): Handle OMP_LIST_ALLOCATE.
	(resolve_omp_do): Avoid warning when loop iteration variable is
	in allocate clause.
	* trans-openmp.c (gfc_trans_omp_clauses): Handle translation of
	allocate clause.
	(gfc_split_omp_clauses): Update for OMP_LIST_ALLOCATE.

gcc/testsuite/ChangeLog:

	* gfortran.dg/gomp/allocate-1.f90: New test.
	* gfortran.dg/gomp/allocate-2.f90: New test.
	* gfortran.dg/gomp/allocate-3.f90: New test.
	* gfortran.dg/gomp/collapse1.f90: Update error message.
	* gfortran.dg/gomp/openmp-simd-4.f90: Likewise.
	* gfortran.dg/gomp/clauses-1.f90: Uncomment allocate clause.

libgomp/ChangeLog:

	* testsuite/libgomp.fortran/allocate-1.c: New test.
	* testsuite/libgomp.fortran/allocate-1.f90: New test.
	* libgomp.texi: Remove string that says that allocate clause
	support is for C/C++ only.
2022-01-13 18:57:05 +00:00
Andrew MacLeod 49d5fb4fee Allow more precision when querying from fold_const.
fold_const::expr_not_equal_to queries for a current range, but still uses
the old value_range class.  This is causing it to miss opportunities when
ranger can provide something better.

	PR tree-optimization/83072
	PR tree-optimization/83073
	PR tree-optimization/97909
	gcc/
	* fold-const.c (expr_not_equal_to): Use a multi-range class.

	gcc/testsuite/
	* gcc.dg/pr83072-2.c: New.
	* gcc.dg/pr83073.c: New.
2022-01-13 13:51:30 -05:00
Andrew MacLeod 27e4260166 Add relation to unsigned right shift.
If the first operand and the shift value of a right shift operation are both
>= 0, then we know the LHS of the operation is <= the first operand.

	PR tree-optimization/96707
	gcc/
	* range-op.cc (operator_rshift::lhs_op1_relation): New.

	gcc/testsuite/
	* g++.dg/pr96707.C: New.
2022-01-13 13:51:30 -05:00
Harald Anlauf 0b8464365b Fortran: fix error recovery on bad structure constructor in DATA statement
gcc/fortran/ChangeLog:

	PR fortran/67804
	* primary.c (gfc_match_structure_constructor): Recover from errors
	that occurred while checking for a valid structure constructor in
	a DATA statement.

gcc/testsuite/ChangeLog:

	PR fortran/67804
	* gfortran.dg/pr93604.f90: Adjust to changed diagnostics.
	* gfortran.dg/pr67804.f90: New test.
2022-01-13 19:24:13 +01:00
Uros Bizjak 386b15d6ef i386: Cleanup V2QI arithmetic instructions
2022-01-13  Uroš Bizjak  <ubizjak@gmail.com>

gcc/ChangeLog:

	* config/i386/mmx.md (negv2qi): Disparage GPR alternative a bit.
	Disable for TARGET_PARTIAL_REG_STALL unless optimizing for size.
	(negv2qi splitters): Use lowpart_subreg instead of
	gen_lowpart to create subreg.
	(<plusminus:insn>v2qi3): Disparage GPR alternative a bit.
	Disable for TARGET_PARTIAL_REG_STALL unless optimizing for size.
	(<plusminus:insn>v2qi3 splitters): Use lowpart_subreg instead of
	gen_lowpart to create subreg.
	* config/i386/i386.md (*subqi_ext<mode>_2): Move.
2022-01-13 19:12:41 +01:00
Jakub Jelinek 70ba28304b libgfortran: Fix Solaris version file creation [PR104006]
I forgot to change the gfortran.map-sun goal to gfortran.ver-sun
when changing other spots for the preprocessed version file.

2022-01-13  Jakub Jelinek  <jakub@redhat.com>

	PR libfortran/104006
	* Makefile.am (gfortran.map-sun): Rename target to ...
	(gfortran.ver-sun): ... this.
	* Makefile.in: Regenerated.
2022-01-13 17:50:28 +01:00
Uros Bizjak 9d8e27fac3 ii386: Add 16-bit vector modes to xop_pcmov [PR104003]
2022-01-13  Uroš Bizjak  <ubizjak@gmail.com>

gcc/ChangeLog:

	PR target/104003
	* config/i386/mmx.md (*xop_pcmov_<mode>): Use VI_16_32 mode iterator.

gcc/testsuite/ChangeLog:

	PR target/104003
	* g++.target/i386/pr103861-1-sse4.C: New test.
	* g++.target/i386/pr103861-1-xop.C: Ditto.
2022-01-13 17:19:55 +01:00
Martin Liska c3782843ba Fix -Wformat-diag for ARM target.
gcc/ChangeLog:

	* common/config/arm/arm-common.c (arm_target_mode): Wrap
	keywords with %<, %> and remove trailing punctuation char.
	(arm_canon_arch_option_1): Likewise.
	(arm_asm_auto_mfpu): Likewise.
	* config/arm/arm-builtins.c (arm_expand_builtin): Likewise.
	* config/arm/arm.c (arm_options_perform_arch_sanity_checks): Likewise.
	(use_vfp_abi): Likewise.
	(aapcs_vfp_is_call_or_return_candidate): Likewise.
	(arm_handle_cmse_nonsecure_entry): Likewise.
	(arm_handle_cmse_nonsecure_call): Likewise.
	(thumb1_md_asm_adjust): Likewise.
2022-01-13 17:03:11 +01:00
Paul A. Clarke 5fce2e036f rs6000: Support SSE4.1 "round" intrinsics
Suppress exceptions (when specified), by saving, manipulating, and
restoring the FPSCR.  Similarly, save, set, and restore the floating-point
rounding mode when required.

No attempt is made to optimize writing the FPSCR (by checking if the new
value would be the same), other than using lighter weight instructions
when possible. Note that explicit instruction scheduling "barriers" are
added to prevent floating-point computations from being moved before or
after the explicit FPSCR manipulations.  (That these are required has
been reported as an issue in GCC: PR102783.)

The scalar versions naively use the parallel versions to compute the
single scalar result and then construct the remainder of the result.

Of minor note, the values of _MM_FROUND_TO_NEG_INF and _MM_FROUND_TO_ZERO
are swapped from the corresponding values on x86 so as to match the
corresponding rounding mode values in the Power ISA.

Move implementations of _mm_ceil* and _mm_floor* into _mm_round*, and
convert _mm_ceil* and _mm_floor* into macros. This matches the current
analogous implementations in config/i386/smmintrin.h.

Function signatures match the analogous functions in config/i386/smmintrin.h.

Add tests for _mm_round_pd, _mm_round_ps, _mm_round_sd, _mm_round_ss,
modeled after the very similar "floor" and "ceil" tests.

Include basic tests, plus tests at the boundaries for floating-point
representation, positive and negative, test all of the parameterized
rounding modes as well as the C99 rounding modes and interactions
between the two.

Exceptions are not explicitly tested.

2022-01-13  Paul A. Clarke  <pc@us.ibm.com>

gcc
	* config/rs6000/smmintrin.h (_mm_round_pd, _mm_round_ps,
	_mm_round_sd, _mm_round_ss, _MM_FROUND_TO_NEAREST_INT,
	_MM_FROUND_TO_ZERO, _MM_FROUND_TO_POS_INF, _MM_FROUND_TO_NEG_INF,
	_MM_FROUND_CUR_DIRECTION, _MM_FROUND_RAISE_EXC, _MM_FROUND_NO_EXC,
	_MM_FROUND_NINT, _MM_FROUND_FLOOR, _MM_FROUND_CEIL, _MM_FROUND_TRUNC,
	_MM_FROUND_RINT, _MM_FROUND_NEARBYINT): New.
	(_mm_ceil_pd, _mm_ceil_ps, _mm_ceil_sd, _mm_ceil_ss, _mm_floor_pd,
	_mm_floor_ps, _mm_floor_sd, _mm_floor_ss): Convert from function to
	macro.

gcc/testsuite
	* gcc.target/powerpc/sse4_1-round3.h: New.
	* gcc.target/powerpc/sse4_1-roundpd.c: New.
	* gcc.target/powerpc/sse4_1-roundps.c: New.
	* gcc.target/powerpc/sse4_1-roundsd.c: New.
	* gcc.target/powerpc/sse4_1-roundss.c: New.
2022-01-13 09:24:06 -06:00
Richard Biener f45a2232bc c/104002 - shufflevector variable indexing
Variable indexing of a __builtin_shufflevector result is broken because
we fail to properly mark the TARGET_EXPR decl as addressable.

2022-01-13  Richard Biener  <rguenther@suse.de>

	PR c/104002
gcc/c-family/
	* c-common.c (c_common_mark_addressable_vec): Handle TARGET_EXPR.

gcc/testsuite/
	* c-c++-common/builtin-shufflevector-3.c: Move ...
	* c-c++-common/torture/builtin-shufflevector-3.c: ... here.
2022-01-13 16:07:30 +01:00
Jakub Jelinek 53ead57879 inliner: Don't emit copy stmts for empty type parameters [PR103989]
The following patch avoids emitting a parameter copy statement when inlining
if the parameter has empty type.  E.g. the gimplifier does something similar
(except that it needs to evaluate side-effects if any, which isn't the case
here):
  /* For empty types only gimplify the left hand side and right hand
     side as statements and throw away the assignment.  Do this after
     gimplify_modify_expr_rhs so we handle TARGET_EXPRs of addressable
     types properly.  */
  if (is_empty_type (TREE_TYPE (*from_p))
      && !want_value
      /* Don't do this for calls that return addressable types, expand_call
         relies on those having a lhs.  */
      && !(TREE_ADDRESSABLE (TREE_TYPE (*from_p))
           && TREE_CODE (*from_p) == CALL_EXPR))
    {
      gimplify_stmt (from_p, pre_p);
      gimplify_stmt (to_p, pre_p);
      *expr_p = NULL_TREE;
      return GS_ALL_DONE;
    }
Unfortunately, this patch doesn't cure the uninit warnings in that PR,
which is caused by ipa inlining happening even at -Og when the post-IPA
-Og passes don't expect the need to clean up after ipa inlining,
but I think is desirable anyway.

2022-01-13  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/103989
	* tree-inline.c (setup_one_parameter): Don't copy parms with
	empty type.
2022-01-13 15:59:47 +01:00
Thomas Schwinge d97364aab1 Improve Intel MIC offloading XFAILing for 'omp_get_device_num'
After recent commit be661959a6
"libgomp/testsuite: Improve omp_get_device_num() tests", we're now iterating
over all OpenMP target devices.  Intel MIC (emulated) offloading still doesn't
properly implement device-side 'omp_get_device_num', and we thus regress:

    PASS: libgomp.c/../libgomp.c-c++-common/target-45.c (test for excess errors)
    [-PASS:-]{+FAIL:+} libgomp.c/../libgomp.c-c++-common/target-45.c execution test

    PASS: libgomp.c++/../libgomp.c-c++-common/target-45.c (test for excess errors)
    [-PASS:-]{+FAIL:+} libgomp.c++/../libgomp.c-c++-common/target-45.c execution test

    PASS: libgomp.fortran/target10.f90   -O0  (test for excess errors)
    [-PASS:-]{+FAIL:+} libgomp.fortran/target10.f90   -O0  execution test
    PASS: libgomp.fortran/target10.f90   -O1  (test for excess errors)
    [-PASS:-]{+FAIL:+} libgomp.fortran/target10.f90   -O1  execution test
    PASS: libgomp.fortran/target10.f90   -O2  (test for excess errors)
    [-PASS:-]{+FAIL:+} libgomp.fortran/target10.f90   -O2  execution test
    PASS: libgomp.fortran/target10.f90   -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions  (test for excess errors)
    [-PASS:-]{+FAIL:+} libgomp.fortran/target10.f90   -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions  execution test
    PASS: libgomp.fortran/target10.f90   -O3 -g  (test for excess errors)
    [-PASS:-]{+FAIL:+} libgomp.fortran/target10.f90   -O3 -g  execution test
    PASS: libgomp.fortran/target10.f90   -Os  (test for excess errors)
    [-PASS:-]{+FAIL:+} libgomp.fortran/target10.f90   -Os  execution test

Improve the XFAILing added in commit bb75b22aba
"Allow matching Intel MIC in OpenMP 'declare variant'" for the case that *any*
Intel MIC offload device is available.

	libgomp/
	* testsuite/libgomp.c-c++-common/on_device_arch.h
	(any_device_arch, any_device_arch_intel_mic): New.
	* testsuite/lib/libgomp.exp
	(check_effective_target_offload_device_any_intel_mic): New.
	* testsuite/libgomp.c-c++-common/target-45.c: Use it.
	* testsuite/libgomp.fortran/target10.f90: Likewise.
2022-01-13 13:09:36 +01:00
Thomas Schwinge 67fdcc8835 Merge 'c-c++-common/goacc/routine-6.c' into 'c-c++-common/goacc/routine-5.c', and document current C/C++ difference
gcc/testsuite/
	* c-c++-common/goacc/routine-6.c: Merge into...
	* c-c++-common/goacc/routine-5.c: ... this, and document current
	C/C++ difference.
2022-01-13 13:03:57 +01:00
Thomas Schwinge 2edbcaed95 Document current '-Wuninitialized' diagnostics for 'libgomp.oacc-fortran/routine-10.f90' [PR102192]
libgomp/
	PR tree-optimization/102192
	* testsuite/libgomp.oacc-fortran/routine-10.f90: Document current
	'-Wuninitialized' diagnostics.
2022-01-13 11:52:35 +01:00
Thomas Schwinge 4bd8b1e881 Document current '-Wuninitialized'/'-Wmaybe-uninitialized' diagnostics for OpenACC test cases
... including "note: '[...]' was declared here" emitted since recent
commit 9695e1c23b
"Improve -Wuninitialized note location".

For those that seemed incorrect to me, I've placed XFAILed 'dg-bogus'es,
including one more instance of PR77504 etc., and several instances where
for "local variables" of reference-data-type reductions (etc.?) we emit
bogus (?) diagnostics.

For implicit data clauses (including 'firstprivate'), we seem to be missing
diagnostics, so I've placed XFAILed 'dg-warning's.

	gcc/testsuite/
	* c-c++-common/goacc/builtin-goacc-parlevel-id-size.c: Document
	current '-Wuninitialized' diagnostics.
	* c-c++-common/goacc/mdc-1.c: Likewise.
	* c-c++-common/goacc/nested-reductions-1-kernels.c: Likewise.
	* c-c++-common/goacc/nested-reductions-1-parallel.c: Likewise.
	* c-c++-common/goacc/nested-reductions-1-routine.c: Likewise.
	* c-c++-common/goacc/nested-reductions-2-kernels.c: Likewise.
	* c-c++-common/goacc/nested-reductions-2-parallel.c: Likewise.
	* c-c++-common/goacc/nested-reductions-2-routine.c: Likewise.
	* c-c++-common/goacc/uninit-dim-clause.c: Likewise.
	* c-c++-common/goacc/uninit-firstprivate-clause.c: Likewise.
	* c-c++-common/goacc/uninit-if-clause.c: Likewise.
	* gfortran.dg/goacc/array-with-dt-1.f90: Likewise.
	* gfortran.dg/goacc/array-with-dt-2.f90: Likewise.
	* gfortran.dg/goacc/array-with-dt-3.f90: Likewise.
	* gfortran.dg/goacc/array-with-dt-4.f90: Likewise.
	* gfortran.dg/goacc/array-with-dt-5.f90: Likewise.
	* gfortran.dg/goacc/derived-chartypes-1.f90: Likewise.
	* gfortran.dg/goacc/derived-chartypes-2.f90: Likewise.
	* gfortran.dg/goacc/derived-chartypes-3.f90: Likewise.
	* gfortran.dg/goacc/derived-chartypes-4.f90: Likewise.
	* gfortran.dg/goacc/derived-classtypes-1.f95: Likewise.
	* gfortran.dg/goacc/derived-types-2.f90: Likewise.
	* gfortran.dg/goacc/host_data-tree.f95: Likewise.
	* gfortran.dg/goacc/kernels-tree.f95: Likewise.
	* gfortran.dg/goacc/modules.f95: Likewise.
	* gfortran.dg/goacc/nested-reductions-1-kernels.f90: Likewise.
	* gfortran.dg/goacc/nested-reductions-1-parallel.f90: Likewise.
	* gfortran.dg/goacc/nested-reductions-1-routine.f90: Likewise.
	* gfortran.dg/goacc/nested-reductions-2-kernels.f90: Likewise.
	* gfortran.dg/goacc/nested-reductions-2-parallel.f90: Likewise.
	* gfortran.dg/goacc/nested-reductions-2-routine.f90: Likewise.
	* gfortran.dg/goacc/parallel-tree.f95: Likewise.
	* gfortran.dg/goacc/pr93464.f90: Likewise.
	* gfortran.dg/goacc/privatization-1-compute-loop.f90: Likewise.
	* gfortran.dg/goacc/privatization-1-compute.f90: Likewise.
	* gfortran.dg/goacc/privatization-1-routine_gang-loop.f90:
	Likewise.
	* gfortran.dg/goacc/privatization-1-routine_gang.f90: Likewise.
	* gfortran.dg/goacc/uninit-dim-clause.f95: Likewise.
	* gfortran.dg/goacc/uninit-firstprivate-clause.f95: Likewise.
	* gfortran.dg/goacc/uninit-if-clause.f95: Likewise.
	* gfortran.dg/goacc/uninit-use-device-clause.f95: Likewise.
	* gfortran.dg/goacc/wait.f90: Likewise.
	libgomp/
	* testsuite/libgomp.oacc-c-c++-common/vred2d-128.c: Document
	current '-Wuninitialized' diagnostics.
	* testsuite/libgomp.oacc-fortran/data-5.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/gemm-2.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/gemm.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/optional-reduction.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/parallel-reduction.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/pr70643.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/pr96628-part1.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/privatized-ref-2.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/reduction-5.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/reduction-7.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/reference-reductions.f90:
	Likewise.
2022-01-13 11:52:35 +01:00
Martin Liska db0d23722e Simplify git-backport.py script.
It's very unlikely that somebody is going to backport a revision
that is > 14 months old to a release branch.

contrib/ChangeLog:

	* git-backport.py: Simplify the script as pre-auto-ChangeLog era
	is 14 months old.
2022-01-13 11:49:36 +01:00
Thomas Schwinge 9fcc3a1dd2 Host and offload targets have no common meaning of address spaces
gcc/
	* tree-streamer-out.c (pack_ts_base_value_fields): Don't pack
	'TYPE_ADDR_SPACE' for offloading.
	* tree-streamer-in.c (unpack_ts_base_value_fields): Don't unpack
	'TYPE_ADDR_SPACE' for offloading.
	libgomp/
	* testsuite/libgomp.c/address-space-1.c: Remove 'dg-xfail-run-if'
	for 'offload_device_intel_mic'.
2022-01-13 11:16:20 +01:00
Julian Brown e52253bcc0 Wait at end of OpenACC asynchronous kernels regions
In OpenACC 'kernels' decomposition, we're improperly nesting synchronous and
asynchronous data and compute regions, giving rise to data races when the
asynchronicity is actually executed, as is visible in at least on test case
with GCN offloading.

The proper fix is to correctly use the asynchronous interfaces, making the
currently synchronous data regions fully asynchronous (see also
<https://gcc.gnu.org/PR97390> "[OpenACC] 'async' clause on 'data' construct",
which is to share the same implementation), but that's for later; for now add
some more synchronization.

	gcc/
	* omp-oacc-kernels-decompose.cc (add_wait): New function, split out
	of...
	(add_async_clauses_and_wait): ...here. Call new outlined function.
	(decompose_kernels_region_body): Add wait at the end of
	explicitly-asynchronous kernels regions.
	libgomp/
	* testsuite/libgomp.oacc-c-c++-common/f-asyncwait-1.c: Remove GCN
	offloading execution XFAIL.

Co-Authored-By: Thomas Schwinge <thomas@codesourcery.com>
2022-01-13 10:42:17 +01:00
Thomas Schwinge 9b32c1669a OpenACC 'kernels' decomposition: Mark variables used in synthesized data clauses as addressable [PR100280]
... as otherwise 'gcc/omp-low.c:lower_omp_target' has to create a temporary:

    13073			else if (is_gimple_reg (var))
    13074			  {
    13075			    gcc_assert (offloaded);
    13076			    tree avar = create_tmp_var (TREE_TYPE (var));
    13077			    mark_addressable (avar);

..., which (a) is only implemented for actualy *offloaded* regions (but not
data regions), and (b) the subsequently synthesized code for writing to and
later reading back from the temporary fundamentally conflicts with OpenACC
'async' (as used by OpenACC 'kernels' decomposition).  That's all not trivial
to make work, so let's just avoid this case.

	gcc/
	PR middle-end/100280
	* omp-oacc-kernels-decompose.cc (maybe_build_inner_data_region):
	Mark variables used in synthesized data clauses as addressable.
	gcc/testsuite/
	PR middle-end/100280
	* c-c++-common/goacc/kernels-decompose-pr100280-1.c: New.
	* c-c++-common/goacc/classify-kernels-parloops.c: Likewise.
	* c-c++-common/goacc/classify-kernels-unparallelized-parloops.c:
	Likewise.
	* c-c++-common/goacc/classify-kernels-unparallelized.c: Test
	'--param openacc-kernels=decompose'.
	* c-c++-common/goacc/classify-kernels.c: Likewise.
	* c-c++-common/goacc/kernels-decompose-2.c: Update.
	* c-c++-common/goacc/kernels-decompose-ice-1.c: Remove.
	* c-c++-common/goacc/kernels-decompose-ice-2.c: Likewise.
	* gfortran.dg/goacc/classify-kernels-parloops.f95: New.
	* gfortran.dg/goacc/classify-kernels-unparallelized-parloops.f95:
	Likewise.
	* gfortran.dg/goacc/classify-kernels-unparallelized.f95: Test
	'--param openacc-kernels=decompose'.
	* gfortran.dg/goacc/classify-kernels.f95: Likewise.
	libgomp/
	PR middle-end/100280
	* testsuite/libgomp.oacc-c-c++-common/declare-vla-kernels-decompose-ice-1.c:
	Update.
	* testsuite/libgomp.oacc-c-c++-common/f-asyncwait-1.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/kernels-decompose-1.c:
	Likewise.

Suggested-by: Julian Brown <julian@codesourcery.com>
2022-01-13 10:42:17 +01:00
Thomas Schwinge 862e5f398b Enhance OpenACC 'kernels' decomposition testing
gcc/testsuite/
	* c-c++-common/goacc/kernels-decompose-1.c: Enhance.
	* c-c++-common/goacc/kernels-decompose-2.c: Likewise.
	* c-c++-common/goacc/kernels-decompose-ice-1.c: Likewise.
	* c-c++-common/goacc/kernels-decompose-ice-2.c: Likewise.
	* gfortran.dg/goacc/kernels-decompose-1.f95: Likewise.
	* gfortran.dg/goacc/kernels-decompose-2.f95: Likewise.
	libgomp/
	* testsuite/libgomp.oacc-c-c++-common/declare-vla-kernels-decompose-ice-1.c:
	Enhance.
	* testsuite/libgomp.oacc-c-c++-common/declare-vla-kernels-decompose.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/declare-vla.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/f-asyncwait-1.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/f-asyncwait-2.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/f-asyncwait-3.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/kernels-decompose-1.c:
	Likewise.
	* testsuite/libgomp.oacc-fortran/asyncwait-1.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/asyncwait-2.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/asyncwait-3.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/pr94358-1.f90: Likewise.
2022-01-13 10:42:17 +01:00
Martin Liska ff496134a9 epiphany: fix -Wimplicit-fallthrough warnings in epiphany.c.
gcc/ChangeLog:

	* config/epiphany/epiphany.c (epiphany_mode_priority):
	Use gcc_unreachable for not handled cases.
2022-01-13 10:35:03 +01:00
Martin Liska ed8b9b4f5b epiphany: fir -Wformat-diag.
gcc/ChangeLog:

	* config/epiphany/epiphany.c (epiphany_handle_interrupt_attribute):
	Use %qs format specifier.
	(epiphany_override_options): Wrap keyword in %<, %>.
2022-01-13 10:34:58 +01:00
Haochen Jiang 5f19303ada Optimize a ^ ((a ^ b) & mask) to (~mask & a) | (b & mask).
From the perspective of the pipeline, `andn + and + ior` version take
2 cycles(AND and ANDN doesn't have dependence), but xor + and + xor
will take 3 cycles.

-       xorl    %edi, %esi
        andl    %edx, %esi
-       movl    %esi, %eax
-       xorl    %edi, %eax
+       andn    %edi, %edx, %eax
+       orl     %esi, %eax

gcc/ChangeLog:

	PR target/94790
	* config/i386/i386.md (*xor2andn): New define_insn_and_split.

gcc/testsuite/ChangeLog:

	PR target/94790
	* gcc.target/i386/pr94790-1.c: New test.
	* gcc.target/i386/pr94790-2.c: Ditto.
2022-01-13 13:03:11 +08:00
Xionghu Luo 080a06fcb0 rs6000: Add split pattern to replace
7: r120:V4SI=const_vector
8: r121:V4SI=unspec[r120:V4SI,r120:V4SI,0xc] 260

with r121:v4SI = r120:V4SI when r120 is a vector with same element.

gcc/ChangeLog:

	* config/rs6000/altivec.md (sldoi_to_mov<mode>): New.

gcc/testsuite/ChangeLog:

	* gcc.target/powerpc/sldoi_to_mov.c: New test.
2022-01-12 18:36:54 -06:00
GCC Administrator 02a8a01bf3 Daily bump. 2022-01-13 00:16:21 +00:00
Uros Bizjak cb46559cea testsuite: Compile gcc.target/i386/pr103861-3.c with -fno-vect-cost-model [PR103941]
2022-01-12  Uroš Bizjak  <ubizjak@gmail.com>

gcc/testsuite/ChangeLog:

	PR target/103941
	* gcc.target/i386/pr103861-3.c (dg-options): Add -fno-vect-cost-model.
2022-01-12 20:57:12 +01:00
Uros Bizjak e1503b9a3d testsuite: Compile g++.dg/vect/slp-pr98855.cc only for x86 targets [PR103935]
The testcase is x86 specific, other targets have different costs defined.

2022-01-12  Uroš Bizjak  <ubizjak@gmail.com>

gcc/testsuite/ChangeLog:

	PR target/103935
	* g++.dg/vect/slp-pr98855.cc: Compile only for x86 targets.
2022-01-12 20:38:42 +01:00
Uros Bizjak b5193e3529 i386: Add CC clobber and splits for 32-bit vector mode logic insns [PR100673, PR103861]
Add CC clobber to 32-bit vector mode logic insns to allow variants with
general-purpose registers.  Also improve ix86_sse_movcc to emit insn with
CC clobber for narrow vector modes in order to re-enable conditional moves
for 16-bit and 32-bit narrow vector modes with -msse2.

2022-01-12  Uroš Bizjak  <ubizjak@gmail.com>

gcc/ChangeLog:

	PR target/100637
	PR target/103861
	* config/i386/i386-expand.c (ix86_emit_vec_binop): New static function.
	(ix86_expand_sse_movcc): Use ix86_emit_vec_binop instead of gen_rtx_X
	when constructing vector logic RTXes.
	(expand_vec_perm_pshufb2): Ditto.
	* config/i386/mmx.md (negv2qi): Disparage GPR alternative a bit.
	(<plusminus:insn>v2qi3): Ditto.
	(vcond<mode><mode>): Re-enable for TARGET_SSE2.
	(vcondu<mode><mode>): Ditto.
	(vcond_mask_<mode><mode>): Ditto.
	(one_cmpl<VI_32:mode>2): Remove expander.
	(one_cmpl<VI_16_32:mode>2): Rename from one_cmplv2qi.
	Use VI_16_32 mode iterator.
	(one_cmpl<VI_16_32:mode>2 splitters): Use VI_16_32 mode iterator.
	Use lowpart_subreg instead of gen_lowpart to create subreg.
	(*andnot<VI_16_32:mode>3): Merge from "*andnot<VI_32:mode>" and
	"*andnotv2qi3" insn patterns using VI_16_32 mode iterator.
	Disparage GPR alternative a bit.  Add CC clobber.
	(*andnot<VI_16_32:mode>3 splitters): Use VI_16_32 mode iterator.
	Use lowpart_subreg instead of gen_lowpart to create subreg.
	(*<any_logic:code><VI_16_32:mode>3): Merge from
	"*<any_logic:code><VI_32:mode>" and "*<any_logic:code>v2qi3" insn patterns
	using VI_16_32 mode iterator.  Disparage GPR alternative a bit.
	Add CC clobber.
	(*<any_logic:code><VI_16_32:mode>3 splitters):Use VI_16_32 mode
	iterator.  Use lowpart_subreg instead of gen_lowpart to create subreg.

gcc/testsuite/ChangeLog:

	PR target/100637
	PR target/103861
	* g++.target/i386/pr100637-1b.C (dg-options):
	Use -msse2 instead of -msse4.1.
	* g++.target/i386/pr100637-1w.C (dg-options): Ditto.
	* g++.target/i386/pr103861-1.C (dg-options): Ditto.
	* gcc.target/i386/pr100637-4b.c (dg-options): Ditto.
	* gcc.target/i386/pr103861-4.c (dg-options): Ditto.
	* gcc.target/i386/pr100637-1b.c: Remove scan-assembler
	directives for logic instructions.
	* gcc.target/i386/pr100637-1w.c: Ditto.
	* gcc.target/i386/warn-vect-op-2.c:
	Update dg-warning for vector logic operation.
2022-01-12 20:03:16 +01:00
Michael Meissner 18d88d1197 Fix pr101384-1.c code generation test.
Add support for the compiler using XXSPLTIB reg,255 to load all 1's into a
register on power9 and above instead of using VSPLTI{B,H,W} reg,-1.

gcc/testsuite/
2022-01-12  Michael Meissner  <meissner@the-meissners.org>

	PR testsuite/102935
	* gcc.target/powerpc/pr101384-1.c: Update insn regexp for power9
	and power10.
2022-01-12 11:56:22 -05:00
Patrick Palka acc38526f6 libstdc++: Add explicit dg-do directive to .../103955.cc
libstdc++-v3/ChangeLog:

	* testsuite/20_util/to_chars/103955.cc: Add explicit dg-do
	directive.
2022-01-12 11:39:48 -05:00
Clément Chigot 14e0d83297 aix: handle 64bit inodes for include directories
On AIX, stat will store inodes in 32bit even when using LARGE_FILES.
If the inode is larger, it will return -1 in st_ino.
Thus, in incpath.c when comparing include directories, if several
of them have 64bit inodes, they will be considered as duplicated.

gcc/ChangeLog:
2022-01-12  Clément Chigot  <clement.chigot@atos.net>

	* configure.ac: Check sizeof ino_t and dev_t.
	(HOST_STAT_FOR_64BIT_INODES): New AC_DEFINE to provide stat
	syscall being able to handle 64bit inodes.
	* config.in: Regenerate.
	* configure: Regenerate.
	* incpath.c (HOST_STAT_FOR_64BIT_INODES): New define.
	(remove_duplicates): Use it.

libcpp/ChangeLog:
2022-01-12  Clément Chigot  <clement.chigot@atos.net>

	* configure.ac: Check sizeof ino_t and dev_t.
	* config.in: Regenerate.
	* configure: Regenerate.
	* include/cpplib.h (INO_T_CPP): Change for AIX.
	(DEV_T_CPP): New macro.
	(struct cpp_dir): Use it.
2022-01-12 16:59:47 +01:00
Andrew MacLeod 75845d584f Add testcase for PR 83541.
Ranger now performs this optimzation.

	PR tree-optimization/83541
	gcc/testsuite
	* g++.dg/pr83541.C: New.
2022-01-12 10:28:16 -05:00
Andrew MacLeod 77184b7446 Always set EDGE_EXECUTABLE in VRP2.
PR tree-optimization/103551
	* tree-vrp.c (execute_ranger_vrp): Always set EDGE_EXECUTABLE.
2022-01-12 10:28:16 -05:00
Richard Biener 2f62294dec tree-optimization/103990 - fix CFG cleanup regression from PRE change
This adjusts the CFG cleanup flow back to what it was before the
last change which fixes the observed regression of 541.leela_r with
LTO and FDO.

2022-01-12  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/103990
	* tree-pass.h (tail_merge_optimize): Drop unused argument.
	* tree-ssa-tail-merge.c (tail_merge_optimize): Likewise.
	* tree-ssa-pre.c (pass_pre::execute): Retain TODO_cleanup_cfg
	and adjust call to tail_merge_optimize.
2022-01-12 16:18:20 +01:00