187635 Commits

Author SHA1 Message Date
John David Anglin
a6fe949d57 Fix libgfortran build on hppa*-hp-hpux[01]*
Add include hack to define PRIdPTR, PRIiPTR, PRIoPTR, PRIuPTR, PRIxPTR
and PRIXPTR in inttypes.h.

2021-08-30  John David Anglin  <danglin@gcc.gnu.org>

fixincludes/ChangeLog:
	* inclhack.def (hpux_c99_inttypes5): New hack to define PRIdPTR, etc.
	* fixincl.x: Regenerate.
	* tests/base/inttypes.h: Update.
2021-08-30 19:31:40 +00:00
Joseph Myers
42ade7bdc1 Update gcc sv.po.
* sv.po: Update.
2021-08-30 19:10:08 +00:00
Pat Haugen
d73c44800b Enable store fusion on Power10.
gcc/ChangeLog:

	* config/rs6000/rs6000-cpus.def (ISA_3_1_MASKS_SERVER): Add
	OPTION_MASK_P10_FUSION_2STORE.
	(POWERPC_MASKS): Likewise.
	* config/rs6000/rs6000.c (rs6000_option_override_internal): Enable
	store fusion for Power10.
	(is_fusable_store): New.
	(power10_sched_reorder): Likewise.
	(rs6000_sched_reorder): Do Power10 specific reordering.
	(rs6000_sched_reorder2): Likewise.
	* config/rs6000/rs6000.opt: Add new option.

gcc/testsuite/ChangeLog:

	* gcc.target/powerpc/fusion-p10-stst.c: New test.
	* gcc.target/powerpc/fusion-p10-stst2.c: New test.
2021-08-30 10:58:21 -05:00
Iain Buclaw
02dbf5d127 libphobos: Compile configure tests with -fno-druntime
libphobos/ChangeLog:

	* configure: Regenerate.
	* m4/autoconf.m4 (AC_LANG_PROGRAM): Declare module name 'object'.
	* m4/gcc_support.m4 (WITH_LOCAL_DRUNTIME): Compile tests with
	-fno-druntime.
2021-08-30 16:42:30 +02:00
Richard Biener
89f33f44ad tree-optimization/102128 - rework if-converted BB vect heuristic
This reworks the previous attempt to avoid leaving around if-converted
scalar code in BB vectorized loop bodies to keep costing independent
subgraphs which should address the observed regression with 519.lbm_r.

For this to work we now first cost all subgraphs and only after
doing that proceed to emit vectorized code.

2021-08-30  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/102128
	* tree-vect-slp.c (vect_bb_vectorization_profitable_p):
	Move scanning for if-converted scalar code to the caller
	and instead delay clearing the visited flag for profitable
	subgraphs.
	(vect_slp_region): Cost all subgraphs before scheduling.
	For if-converted BB vectorization scan for scalar COND_EXPRs
	and do not vectorize if any found and the cost model is
	very-cheap.
2021-08-30 14:03:56 +02:00
Richard Biener
1313111fde Make sure -fexceptions is enabled when -fnon-call-exceptions is
This makes -fexceptions enabled by -fnon-call-exceptions, removing
the odd state of !flag_exceptions && flag_non_call_exceptions from
middle-end consideration.

2021-08-30  Richard Biener  <rguenther@suse.de>

	* common.opt (fexceptions): Mark
	EnabledBy(fnon-call-exceptions).
	* doc/invoke.texi (fnon-call-exceptions): Document this
	enables -fexceptions.
2021-08-30 14:03:56 +02:00
Sebastian Huber
caf81d3b57 Use __builtin_trap() for abort() if inhibit_libc
abort() is used in gcc_assert() and gcc_unreachable() which is used by target
libraries such as libgcov.a.  This patch changes the abort() definition under
certain conditions.  If inhibit_libc is defined and abort is not already
defined, then abort() is defined to __builtin_trap().

The inhibit_libc define is usually defined if GCC is built for targets running
in embedded systems which may optionally use a C standard library.  If
inhibit_libc is defined, then there may be still a full featured abort()
available.  abort() is a heavy weight function which depends on signals and
file streams.  For statically linked applications, this means that a dependency
on gcc_assert() pulls in the support for signals and file streams.  This could
prevent using gcov to test low end targets for example.  Using __builtin_trap()
avoids these dependencies if the target implements a "trap" instruction.  The
application or operating system could use a trap handler to react to failed GCC
runtime checks which caused a trap.

gcc/

	* tsystem.h (abort): Define abort() if inhibit_libc is defined and it
	is not already defined.
2021-08-30 10:37:17 +02:00
YunQiang Su
d7e56b084d libffi: Fix MIPS r6 support
for some instructions, MIPS r6 uses different encoding other than
the previous releases.

1. mips/n32.S disable .set mips4: since it casuses old insn encoding
   is used.
   https://github.com/libffi/libffi/pull/396 has been accepted as:
     94c102aa69b04337f63498e0e6551fcdce549ae5
2. mips/ffi.c: the encoding for JR is hardcoded: we need to use
   different value for r6 and pre-r6.
   https://github.com/libffi/libffi/pull/401 has been accpeted as:
     746dbe3a6a79a41931c03b51df2972be4d5e5028

libffi/
	PR libffi/83636
	* src/mips/n32.S: disable .set mips4
	* src/mips/ffi.c: use different JR encoding for r6.
2021-08-30 16:03:59 +08:00
liuhongt
7218c2ec36 Make sure we're playing with integral modes before call extract_integral_bit_field.
gcc/ChangeLog:

	* expmed.c (extract_bit_field_1): Make sure we're playing with
	integral modes before call extract_integral_bit_field.
	(extract_integral_bit_field): Add a parameter of type
	scalar_int_mode which corresponds to of tmode.
	And call extract_and_convert_fixed_bit_field instead of
	extract_fixed_bit_field and convert_extracted_bit_field.
	(extract_and_convert_fixed_bit_field): New function, it's a
	combination of extract_fixed_bit_field and
	convert_extracted_bit_field.
2021-08-30 09:06:36 +08:00
GCC Administrator
1e77fd4f17 Daily bump. 2021-08-30 00:16:44 +00:00
Iain Buclaw
392e141079 libiberty: Add support for demangling local D template declarations
The D language now allows multiple different template declarations in
the same function that have the same mangled name.  To make the mangled
names unique, a fake parent in the form `__Sddd' is added to the symbol.
This information is not important for the user, so the demangler now
handles and ignores it.

libiberty/ChangeLog:

	* d-demangle.c (dlang_identifier): Skip over fake parent manglings.
	* testsuite/d-demangle-expected: Add tests.
2021-08-30 01:14:18 +02:00
Iain Buclaw
34f3e0657a libiberty: Add support for demangling D function literals as template value parameters
The D language now allows instantiating templates using struct literals
that have function literal fields as a value argument.

libiberty/ChangeLog:

	* d-demangle.c (dlang_parse_arrayliteral): Add 'info' parameter.
	(dlang_parse_assocarray): Likewise.
	(dlang_parse_structlit): Likewise.
	(dlang_value): Likewise.  Handle function literal symbols.
	(dlang_template_args): Pass 'info' to dlang_value.
	* testsuite/d-demangle-expected: Add new test.
2021-08-30 01:14:18 +02:00
Iain Buclaw
0e32a5aa8b libiberty: Add support for D `typeof(*null)' types
The D language has a new bottom type `typeof(*null)'.  Null types were
also incorrectly being demangled as `none', this has been fixed to be
`typeof(null)'.

libiberty/ChangeLog:

	* d-demangle.c (dlang_attributes): Handle typeof(*null).
	(dlang_type): Likewise.  Demangle 'n' as typeof(null).
	* testsuite/d-demangle-expected: Update tests.
2021-08-30 01:14:18 +02:00
Iain Sandoe
c3c669ac81 Darwin: Fixes for darwin_libc_has_function.
Firstly, the checks for availability need not be run for any
currently supported Darwin version (or for any version of
Darwin on x86).  In fact, the only test that is needed that
differs from the default is for the availbaility of sincos.
Test that and then fall back to the default implementation.

Secondly, the funtion appears to be called from the Jit library
before the value of darwin_macosx_version_min has been set up -
at present we work around this by guarding the checks on having
a non-null pointer for darwin_macosx_version_min.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>

gcc/ChangeLog:

	* config/darwin.c (darwin_libc_has_function): Do not run
	the checks for x86 or modern Darwin.  Make sure that there
	is a value set for darwin_macosx_version_min before testing.
2021-08-29 20:51:29 +01:00
Iain Buclaw
766f5f8726 d: Call the assertp and boundsp variants for assert and array contract failures.
gcc/d/ChangeLog:

	* d-codegen.cc: Include dmd/module.h.
	(build_filename_from_loc): New function.
	(d_assert_call): Rename to...
	(build_assert_call): ...this.
	(build_array_bounds_call): Call arrayboundsp variant of the array
	bounds failure callback.
	(build_bounds_condition): Rename to...
	(build_bounds_index_condition): ...this.  Update signature.
	(build_bounds_slice_condition): New function.
	(checkaction_trap_p): New function.
	(d_assert_call): Call assertp variant of assert failure callback.
	* d-tree.h (class IndexExp): Declare.
	(class SliceExp): Declare.
	(build_bounds_condition): Remove.
	(build_assert_call): Declare.
	(build_bounds_index_condition): Declare.
	(build_bounds_slice_condition): Declare.
	(checkaction_trap_p): Declare.
	(d_assert_call): Remove.
	* expr.cc (ExprVisitor::visit(IndexExp *)): Call
	build_bounds_index_condition.
	(ExprVisitor::visit(SliceExp *)): Call build_bounds_slice_condition.
	(ExprVisitor::visit(AssertExp *)): Update setting of libcall.
	* runtime.cc (enum d_libcall_type): Add LCT_IMMUTABLE_CHARPTR.
	(get_libcall_type): Handle LCT_IMMUTABLE_CHARPTR.
	* runtime.def (ASSERT): Rename to...
	(ASSERTP): ...this.  Update signature.
	(UNITTEST): Rename to...
	(UNITTESTP): ...this.  Update signature.
	(ARRAY_BOUNDS): Rename to...
	(ARRAYBOUNDSP): ...this.  Updates signature.
	* toir.cc (IRVisitor::visit(SwitchErrorStatement *)): Update call.
2021-08-29 17:19:03 +02:00
Iain Buclaw
118a559df9 d: Update comment for TypeInfoVisitor::layout_base
gcc/d/ChangeLog:

	* typeinfo.cc (class TypeInfoVisitor::layout_base): Update comment.
2021-08-29 17:19:02 +02:00
Iain Buclaw
2b8543a8ce d: Use int to store class and struct flags
gcc/d/ChangeLog:

	* typeinfo.cc (TypeInfoVisitor::visit(TypeInfoClassDeclaration *)):
	Use int to store type flags.
	(TypeInfoVisitor::visit(TypeInfoStructDeclaration *)): Likewise.
2021-08-29 17:19:02 +02:00
Iain Buclaw
0abfd7f4f4 d: Get __c_wchar_t type from build_frontend_type
gcc/d/ChangeLog:

	* types.cc (TypeVisitor::visit(TypeEnum*)): Get wchar_t type from
	build_frontend_type.
2021-08-29 17:19:02 +02:00
Iain Buclaw
ce15a3e757 d: Convert convert_for_rvalue switch statement into if condition
gcc/d/ChangeLog:

	* d-convert.cc (convert_for_rvalue): Convert switch statement into if
	condition.
2021-08-29 17:19:02 +02:00
Iain Buclaw
1925e514b4 d: Use POINTER_SIZE for testing whether to predefine D_LP64
gcc/d/ChangeLog:

	* d-builtins.cc (d_init_versions): Use POINTER_SIZE for testing
	whether to predefine D_LP64.
2021-08-29 17:19:02 +02:00
Iain Buclaw
07984707be d: ICE in gimple_register_canonical_type_1, at lto/lto-common.c:430 (PR102094)
User defined types have the TYPE_CXX_ODR_P flag set, but closure frames
did not.  This mismatch led to an ICE in the conflict detection for ODR
and interoperable non-ODR types.  As a given closure frame is tied
explicitly to a function, it already conforms to ODR.

	PR d/102094

gcc/d/ChangeLog:

	* d-codegen.cc (build_frame_type): Set TYPE_CXX_ODR_P.

gcc/testsuite/ChangeLog:

	* gdc.dg/lto/pr102094_0.d: New test.
2021-08-29 17:19:02 +02:00
Iain Sandoe
dc033e0149 testsuite, Darwin : Skip a test requiring strndup in libc.
Before Darwin11 there is no strndup in libc. This test fails with
warning output because of that - so skip it on these versions (since
they are not able to use strndup anyway).

gcc/testsuite/ChangeLog:

	* gcc.dg/analyzer/strndup-1.c: Skip for Darwin versions
	without strndup support in libc.
2021-08-29 07:53:18 +01:00
Iain Sandoe
fc3e9f58ec Darwin, X86 : Implement __cache_clear.
We had a NOP cache clear, but there is a suitable mechanism provided
by a system call.  This connects it up.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>

gcc/ChangeLog:

	* config/i386/darwin.h (CLEAR_INSN_CACHE): New.
2021-08-29 07:50:52 +01:00
GCC Administrator
a21e5de421 Daily bump. 2021-08-29 00:16:41 +00:00
Jan Hubicka
f5ff3a8ed4 Improve handling of table overflows in modref_ref_node
gcc/ChangeLog:

	* ipa-modref-tree.h (modref_access_node::merge): Break out
	logic combining offsets and logic merging ranges to ...
	(modref_access_node::combined_offsets): ... here
	(modref_access_node::update2): ... here
	(modref_access_node::closer_pair_p): New member function.
	(modref_access_node::forced_merge): New member function.
	(modre_ref_node::insert): Do merging when table is full.

gcc/testsuite/ChangeLog:

	* gcc.dg/tree-ssa/modref-9.c: New test.
2021-08-28 20:57:08 +02:00
Harald Anlauf
f9809ef570 Fortran - reject function entries with mismatched characteristics
gcc/fortran/ChangeLog:

	PR fortran/87737
	* resolve.c (resolve_entries): For functions of type CHARACTER
	tighten the checks for matching characteristics.

gcc/testsuite/ChangeLog:

	PR fortran/87737
	* gfortran.dg/entry_24.f90: New test.
2021-08-28 20:09:44 +02:00
Jonathan Wakely
754fca77e8 libstdc++: Fix std::allocator<void> for versioned namespace
Removing the allocator<void> specialization for the versioned namespace
breaks _Extptr_allocator<void> because the allocator<void>
specialization was still declared in <bits/memoryfwd.h>, making it an
incomplete type.  It wrong to remove that specialization anyway, because
it is still needed pre-C++20.

This removes the #if ! _GLIBCXX_INLINE_VERSION check, so that
allocator<void> is still explicitly specialized for the versioned
namespace, consistent with the normal unversioned namespace mode.

To make _Extptr_allocator<void> usable as a ProtoAllocator, this change
adds a default constructor and converting constructor. That is
consistent with std::allocator<void> since C++20 (and harmless to do for
earlier standards).

I'm also explicitly specializing allocator_traits<allocator<void>> so
that it doesn't need to use allocator<void>::construct and destroy.
Doing that allows those members to be removed, further simplifying
allocator<void>.  That new explicit specialization can delete the
allocate, deallocate and max_size members, which are always ill-formed
for allocator<void>.

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>

libstdc++-v3/ChangeLog:

	* include/bits/alloc_traits.h (allocator_traits): Add explicit
	specialization for allocator<void>. Improve doxygen comments.
	* include/bits/allocator.h (allocator<void>): Restore for the
	versioned namespace.
	(allocator<void>::construct, allocator<void>::destroy): Remove.
	* include/ext/extptr_allocator.h (_Extptr_allocator<void>):
	Add default constructor and converting constructor.
2021-08-28 14:37:19 +01:00
Jonathan Wakely
dd3e5859fc libstdc++: Fix comment typo
Signed-off-by: Jonathan Wakely <jwakely@redhat.com>

libstdc++-v3/ChangeLog:

	* include/bits/stl_uninitialized.h: Fix typo in comment.
2021-08-28 11:52:22 +01:00
Jonathan Wakely
07b990ee23 libstdc++: Fix inefficiency in filesystem::absolute [PR99876]
When the path is already absolute, the call to current_path() is
wasteful, because operator/ will ignore the left operand anyway.

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>

libstdc++-v3/ChangeLog:

	PR libstdc++/99876
	* src/c++17/fs_ops.cc (fs::absolute): Call non-throwing form,
	to avoid unnecessary current_path() call.
2021-08-28 11:52:22 +01:00
Jonathan Wakely
952095bb05 libstdc++: Name std::function template parameter
This avoids "<template-parameter-2-2>" being shown in the diagnostics
for ill-formed uses of std::function constructor:

In instantiation of 'std::function<_Res(_ArgTypes ...)>::function(_Functor&&)
[with _Functor = f(f()::_Z1fv.frame*)::<lambda()>;
<template-parameter-2-2> = void; _Res = void; _ArgTypes = {}]'

Instead we get:

In instantiation of 'std::function<_Res(_ArgTypes ...)>::function(_Functor&&)
[with _Functor = f(f()::_Z1fv.frame*)::<lambda()>;
_Constraints = void; _Res = void; _ArgTypes = {}]'

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>

libstdc++-v3/ChangeLog:

	* include/bits/std_function.h (function::function(F&&)): Give
	name to defaulted template parameter, to improve diagnostics.
	Use markdown for more doxygen comments.
2021-08-28 11:52:22 +01:00
YunQiang Su
91f78b673b
MIPS: use N64 ABI by default if the triple end with -gnuabi64
gcc/ChangeLog:

	PR target/102089
	* config.gcc: MIPS: use N64 ABI by default if the triple end
	  with -gnuabi64, which is used by Debian since 2013.
2021-08-28 14:52:09 +08:00
Alexandre Oliva
aa49a05808 fix latent bootstrap-debug issue
I've hit a bootstrap-debug error involving large subprograms in
gcc/ada/sem_ch12.adb.  I'm afraid I couldn't narrow it down to a
reasonable testcase.

thread1 made different decisions about a block containing a
builtin_eh_filter call because in one compilation, estimate_num_insns
found a cgraph_node for the builtin and could thus get to the
is_simple_builtin test, but in the other it didn't.  With different
insn counts, one stage jump-threaded and the other didn't, and the
resulting code diverged quite a bit.

The reason the builtin had a cgraph_node in one case but not the other
was that modref got a chance to analyze the builtin call when it was
the first stmt in the block, and that created the cgraph_node.
However, when it was preceded by debug stmts, the loop in
analyze_function was cut short after the first debug stmt, because the
summary so far was not useful.

This patch fixes both issues: skip debug stmts in the analyze_function
loop, so as to prevent them from affecting any decisions in the loop,
and enable the insn count estimator to get to the is_simple_builtin
test when a cgraph_node has not been created for the builtin.


for  gcc/ChangeLog

	* ipa-modref.c (analyze_function): Skip debug stmts.
	* tree-inline.c (estimate_num_insn): Consider builtins even
	without a cgraph_node.
2021-08-28 00:40:14 -03:00
GCC Administrator
1e52538d2b Daily bump. 2021-08-28 00:16:42 +00:00
Jason Merrill
771fd4aef9 c++: Set type on dependent ARROW_EXPR
Even if the operand of -> has dependent type, if it's a pointer we know
that the result will be the target type of that pointer.  This should avoid
some unnecessary TYPEOF_EXPR when looking up a name after ->.

gcc/cp/ChangeLog:

	* typeck2.c (build_x_arrow): Do set TREE_TYPE when operand is
	a dependent pointer.
2021-08-27 17:37:58 -04:00
Jeff Law
ee914ec4f8 Support limited setcc for H8
gcc/

	* config/h8300/bitfield.md (cstore<mode>4): Remove expander.
	* config/h8300/h8300.c (h8300_expand_branch): Remove function.
	* config/h8300/h8300-protos.h (h8300_expadn_branch): Remove prototype.
	* config/h8300/h8300.md (eqne): New code iterator.
	(geultu, geultu_to_c): Similarly.
	* config/h8300/testcompare.md (cstore<mode>4): Dummy expander.
	(store_c_<mode>, store_c_i_<mode>): New define_insn_and_splits
	(cmp<mode>_c): New pattern
2021-08-27 17:01:37 -04:00
Michael Meissner
10c834f976 Update comments in float128-call.c test.
Segher asked that I update the comments to include the d-form vector stores
(even though they wouldn't be generated by this test).

2021-08-25  Michael Meissner  <meissner@linux.ibm.com>

gcc/testsuite/
	* gcc.target/powerpc/float128-call.c: Update comments.
2021-08-27 16:07:50 -04:00
Jeff Law
ac6d5c9112 Reduce vector comparison of uniform vectors to a scalar comparison
gcc/
	* tree-ssa-dom.c (reduce_vector_comparison_to_scalar_comparison): New
	function.
	(dom_opt_dom_walker::optimize_stmt): Use it.
2021-08-27 15:29:22 -04:00
Michael Meissner
94a047359f Fix float128-call.c test for power8 IEEE 128 and power10.
I built a compiler on a little endian power8 system where the default long
double was IEEE 128-bit instead of IBM 128-bit.  I discovered that on
power8, we would generate a lxvd2x and xxpermdi to deal with the endianess
instead of the Altivec lxv.

In addition, I noticed the constant that was being loaded (1.0q) could be
loaded by the lxvkq instruction.

I rewrote the test to handle all forms of vector load and store that can
be generated.

2021-08-27  Michael Meissner  <meissner@linux.ibm.com>

gcc/testsuite/
	* gcc.target/powerpc/float128-call.c: Fix test for IEEE 128-bit
	long double and power10.
2021-08-27 13:19:54 -04:00
Iain Sandoe
66526c6a1c Darwin : Mark the mod init/term section starts with a linker-visible sym.
Some newer assemblers emit section start temp symbols for mod init and term
sections if there is no suitable symbol present already.
The temp symbols are linker visible and therefore appear in the symbol tables.
Since the temp symbol number can vary when debug is enabled, that causes
compare-debug fails.  The solution is to provide a stable linker-visible
symbol.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>

gcc/ChangeLog:

	* config/darwin.c (finalize_ctors): Add a section-start linker-
	visible symbol.
	(finalize_dtors): Likewise.
	* config/darwin.h (MIN_LD64_INIT_TERM_START_LABELS): New.
2021-08-27 17:02:12 +01:00
Bill Schmidt
ff6bb9dde1 rs6000: Execute the automatic built-in initialization code
2021-08-27  Bill Schmidt  <wschmidt@linux.ibm.com>

gcc/
	* config/rs6000/rs6000-call.c (rs6000-builtins.h): New #include.
	(rs6000_init_builtins): Call rs6000_init_generated_builtins.  Skip the
	old initialization logic when new builtins are enabled.
	* config/rs6000/rs6000-gen-builtins.c (write_decls): Rename
	rs6000_autoinit_builtins to rs6000_init_generated_builtins.
	(write_init_file): Likewise.
2021-08-27 10:58:20 -05:00
Iain Sandoe
9b025925ec libgfortran: Use the libtool macro to determine libm availability.
We recently had a report of build failure against a Darwin branch on
the latest OS release.  This was because (temporarily) the symlink
from libm.dylib => libSystem.dylib had been removed/omitted.

libm is not needed on Darwin, and should not be added unconditionally
even if that is (mostly) harmless since it is a symlink to libc.

There could be cases where the addition was not completely harmless
because the presentation of the symlink would cause the symbols exposed
in libSystem to be considered ahead of ones presented in convenience
libraries.

libgfortran/ChangeLog:

	* Makefile.am: Use configured libm availability.
	* Makefile.in: Regenerate.
	* configure: Regenerate.
	* configure.ac: Use libtool macro to find libm availability.
	* libgfortran.spec.in: Use configured libm availability.
2021-08-27 16:50:19 +01:00
Iain Sandoe
e42ea63bcc testsuite, Darwin : Do not claim 'GAS' for cctools assembler.
Although the cctools assembler is based of GNU GAS, it is from a
very old version (1.38) which does not support many of the features
that the target supports test is expecting.

gcc/testsuite/ChangeLog:

	* lib/target-supports.exp: Exclude cctools assembler based on
	GAS 1.38.
2021-08-27 16:49:21 +01:00
Iain Sandoe
e5d9873fcb configure: Adjust several assembler checks to remove an unused parm.
In r12-3048-ge0b6d0b39c6, the GAS version parameter was removed from
the gcc_GAS_CHECK_FEATURE macro.  It seems that overlapping comit/test
cycles resulted in several AMDGCN and one Darwin commit with the now
extra parameter still present.

This causes wrong configure code to be generated when autoreconf is
used in the gcc directory.

Fixed by removing the extraneous parm from the AMDGCN and Darwin cases.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>

gcc/ChangeLog:

	* configure.ac (darwin2[[0-9]]* | darwin19*): Alter use of
	gcc_GAS_CHECK_FEATURE to remove an extraneous parameter.
	(amdgcn-* | gcn-*) Likewise.
2021-08-27 16:47:31 +01:00
Anthony Sharp
fccd5b48ad call_summary: add missing template keyword
Without the 'template', this function template compares 'traverse' to 'f',
and then compares the result to 'a'.  Evidently it hasn't been instantiated
yet.

gcc/ChangeLog:

	* symbol-summary.h: Added missing template keyword.
2021-08-27 10:08:28 -04:00
Richard Biener
41439e1f6d tree-optimization/45178 - DCE of dead control flow in infinite loop
This fixes DCE to be able to elide dead control flow in an
infinite loop without an exit edge.  This special situation is
handled well by the code finding an edge to preserve since there's
no chance it will find the exit edge and make the loop finite.

2021-08-27  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/45178
	* tree-ssa-dce.c (find_obviously_necessary_stmts): For
	infinite loops without exit do not mark control dependent
	edges of the latch necessary.

	* gcc.dg/tree-ssa/ssa-dce-3.c: Adjust testcase.
2021-08-27 09:51:26 +02:00
konglin1
44a545a6ab i386: Fix wrong optimization for consecutive masked scatters [PR 101472]
gcc/ChangeLog:

	PR target/101472
	* config/i386/sse.md: (<avx512>scattersi<mode>): Add mask operand to
	UNSPEC_VSIBADDR.
	(<avx512>scattersi<mode>): Likewise.
	(*avx512f_scattersi<VI48F:mode>): Merge mask operand to set_dest.
	(*avx512f_scatterdi<VI48F:mode>): Likewise

gcc/testsuite/ChangeLog:

	PR target/101472
	* gcc.target/i386/avx512f-pr101472.c: New test.
	* gcc.target/i386/avx512vl-pr101472.c: New test.
2021-08-27 13:19:43 +08:00
Kewen Lin
26f5ea5e14 rs6000: Make some BIFs vectorized on P10
This patch is to add the support to make vectorizer able to
vectorize some built-in function scalar versions on Power10.

gcc/ChangeLog:

	* config/rs6000/rs6000.c (rs6000_builtin_md_vectorized_function): Add
	support for built-in functions MISC_BUILTIN_DIVWE, MISC_BUILTIN_DIVWEU,
	MISC_BUILTIN_DIVDE, MISC_BUILTIN_DIVDEU, P10_BUILTIN_CFUGED,
	P10_BUILTIN_CNTLZDM, P10_BUILTIN_CNTTZDM, P10_BUILTIN_PDEPD and
	P10_BUILTIN_PEXTD on Power10.

gcc/testsuite/ChangeLog:

	* gcc.target/powerpc/dive-vectorize-1.c: New test.
	* gcc.target/powerpc/dive-vectorize-1.h: New test.
	* gcc.target/powerpc/dive-vectorize-2.c: New test.
	* gcc.target/powerpc/dive-vectorize-2.h: New test.
	* gcc.target/powerpc/dive-vectorize-run-1.c: New test.
	* gcc.target/powerpc/dive-vectorize-run-2.c: New test.
	* gcc.target/powerpc/p10-bifs-vectorize-1.c: New test.
	* gcc.target/powerpc/p10-bifs-vectorize-1.h: New test.
	* gcc.target/powerpc/p10-bifs-vectorize-run-1.c: New test.
2021-08-26 20:23:58 -05:00
Kewen Lin
2e64eec671 rs6000: Add missing unsigned info for some P10 bifs
This patch is to make prototypes of some Power10 built-in
functions consistent with what's in the documentation, as
well as the vector version.  Otherwise, useless conversions
can be generated in gimple IR, and the vectorized versions
will have inconsistent types.

gcc/ChangeLog:

	* config/rs6000/rs6000-call.c (builtin_function_type): Add unsigned
	signedness for some Power10 bifs.
2021-08-26 20:23:17 -05:00
David Edelsohn
5faf712039 aix: packed struct alignment [PR102068]
Further fixes to structure alignment when the structure is packed
and contains double.  This patch checks for packed attribute
at the top level.

gcc/ChangeLog:

	PR target/102068
	* config/rs6000/rs6000.c (rs6000_adjust_field_align): Use
	computed alignment if the entire struct has attribute packed.
2021-08-26 21:19:22 -04:00
liuhongt
0fa4787bf3 Fold more shuffle builtins to VEC_PERM_EXPR.
A follow-up to https://gcc.gnu.org/pipermail/gcc-patches/2019-May/521983.html

gcc/
	PR target/98167
	PR target/43147
	* config/i386/i386.c (ix86_gimple_fold_builtin): Fold
	IX86_BUILTIN_SHUFPD512, IX86_BUILTIN_SHUFPS512,
	IX86_BUILTIN_SHUFPD256, IX86_BUILTIN_SHUFPS,
	IX86_BUILTIN_SHUFPS256.
	(ix86_masked_all_ones): New function.

gcc/testsuite/
	* gcc.target/i386/avx512f-vshufpd-1.c: Adjust testcase.
	* gcc.target/i386/avx512f-vshufps-1.c: Adjust testcase.
	* gcc.target/i386/pr43147.c: New test.
2021-08-27 08:50:49 +08:00