]> git.ipfire.org Git - thirdparty/gcc.git/log
thirdparty/gcc.git
3 years agoFix hppa64-hpux11 build to remove source paths from embedded path.
John David Anglin [Sun, 29 Nov 2020 20:07:46 +0000 (20:07 +0000)] 
Fix hppa64-hpux11 build to remove source paths from embedded path.

This change adds the +nodefaultrpath ld option to remove all library
paths that were specified with the -L option from the embedded path.

2020-11-29  John David Anglin  <danglin@gcc.gnu.org>

ChangeLog:
* libtool.m4 (archive_cmds): Add +nodefaultrpath ld option on
hppa64-*-hpux11*.

libatomic/ChangeLog:
* configure: Regenerate.

libbacktrace/ChangeLog:
* configure: Regenerate.

libcc1/ChangeLog:
* configure: Regenerate.

libffi/ChangeLog:
* configure: Regenerate.

libgfortran/ChangeLog:
* configure: Regenerate.

libgomp/ChangeLog:
* configure: Regenerate.

libhsail-rt/ChangeLog:
* configure: Regenerate.

libitm/ChangeLog:
* configure: Regenerate.

libobjc/ChangeLog:
* configure: Regenerate.

liboffloadmic/ChangeLog:
* configure: Regenerate.
* plugin/configure: Regenerate.

libquadmath/ChangeLog:
* configure: Regenerate.

libsanitizer/ChangeLog:
* configure: Regenerate.

libssp/ChangeLog:
* configure: Regenerate.

libstdc++-v3/ChangeLog:
* configure: Regenerate.

libvtv/ChangeLog:
* configure: Regenerate.

lto-plugin/ChangeLog:
* configure: Regenerate.

zlib/ChangeLog:
* configure: Regenerate.

3 years agoFix PR ada/97504 on hppa*-*-hpux*.
John David Anglin [Sun, 29 Nov 2020 15:57:40 +0000 (15:57 +0000)] 
Fix PR ada/97504 on hppa*-*-hpux*.

2020-11-29  John David Anglin  <danglin@gcc.gnu.org>

gcc/ada/
PR ada/97504
* Makefile.rtl (LIBGNAT_TARGET_PAIRS) <hppa*-*-hpux*>: Use wraplf
version of Aux_Long_Long_Float.

3 years agoSkip EAF_UNUSED parameters in handle_pure_call
Jan Hubicka [Sun, 29 Nov 2020 15:31:47 +0000 (16:31 +0100)] 
Skip EAF_UNUSED parameters in handle_pure_call

* tree-ssa-structalias.c (handle_pure_call): Skip EAF_UNUSED
 parameters.

3 years agoDetect unused parameters in ipa-modref
Jan Hubicka [Sun, 29 Nov 2020 15:27:35 +0000 (16:27 +0100)] 
Detect unused parameters in ipa-modref

* ipa-modref.c (modref_lattice::merge): Do nothing if F is EAF_UNUSED.
(analyze_parms): Detect unused params.
(modref_merge_call_site_flags): Merge correct EAF_UNUSED.

3 years agod: Remove d_size_t from front-end sources (PR 87788)
Iain Buclaw [Sun, 29 Nov 2020 11:49:52 +0000 (12:49 +0100)] 
d: Remove d_size_t from front-end sources (PR 87788)

The typedef for d_size_t assumes that the implementation of the
front-end is written in D itself, where size_t can map only to uint32_t
or uint64_t.  As that is not the case for the current D front-end, the
typedef should be removed. This would fix the bootstrap on targets where
in C++ size_t is a long, such as darwin i386.

Reviewed-on: https://github.com/dlang/dmd/pull/12008

gcc/d/ChangeLog:

PR d/87788
* dmd/MERGE: Merge upsream dmd 45fa6cfd2.

3 years agoDaily bump.
GCC Administrator [Sun, 29 Nov 2020 00:16:22 +0000 (00:16 +0000)] 
Daily bump.

3 years agoImprove support of simple bit-fields in -fdump-ada-spec
Eric Botcazou [Sat, 28 Nov 2020 15:37:12 +0000 (16:37 +0100)] 
Improve support of simple bit-fields in -fdump-ada-spec

This fixes an issue with nested structures and adds an Alignment clause
to counter the effect of the Pack aspect.

gcc/c-family/ChangeLog:
* c-ada-spec.c (dump_nested_type) <RECORD_TYPE>: Remove obsolete code.
(dump_ada_structure): Also deal with convention, unchecked union and
bit-field for nested types.  In the latter case, print an Alignment
aspect along with the Pack aspect.

3 years agocompiler: avoid follow-on errors for bad types
Ian Lance Taylor [Fri, 27 Nov 2020 00:11:28 +0000 (16:11 -0800)] 
compiler: avoid follow-on errors for bad types

Mark bad types as erroneous, to avoid generating further errors.

This required some code using array types to check for errors.

For https://golang.org/issue/19880

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/273626

3 years agocompiler: better error for x, x := 1, 2
Ian Lance Taylor [Thu, 26 Nov 2020 21:15:41 +0000 (13:15 -0800)] 
compiler: better error for x, x := 1, 2

Was
    assign.go:59:28: error: multiple assignments to x
Now
    assign.go:59:28: error: ‘x’ repeated on left side of :=

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/273546

3 years agoFix PR target/97939
Eric Botcazou [Sat, 28 Nov 2020 11:54:48 +0000 (12:54 +0100)] 
Fix PR target/97939

The little dance around 4096 that add/sub instructions do on the SPARC
needs to be taken into account for the overflow arithmetic operations.
It cannot be done for unsigned overflow, but it can be done for signed
overflow.

gcc/ChangeLog:
PR target/97939
* config/sparc/predicates.md (arith_double_add_operand): Comment.
* config/sparc/sparc.md (uaddvdi4): Use arith_double_operand.
(addvdi4): Use arith_double_add_operand.
(addsi3): Remove useless attributes.
(addvsi4): Use arith_add_operand.
(*cmp_ccv_plus): Likewise and add second alternative accordingly.
(*cmp_ccxv_plus): Likewise.
(*cmp_ccv_plus_set): Likewise.
(*cmp_ccxv_plus_set): Likewise.
(*cmp_ccv_plus_sltu_set): Likewise.
(usubvdi4): Use arith_double_operand.
(subvdi4): Use arith_double_add_operand.
(subsi3): Remove useless attributes.
(subvsi4): Use arith_add_operand.
(*cmp_ccv_minus): Likewise and add second alternative accordingly.
(*cmp_ccxv_minus): Likewise.
(*cmp_ccv_minus_set): Likewise.
(*cmp_ccxv_minus_set): Likewise.
(*cmp_ccv_minus_sltu_set): Likewise.
(negsi2): Use register_operand.
(unegvsi3): Likewise.
(negvsi3) Likewise.
(*cmp_ccnz_neg): Likewise.
(*cmp_ccxnz_neg): Likewise.
(*cmp_ccnz_neg_set): Likewise.
(*cmp_ccxnz_neg_set): Likewise.
(*cmp_ccc_neg_set): Likewise.
(*cmp_ccxc_neg_set): Likewise.
(*cmp_ccc_neg_sltu_set): Likewise.
(*cmp_ccv_neg): Likewise.
(*cmp_ccxv_neg): Likewise.
(*cmp_ccv_neg_set): Likewise.
(*cmp_ccxv_neg_set): Likewise.
(*cmp_ccv_neg_sltu_set): Likewise.

gcc/testsuite/ChangeLog:
* gcc.target/sparc/overflow-6.c: New test.

3 years agoGenerate correct fn specs for some Fortran library functions.
Thomas Koenig [Sat, 28 Nov 2020 11:36:28 +0000 (12:36 +0100)] 
Generate correct fn specs for some Fortran library functions.

This patch works by generating the correct fn spec from the
actual arguments in specific_intrinsic_symbol, and by passing this
down via gfc_get_extern_function_decl to gfc_get_function_type.
CSHIFT remains to be done.

gcc/fortran/ChangeLog:

PR fortran/97454
* trans-decl.c (gfc_get_extern_function_decl): Add argument
fnspec.
* trans-intrinsic.c (MAX_SPEC_ARG): Define.
(intrinsic_fnspec): New function.
(ADD_CHAR): Define.
(specific_intrinsic_symbol): Adjust comment. Pass
fn spec to gfc_get_extern_function_decl.
(gfc_conv_intrinsic_funcall): Add ANY, ALL, NORM2, PRODUCT
and SUM intrnisic. Add FIXME for cshift et al.
* trans-types.c (gfc_get_function_type): Add fnspec argument,
handle it.
* trans-types.h (gfc_get_function_type): Add optinal fnspec
argument.
* trans.h (gfc_get_extern_function_decl): Likewise.

3 years agoDaily bump.
GCC Administrator [Sat, 28 Nov 2020 00:16:38 +0000 (00:16 +0000)] 
Daily bump.

3 years agoRevert previous change and use pragma to suppress -Wformat-diag.
Martin Sebor [Fri, 27 Nov 2020 23:04:30 +0000 (16:04 -0700)] 
Revert previous change and use pragma to suppress -Wformat-diag.

gcc/cp/ChangeLog:

* error.c (add_quotes): Revert previous change and use pragma to
suppress -Wformat-diag.

3 years agopreprocessor: Fix #line overflow check [PR97602]
Joseph Myers [Fri, 27 Nov 2020 22:40:01 +0000 (22:40 +0000)] 
preprocessor: Fix #line overflow check [PR97602]

The preprocessor check for overflow (of linenum_type = unsigned int)
when reading the line number in a #line directive is incomplete; it
checks "reg < reg_prev" which doesn't cover all cases where
multiplying by 10 overflowed.  Fix this by checking for overflow
before rather than after it occurs (using essentially the same logic
as used by e.g. glibc printf when reading width and precision values
from strings).

Bootstrapped with no regressions for x86_64-pc-linux-gnu.

libcpp/
2020-11-27  Joseph Myers  <joseph@codesourcery.com>

PR preprocessor/97602
* directives.c (strtolinenum): Check for overflow before it
occurs.  Correct comment.

gcc/testsuite/
2020-11-27  Joseph Myers  <joseph@codesourcery.com>

PR preprocessor/97602
* gcc.dg/cpp/line9.c, gcc.dg/cpp/line10.c: New tests.

3 years agolibphobos: Fix segfault at run-time when using custom Fibers (PR 98025)
Iain Buclaw [Fri, 27 Nov 2020 12:15:44 +0000 (13:15 +0100)] 
libphobos: Fix segfault at run-time when using custom Fibers (PR 98025)

When libphobos is configured with --enable-cet, this adds extra fields
to the Fiber class to support the ucontext_t fallback implementation.
These fields get omitted when compiling user code unless they also used
`-fversion=CET' to build their project, which resulted in data being
overwritten from within swapcontext().

On reviewing the ucontext_t definitions, it was found that the shadow
stack fields were missing, and the struct size didn't match up on X32.
This has been fixed in upstream druntime and merged down here.

Reviewed-on: https://github.com/dlang/druntime/pull/3293

libphobos/ChangeLog:

PR d/98025
* Makefile.in: Regenerate.
* configure: Regenerate.
* configure.ac (DCFG_ENABLE_CET): Substitute.
* libdruntime/MERGE: Merge upstream druntime 0fe7974c.
* libdruntime/Makefile.in: Regenerate.
* libdruntime/core/thread.d: Import gcc.config.
(class Fiber): Add ucontext_t fields when GNU_Enable_CET is true.
* libdruntime/gcc/config.d.in (GNU_Enable_CET): Define.
* src/Makefile.in: Regenerate.
* testsuite/Makefile.in: Regenerate.

3 years agod: Merge upstream dmd db0df3f7e.
Iain Buclaw [Thu, 26 Nov 2020 10:31:25 +0000 (11:31 +0100)] 
d: Merge upstream dmd db0df3f7e.

Removes all support code and tests for the extern(Pascal) calling
convention.

Reviewed-on: https://github.com/dlang/dmd/pull/11994

gcc/d/ChangeLog:

* dmd/MERGE: Merge upstream dmd db0df3f7e.
* types.cc (TypeVisitor::visit (TypeFunction *)): Remove LINKpascal.

3 years agolibphobos: Merge upstream druntime d37ef985.
Iain Buclaw [Thu, 26 Nov 2020 10:23:11 +0000 (11:23 +0100)] 
libphobos: Merge upstream druntime d37ef985.

Adds support for FreeBSD/x86 53-bit precision reals, updates bindings
for FreeBSD 12.x, and removes all support code and tests for the
extern(Pascal) calling convention.

Reviewed-on: https://github.com/dlang/druntime/pull/3286
     https://github.com/dlang/druntime/pull/3287

libphobos/ChangeLog:

* libdruntime/MERGE: Merge upstream druntime d37ef985.
* libdruntime/Makefile.am (DRUNTIME_DSOURCES_FREEBSD): Add
core/sys/freebsd/config.d
* libdruntime/Makefile.in: Regenerate.

3 years agolibphobos: Merge upstream phobos 38873fe6e.
Iain Buclaw [Thu, 26 Nov 2020 10:15:32 +0000 (11:15 +0100)] 
libphobos: Merge upstream phobos 38873fe6e.

Adds support for FreeBSD/x86 53-bit precision reals, and removes all
support code and tests for the extern(Pascal) calling convention.

Reviewed-on: https://github.com/dlang/phobos/pull/7704
     https://github.com/dlang/phobos/pull/7705

libphobos/ChangeLog:

* src/MERGE: Merge upstream phobos 38873fe6e.

3 years agod: Add float and double overloads for all core.math intrinsics
Iain Buclaw [Thu, 26 Nov 2020 09:46:36 +0000 (10:46 +0100)] 
d: Add float and double overloads for all core.math intrinsics

For the math intrinsics: cos, fabs, ldexp, rint, rndtol, and sin, new
overloads have been added to the core.math module for matching float and
double types.  These have been implemented in the compiler.

A recent change to dump_function_to_file started triggering some
scan-tree-dump tests to FAIL, these have been adjusted as well when
updating the test.

gcc/d/ChangeLog:

* intrinsics.cc (maybe_expand_intrinsic): Handle new intrinsics.
* intrinsics.def (INTRINSIC_COS): Add float and double overloads.
(INTRINSIC_FABS): Likewise.
(INTRINSIC_LDEXP): Likewise.
(INTRINSIC_RINT): Likewise.
(INTRINSIC_RNDTOL): Likewise.
(INTRINSIC_SIN): Likewise.
(INTRINSIC_TOPREC): Adjust signature.

libphobos/ChangeLog:

* libdruntime/MERGE: Merge upstream druntime 5e4492c4.

gcc/testsuite/ChangeLog:

* gdc.dg/intrinsics.d: Adjust patterns in scan-tree-dump.

3 years agotestsuite/i386: Fix XOP and FMA4 checking functions [PR98036].
Uros Bizjak [Fri, 27 Nov 2020 17:41:56 +0000 (18:41 +0100)] 
testsuite/i386: Fix XOP and FMA4 checking functions [PR98036].

Add missing returns and remove unnecessary postfix increments.

2020-11-27  Uroš Bizjak  <ubizjak@gmail.com>

PR testsuite/98036

gcc/testsuite/
* gcc.target/i386/fma4-256-maccXX.c (check_maccps):
Remove unnecessary postfix increment on a returned variable.
(check_maccpd): Ditto.
* gcc.target/i386/fma4-256-msubXX.c (check_msubps): Ditto.
(check_msubpd): Ditto.
* gcc.target/i386/fma4-256-nmaccXX.c (check_nmaccps): Ditto.
(check_nmaccpd): Ditto.
* gcc.target/i386/fma4-256-nmsubXX.c (check_nmsubps): Ditto.
(check_nmsubpd): Ditto.
* gcc.target/i386/fma4-maccXX.c (check_maccps): Ditto.
(check_maccpd): Ditto.
(check_maccss): Ditto.
(check_maccsd): Ditto.
* gcc.target/i386/fma4-msubXX.c (check_msubps): Ditto.
(check_msubpd): Ditto.
(check_msubss): Ditto.
(check_msubsd): Ditto.
* gcc.target/i386/fma4-nmaccXX.c (check_nmaccps): Ditto.
(check_nmaccpd): Ditto.
(check_nmaccss): Ditto.
(check_nmaccsd): Ditto.
* gcc.target/i386/fma4-nmsubXX.c (check_nmsubps): Ditto.
(check_nmsubpd): Ditto.
(check_nmsubss): Ditto.
(check_nmsubsd): Ditto.
* gcc.target/i386/xop-haddX.c (check_sbyte2word): Add missing return.
(check_sbyte2dword):
Remove unnecessary postfix increment on a returned value.
(check_sbyte2qword): Ditto.
(check_sword2dword): Add missing return.
(check_sword2qword):
Remove unnecessary postfix increment on a returned value.
(check_dword2qword): Add missing return.
* gcc.target/i386/xop-hadduX.c (check_byte2word): Add missing return.
(check_byte2dword):
Remove unnecessary postfix increment on a returned value.
(check_byte2qword): Ditto.
(check_word2dword): Add missing return.
(check_word2qword):
Remove unnecessary postfix increment on a returned value.
(check_word2qword): Add missing return.
* gcc.target/i386/xop-hsubX.c (check_sbyte2word): Add missing return.
(check_sword2dword): Ditto.
(check_sword2qword): Ditto.

3 years agolibstdc++: Refactor dejagnu effective-target checks
Jonathan Wakely [Fri, 27 Nov 2020 00:21:52 +0000 (00:21 +0000)] 
libstdc++: Refactor dejagnu effective-target checks

This introduces two new procs to replace boilerplate in the
effective-target checks.

libstdc++-v3/ChangeLog:

* testsuite/lib/libstdc++.exp (v3_try_preprocess): Define
new proc to preprocess a chunk of code.
(v3_check_preprocessor_condition): Define new proc to test
a preprocessor condition depending on GCC or libstdc++ macros.
(check_v3_target_debug_mode, check_v3_target_normal_mode):
Use v3_try_preprocess.
(check_v3_target_normal_namespace)
(check_v3_target_parallel_mode, check_v3_target_cstdint)
(check_v3_target_cmath, check_v3_target_atomic_builtins)
(check_v3_target_gthreads, check_v3_target_gthreads_timed)
(check_v3_target_sleep, check_v3_target_sched_yield)
(check_v3_target_string_conversions, check_v3_target_swprintf)
(check_v3_target_binary_io, check_v3_target_nprocs): Use
v3_check_preprocessor_condition.
(check_effective_target_cxx11): Likewise.
(check_effective_target_random_device): Likewise.
(check_effective_target_tbb-backend): Likewise.
(check_effective_target_futex): Likewise.
(check_v3_target_little_endian) Call check_effective_target_le.
(check_effective_target_atomic-builtins): New proc to define
new effective-target keyword.
(check_effective_target_gthreads-timed): Likewise.

3 years agoINSTALL: Default to --enable-cet=auto
H.J. Lu [Fri, 27 Nov 2020 13:39:56 +0000 (05:39 -0800)] 
INSTALL: Default to --enable-cet=auto

PR other/98027
* doc/install.texi: Default to --enable-cet=auto.

3 years agoIn 'gcc/omp-oacc-kernels-decompose.cc:flatten_binds', don't choke on empty GIMPLE...
Thomas Schwinge [Fri, 27 Nov 2020 10:54:50 +0000 (11:54 +0100)] 
In 'gcc/omp-oacc-kernels-decompose.cc:flatten_binds', don't choke on empty GIMPLE sequence

Also, instead of just examining the first statement of inner 'GIMPLE_BIND' (via
'inner_sequence' being a 'typedef gimple *gimple_seq'), in fact examine all
statements contained therein, which I suppose must've been the intention here.

This "fixes" the testcase 'c-c++-common/goacc/kernels-decompose-ice-2.c' (which
now runs into the same ICE as 'c-c++-common/goacc/kernels-decompose-ice-1.c',
etc.).

gcc/
* omp-oacc-kernels-decompose.cc (flatten_binds): Don't choke on
empty GIMPLE sequence, and examine all statements contained in
inner 'GIMPLE_BIND'.
gcc/testsuite/
* c-c++-common/goacc/kernels-decompose-ice-1.c: Adjust.
* c-c++-common/goacc/kernels-decompose-ice-2.c: Likewise.

3 years agolibstdc++: Fix -Wrange-loop-construct warnings in filesystem tests
Jonathan Wakely [Fri, 27 Nov 2020 12:15:44 +0000 (12:15 +0000)] 
libstdc++: Fix -Wrange-loop-construct warnings in filesystem tests

Many tests do `for (const path& p : test_paths)` where test_paths is an
array of strings. To avoid -Wrange-loop-construct warnings the loop
variable should be an object, not a reference bound to a temporary.

libstdc++-v3/ChangeLog:

* testsuite/27_io/filesystem/operations/absolute.cc: Avoid
-Wrange-loop-construct warning.
* testsuite/27_io/filesystem/path/append/source.cc: Likewise.
* testsuite/27_io/filesystem/path/assign/copy.cc: Likewise.
* testsuite/27_io/filesystem/path/compare/path.cc: Likewise.
* testsuite/27_io/filesystem/path/construct/copy.cc: Likewise.
* testsuite/27_io/filesystem/path/decompose/extension.cc:
Likewise.
* testsuite/27_io/filesystem/path/decompose/filename.cc:
Likewise.
* testsuite/27_io/filesystem/path/decompose/parent_path.cc:
Likewise.
* testsuite/27_io/filesystem/path/decompose/relative_path.cc:
Likewise.
* testsuite/27_io/filesystem/path/decompose/root_directory.cc:
Likewise.
* testsuite/27_io/filesystem/path/decompose/root_path.cc:
Likewise.
* testsuite/27_io/filesystem/path/itr/traversal.cc: Likewise.
* testsuite/27_io/filesystem/path/modifiers/remove_filename.cc:
Likewise.
* testsuite/27_io/filesystem/path/modifiers/replace_extension.cc:
Likewise.
* testsuite/27_io/filesystem/path/modifiers/replace_filename.cc:
Likewise.
* testsuite/27_io/filesystem/path/nonmember/append.cc: Likewise.
* testsuite/27_io/filesystem/path/nonmember/cmp.cc: Likewise.
* testsuite/27_io/filesystem/path/nonmember/cmp_c++20.cc:
Likewise.
* testsuite/27_io/filesystem/path/nonmember/hash_value.cc:
Likewise.
* testsuite/27_io/filesystem/path/query/has_extension.cc:
Likewise.
* testsuite/27_io/filesystem/path/query/has_filename.cc:
Likewise.
* testsuite/27_io/filesystem/path/query/has_parent_path.cc:
Likewise.
* testsuite/27_io/filesystem/path/query/has_relative_path.cc:
Likewise.
* testsuite/27_io/filesystem/path/query/has_root_directory.cc:
Likewise.
* testsuite/27_io/filesystem/path/query/has_root_name.cc:
Likewise.
* testsuite/27_io/filesystem/path/query/has_root_path.cc:
Likewise.
* testsuite/27_io/filesystem/path/query/has_stem.cc: Likewise.
* testsuite/27_io/filesystem/path/query/is_relative.cc: Likewise.
* testsuite/experimental/filesystem/operations/absolute.cc:
Likewise.
* testsuite/experimental/filesystem/path/assign/copy.cc: Likewise.
* testsuite/experimental/filesystem/path/compare/path.cc:
Likewise.
* testsuite/experimental/filesystem/path/construct/copy.cc:
Likewise.
* testsuite/experimental/filesystem/path/decompose/extension.cc:
Likewise.
* testsuite/experimental/filesystem/path/decompose/filename.cc:
Likewise.
* testsuite/experimental/filesystem/path/decompose/parent_path.cc:
Likewise.
* testsuite/experimental/filesystem/path/decompose/relative_path.cc:
Likewise.
* testsuite/experimental/filesystem/path/decompose/root_directory.cc:
Likewise.
* testsuite/experimental/filesystem/path/decompose/root_path.cc:
Likewise.
* testsuite/experimental/filesystem/path/itr/traversal.cc:
Likewise.
* testsuite/experimental/filesystem/path/modifiers/remove_filename.cc:
Likewise.
* testsuite/experimental/filesystem/path/modifiers/replace_extension.cc:
Likewise.
* testsuite/experimental/filesystem/path/modifiers/replace_filename.cc:
Likewise.
* testsuite/experimental/filesystem/path/nonmember/hash_value.cc:
Likewise.
* testsuite/experimental/filesystem/path/query/has_extension.cc:
Likewise.
* testsuite/experimental/filesystem/path/query/has_filename.cc:
Likewise.
* testsuite/experimental/filesystem/path/query/has_parent_path.cc:
Likewise.
* testsuite/experimental/filesystem/path/query/has_relative_path.cc:
Likewise.
* testsuite/experimental/filesystem/path/query/has_root_directory.cc:
Likewise.
* testsuite/experimental/filesystem/path/query/has_root_name.cc:
Likewise.
* testsuite/experimental/filesystem/path/query/has_root_path.cc:
Likewise.
* testsuite/experimental/filesystem/path/query/has_stem.cc:
Likewise.
* testsuite/experimental/filesystem/path/query/is_relative.cc:
Likewise.

3 years agochangelog: allow flexible "cherry picked" format.
Martin Liska [Fri, 27 Nov 2020 12:43:25 +0000 (13:43 +0100)] 
changelog: allow flexible "cherry picked" format.

It handles the following:
(cherry picked from commit c0c7270cc4efd896fe99f8ad5409dbef089a407f (testsuite changes only))

contrib/ChangeLog:

* gcc-changelog/git_commit.py: Use regex for cherry pick prefix.
* gcc-changelog/test_email.py: Test it.
* gcc-changelog/test_patches.txt: Likewise.

3 years agolibstdc++: Partially revert r11-5314
Jonathan Wakely [Fri, 27 Nov 2020 11:00:15 +0000 (11:00 +0000)] 
libstdc++: Partially revert r11-5314

The changes in r11-5314 are broken, because it means we don't use
__gthread_once for the first few initializations, but after the program
becomes multi-threaded we will repeat the initialization, using
__gthread_once once this time. This leads to memory errors.

The use of __is_single_threaded() in locale::id::_M_id() is OK, because
the side effects are the same either way.

libstdc++-v3/ChangeLog:

* src/c++98/locale.cc (locale::facet::_S_get_c_locale()):
Revert change to use __is_single_threaded.
* src/c++98/locale_init.cc (locale::_S_initialize()):
Likewise.

3 years agotree-optimization/98024 - fix rnflow regression
Richard Biener [Fri, 27 Nov 2020 11:01:25 +0000 (12:01 +0100)] 
tree-optimization/98024 - fix rnflow regression

The change to make PRE insertion iterate less had a typo in checking
successors RPO state.  Fixing this exposes that regular PRE insertion
when facing a value that is the same on all edges inserts an
assignment in place of a PHI node but fails to set up things so that
this insertion is not repeated (it correctly does not return
'new_stuff').  But with the new iteration scheme this causes us
to repeatedly insert such assignment and change AVAIL_OUT over to
the newly inserted expression.  The fix is to treat this as PHI
and insert into PHI_GEN, avoiding repetitive insertion.

2020-11-27  Richard Biener  <rguenther@suse.de>

PR tree-optimization/98024
* tree-ssa-pre.c (insert): Fix successor RPO order check.
(do_pre_regular_insertion): When inserting an assignment
in place of an all-same-value PHI still record that into
PHI_GEN.

3 years agogfortran.dg/gomp/requires-4.f90: Fix !$omp clause
Tobias Burnus [Fri, 27 Nov 2020 10:45:14 +0000 (11:45 +0100)] 
gfortran.dg/gomp/requires-4.f90: Fix !$omp clause

gcc/testsuite/
* gfortran.dg/gomp/requires-4.f90: Fix typo in '!$omp' clause.

3 years agogfortran.dg/gomp/requires-4.f90: Fix !$omp syntax
Tobias Burnus [Fri, 27 Nov 2020 10:40:11 +0000 (11:40 +0100)] 
gfortran.dg/gomp/requires-4.f90: Fix !$omp syntax

gcc/testsuite/
* gfortran.dg/gomp/requires-4.f90: Fix '!$omp' syntax.

3 years agotree-ssanames: Allow non-SSA_NAME arguments to get_range_info
Jakub Jelinek [Fri, 27 Nov 2020 10:38:31 +0000 (11:38 +0100)] 
tree-ssanames: Allow non-SSA_NAME arguments to get_range_info

My recent match.pd change required quite a lot of code due to the separate
need to handle INTEGER_CSTs and SSA_NAMEs, and after all, I didn't even
handle one case there, when in x * y / y the x is INTEGER_CST and y is
SSA_NAME.
The following patch allows to simplify it, by allowing non-SSA_NAME argument
to get_range_info, for INTEGER_CSTs it will return VR_RANGE with *min == *max
equal to the constnat, and for non-INTEGER_CST/SSA_NAMEs it will just return
VR_VARYING.

This allows not to simplify just the match.pd, but some other spots too.

2020-11-27  Jakub Jelinek  <jakub@redhat.com>

* tree-ssanames.c (get_range_info): Handle INTEGER_CST by returning
VR_RANGE with both *min and *max set to the wide_int value of the
INTEGER_CST.  Return VR_VARYING for non-SSA_NAMEs.
* match.pd ((t * 2) / 2) -> t): Handle also @0 being INTEGER_CST.
Simplify by calling get_range_info on everything.
* tree-ssa-strlen.c (maybe_diag_stxncpy_trunc): Simplify by calling
get_range_info on everything.
* tree-scalar-evolution.c (iv_can_overflow_p): Likewise.

3 years agogimple-fold: Fix another __builtin_clear_padding ICE
Jakub Jelinek [Fri, 27 Nov 2020 10:23:45 +0000 (11:23 +0100)] 
gimple-fold: Fix another __builtin_clear_padding ICE

When playing with __builtin_bit_cast, I have noticed __builtin_clear_padding
ICE on the G class below.  The artificial field with D type has offset 0
and size 8 bytes, but the following artificial field with E type has offset
0 and size 0, so it triggers the asserts that we don't move current position
backwards.  Fixed by ignoring is_empty_type (TREE_TYPE (field)) fields, all
of their bits are padding which is what is added when skipping over to next
field anyway.

2020-11-27  Jakub Jelinek  <jakub@redhat.com>

PR libstdc++/88101
* gimple-fold.c (clear_padding_type): Ignore fields with is_empty_type
types.

* g++.dg/torture/builtin-clear-padding-3.C: New test.

3 years agoOpenACC: Fix integer-type issue with collapse/tile [PR97880]
Tobias Burnus [Fri, 27 Nov 2020 10:17:50 +0000 (11:17 +0100)] 
OpenACC: Fix integer-type issue with collapse/tile [PR97880]

gcc/ChangeLog:

PR c/97880
* omp-expand.c (expand_oacc_collapse_init, expand_oacc_collapse_vars):
Use now passed diff_type.
(expand_oacc_for): Take largest type for diff_type, taking tiling
and collapsing into account.

gcc/testsuite/ChangeLog:

PR c/97880
* gcc.dg/goacc/tile-1.c: New test.

3 years agoaarch64: Introduce --param=aarch64-autovec-preference to select autovec preference...
Kyrylo Tkachov [Fri, 27 Nov 2020 09:19:33 +0000 (09:19 +0000)] 
aarch64: Introduce --param=aarch64-autovec-preference to select autovec preference in backend

This is a patch that introduces the aarch64-autovec-preference that can
take values from 0 - 4, 0 being the default.
It can be used to override the autovectorisation preferences in the
backend:
0 - use default scheme
1 - only use Advanced SIMD
2 - only use SVE
3 - use Advanced SIMD and SVE, prefer Advanced SIMD in the event of a
tie (as determined by costs)
4 - use Advanced SIMD and SVE, prefer SVE in the event of a tie (as
determined by costs)

It can valuable for experimentation when comparing SVE and Advanced SIMD
autovectorisation strategies.

It achieves this adjusting the order of the interleaved SVE and Advanced
SIMD modes in aarch64_autovectorize_vector_modes.
It also adjusts aarch64_preferred_simd_mode to use the new comparison
function to pick Advanced SIMD or SVE to start with.

Bootstrapped and tested on aarch64-none-linux-gnu.

gcc/
* config/aarch64/aarch64.opt
(-param=aarch64-autovec-preference): Define.
* config/aarch64/aarch64.c (aarch64_override_options_internal):
Set aarch64_sve_compare_costs to 0 when preferring only Advanced
SIMD.
(aarch64_cmp_autovec_modes): Define.
(aarch64_preferred_simd_mode): Adjust to use the above.
(aarch64_autovectorize_vector_modes): Likewise.
* doc/invoke.texi: Document aarch64-autovec-preference param.

3 years ago[Ada] Small tweaks to couple of Value routines
Eric Botcazou [Fri, 6 Nov 2020 12:51:45 +0000 (13:51 +0100)] 
[Ada] Small tweaks to couple of Value routines

gcc/ada/

* libgnat/s-valuef.adb (Integer_To_Fixed): Take into account the
extra digit when scaling up the input.
* libgnat/s-valuer.adb (Scan_Decimal_Digits): Restrict previous
change to fixed-point types.
(Scan_Integral_Digits): Likewise.

3 years ago[Ada] Simplify Parent_Is_Boolean with subtype memberships
Piotr Trojanek [Fri, 6 Nov 2020 08:43:43 +0000 (09:43 +0100)] 
[Ada] Simplify Parent_Is_Boolean with subtype memberships

gcc/ada/

* sem_res.adb (Parent_Is_Boolean): Simplify.
(Resolve_Op_Not): Reduce scope of a local variable.

3 years ago[Ada] Reuse Append_New_Elmt where possible
Piotr Trojanek [Thu, 5 Nov 2020 10:35:26 +0000 (11:35 +0100)] 
[Ada] Reuse Append_New_Elmt where possible

gcc/ada/

* cstand.adb: Simplify with Append_New_Elmt.
* sem_util.adb: Likewise.

3 years ago[Ada] Wrong compile time evaluation of Shift_Right
Arnaud Charlet [Thu, 5 Nov 2020 09:48:28 +0000 (04:48 -0500)] 
[Ada] Wrong compile time evaluation of Shift_Right

gcc/ada/

* sem_eval.adb (Fold_Shift): Fix evaluation of Shift_Right on
negative values.

3 years ago[Ada] Reference before declaration on C392015
Arnaud Charlet [Mon, 2 Nov 2020 09:17:02 +0000 (10:17 +0100)] 
[Ada] Reference before declaration on C392015

gcc/ada/

* exp_ch6.adb (Expand_Call): Properly split
Transform_Function_Array and Modify_Tree_For_C.

3 years ago[Ada] Restore access type instead of mode out parameter
Piotr Trojanek [Thu, 5 Nov 2020 20:09:28 +0000 (21:09 +0100)] 
[Ada] Restore access type instead of mode out parameter

gcc/ada/

* sem_eval.ads (Compile_Time_Compare): Restore parameter Diff to
be of an access type.
* sem_eval.adb (Compile_Time_Compare): Adapt body and callers.
* sem_attr.adb (Eval_Attribute): Adapt callers.

3 years ago[Ada] Small improvement to System.Value_R.Scan_Raw_Real
Eric Botcazou [Thu, 5 Nov 2020 12:28:16 +0000 (13:28 +0100)] 
[Ada] Small improvement to System.Value_R.Scan_Raw_Real

gcc/ada/

* libgnat/s-valuer.adb (Scan_Decimal_Digits): Round Extra.
(Scan_Integral_Digits): Likewise.

3 years ago[Ada] Do not apply range checks inside generics in GNATprove mode
Yannick Moy [Wed, 4 Nov 2020 15:11:51 +0000 (16:11 +0100)] 
[Ada] Do not apply range checks inside generics in GNATprove mode

gcc/ada/

* checks.adb (Selected_Range_Checks): Adapt the condition for
applying range checks so that it is not done inside generics.

3 years ago[Ada] Do not use 128-bit division for 64-bit fixed-point types
Eric Botcazou [Wed, 4 Nov 2020 16:27:17 +0000 (17:27 +0100)] 
[Ada] Do not use 128-bit division for 64-bit fixed-point types

gcc/ada/

* exp_fixd.adb (Build_Double_Divide): Only use a 128-bit
division if one of the operands is larger than 64 bits.
(Build_Double_Divide_Code): Likewise.
(Build_Scaled_Divide): Likewise.
(Build_Scaled_Divide_Code): Likewise.

3 years ago[Ada] To_GM_Time returning invalid value for Invalid_Time
Arnaud Charlet [Wed, 4 Nov 2020 13:58:47 +0000 (08:58 -0500)] 
[Ada] To_GM_Time returning invalid value for Invalid_Time

gcc/ada/

* libgnat/s-os_lib.adb (To_GM_Time): Return valid and consistent
values for Invalid_Time.

3 years ago[Ada] Implement AI12-0187 (Stable properties of abstract data types)
Steve Baird [Wed, 21 Oct 2020 23:57:04 +0000 (16:57 -0700)] 
[Ada] Implement AI12-0187 (Stable properties of abstract data types)

gcc/ada/

* snames.ads-tmpl: Define new Name_Stable_Properties Name_Id
value.
* aspects.ads, aspects.adb: Add new Aspect_Stable_Properties
enumeration literal to Aspect_Id type. Add Class_Present
parameter to Find_Aspect and related
functions (Find_Value_Of_Aspect and Has_Aspect).
* sem_util.adb (Has_Nontrivial_Precondition): Fix
previously-latent bug uncovered by adding Class_Present
parameter to Aspect.Find_Aspect. The code was wrong before, but
with the change the bug was more likely to make a user-visible
difference.
* sem_ch6.adb (Analyze_Operator_Symbol): If a string literal
like "abs" or "-" occurs in a Stable_Properties aspect
specification, then it is to be interpreted as an operator
symbol and not as a string literal.
* sem_ch13.ads: Export new Parse_Aspect_Stable_Properties
function, analogous to the existing Parse_Aspect_Aggregate
exported procedure.
* sem_ch13.adb: (Parse_Aspect_Stable_Properties): New function;
analogous to existing Parse_Aspect_Aggregate.
(Validate_Aspect_Stable_Properties): New procedure; analogous to
existing Validate_Aspect_Aggregate. Called from the same case
statement (casing on an Aspect_Id value) where
Validate_Aspect_Aggregate is called.
(Resolve_Aspect_Stable_Properties): New procedure; analogous to
existing Resolve_Aspect_Aggregate. Called from the same two case
statements (each casing on an Aspect_Id value) where
Resolve_Aspect_Aggregate is called.
(Analyze_Aspect_Specifications): Set Has_Delayed_Aspects and
Is_Delayed_Aspect attributes for Aspect_Stable_Properties aspect
specifications.
(Check_Aspect_At_End_Of_Declarations): The syntactic
"expression" for a Stable_Properties aspect specification is not
semantically an expression; it doesn't have a type. Thus, force
T to be empty in this case.
* contracts.adb (Expand_Subprogram_Contract): Add call to new
local procedure,
Expand_Subprogram_Contract.Add_Stable_Property_Contracts, which
generates Postcondition pragmas corresponding to stable property
checks.

3 years ago[Ada] Default_Initial_Condition assertion policy is now RM defined
Piotr Trojanek [Tue, 3 Nov 2020 19:44:03 +0000 (20:44 +0100)] 
[Ada] Default_Initial_Condition assertion policy is now RM defined

gcc/ada/

* doc/gnat_rm/implementation_defined_pragmas.rst:
(Assertion_Policy): Move "Default_Initial_Condition" from
ID_ASSERTION_KIND to RM_ASSERTION_KIND section.
* gnat_rm.texi: Regenerate.

3 years ago[Ada] Sync doc and code for pragma Assertion_Policy
Piotr Trojanek [Tue, 3 Nov 2020 18:43:07 +0000 (19:43 +0100)] 
[Ada] Sync doc and code for pragma Assertion_Policy

gcc/ada/

* doc/gnat_rm/implementation_defined_pragmas.rst
(Assertion_Policy): Add "Default_Initial_Condition",
"Initial_Condition" and "Subprogram_Variant".
* gnat_rm.texi: Regenerate.

3 years ago[Ada] Assertion_Policy is not a valid assertion policy
Piotr Trojanek [Tue, 3 Nov 2020 18:34:17 +0000 (19:34 +0100)] 
[Ada] Assertion_Policy is not a valid assertion policy

gcc/ada/

* sem_prag.adb (Is_Valid_Assertion_Kind): Return False on
"Assertion_Policy"

3 years ago[Ada] Do not compile predefined units with -gnatp in gnatmake
Eric Botcazou [Wed, 4 Nov 2020 13:11:41 +0000 (14:11 +0100)] 
[Ada] Do not compile predefined units with -gnatp in gnatmake

gcc/ada/

* make.adb (GNAT_Flag): Change to "-gnatg".
(Compile): Adjust comments accordingly.

3 years ago[Ada] Restore general case for folding comparison of static strings
Piotr Trojanek [Tue, 3 Nov 2020 23:59:00 +0000 (00:59 +0100)] 
[Ada] Restore general case for folding comparison of static strings

gcc/ada/

* exp_ch4.adb (Rewrite_Comparison): Add assertion to confirm
that evaluation folds comparisons with static operands; when
folding comparison with non-static operands, the resulting
literal is non-static.
* sem_eval.adb (Eval_Relational_Op): Refactor nested IF
statement for the special case in the THEN branch; move code for
the "general case" out of the ELSE branch.
* sem_res.adb (Resolve_Comparison_Op): Only apply a dubious
special-case for GNATprove in the GNATprove_Mode.

3 years ago[Ada] Change parameter from access type to mode out
Piotr Trojanek [Tue, 3 Nov 2020 21:59:35 +0000 (22:59 +0100)] 
[Ada] Change parameter from access type to mode out

gcc/ada/

* sem_eval.ads (Compile_Time_Compare): Change parameter Diff
from access to mode out.
* sem_eval.adb (Compile_Time_Compare): Adapt body and callers.
* sem_attr.adb (Eval_Attribute): Adapt callers.

3 years ago[Ada] Move down call to Narrow_Large_Operation in Expand_N_Op_Multiply
Eric Botcazou [Tue, 3 Nov 2020 16:17:21 +0000 (17:17 +0100)] 
[Ada] Move down call to Narrow_Large_Operation in Expand_N_Op_Multiply

gcc/ada/

* exp_ch4.adb (Expand_N_Op_Multiply): Move down block calling
Narrow_Large_Operation if the type is Universal_Integer.

3 years ago[Ada] Reimplement Ada.Numerics.Big_Numbers.Big_Reals.Float_Conversions
Eric Botcazou [Tue, 3 Nov 2020 10:50:40 +0000 (11:50 +0100)] 
[Ada] Reimplement Ada.Numerics.Big_Numbers.Big_Reals.Float_Conversions

gcc/ada/

* libgnat/a-nbnbre.adb: Remove clauses for System.Img_Real and
add them for System.Unsigned_Types.
(Float_Conversions.To_Big_Real): Reimplement.
(Float_Conversions.From_Big_Real): Likewise.

3 years ago[Ada] Optimize generation of checks for fixed-point types
Eric Botcazou [Mon, 2 Nov 2020 21:54:01 +0000 (22:54 +0100)] 
[Ada] Optimize generation of checks for fixed-point types

gcc/ada/

* checks.ads (Determine_Range_To_Discrete): New procedure.
* checks.adb (Apply_Scalar_Range_Check): Call it to determine
a range for the expression when the target type is discrete.
And also apply the tests for discrete types to fixed-point
types when they are treated as integers.
(Apply_Type_Conversion_Checks): Apply checks to conversions
involving fixed-point types when they are treated as integers.
(Determine_Range) <N_Type_Conversion>: Factor out code into...
(Determine_Range_To_Discrete): ...this new procedure and add
support for fixed-point types when they are treated as integers.
* einfo.ads (Type_High_Bound): Remove obsolete sentence.
(Type_Low_Bound): Likewise.
* exp_ch4.adb (Discrete_Range_Check): Remove obsolete code.
(Real_Range_Check): Likewise.
(Expand_N_Type_Conversion): In case of a no-op conversion, clear
the Do_Range_Check flag on the operand before substituting it.
Remove calls to Real_Range_Check and Discrete_Range_Check that
are not guarded by the Do_Range_Check flag, and an assertion.
* sem_res.adb (Resolve_Type_Conversion): Always apply range
checks in GNATprove mode; in normal mode, use the updated type
of the operand in the test against Universal_Fixed.  Remove
obsolete code setting the Do_Range_Check flag at the end.

3 years ago[Ada] Simplify check for illegal non-returning procedures
Piotr Trojanek [Tue, 3 Nov 2020 08:39:10 +0000 (09:39 +0100)] 
[Ada] Simplify check for illegal non-returning procedures

gcc/ada/

* sem_prag.adb (Analyze_Pragma): Change "Ref Manual" to RM;
replace uses of an unnecessary "Ok" variable with RETURN
statements; replace nested IF with ELSIF.

3 years ago[Ada] Abort defer mismatch with SJLJ exceptions
Arnaud Charlet [Mon, 2 Nov 2020 10:02:00 +0000 (05:02 -0500)] 
[Ada] Abort defer mismatch with SJLJ exceptions

gcc/ada/

* libgnarl/s-tasren.adb (Local_Complete_Rendezvous): Always call
Defer_Abort.
* libgnat/a-except.adb: Abort does not need to be deferred.
* libgnarl/s-tpobop.adb (Exceptional_Complete_Entry_Body): Abort
never needs to be undeferred here.
* exp_ch11.adb (Expand_Exception_Handlers): Remove difference
between ZCX and SJLJ.
* exp_ch9.adb (Expand_N_Asynchronous_Select): Remove different
handling for sjlj.
* exp_sel.ads, exp_sel.adb (Build_Abort_Block,
Build_Abort_Block_Handler): Ditto.

3 years ago[Ada] Emit error messages for null/generic nonreturning procedures
Ghjuvan Lacambre [Wed, 28 Oct 2020 10:03:16 +0000 (11:03 +0100)] 
[Ada] Emit error messages for null/generic nonreturning procedures

gcc/ada/

* sem_prag.adb (Analyze_Pragma): declare new Check_No_Return
function and call it.

3 years ago[Ada] Fix tree for expanded instantiations corresponding to formal packages
Arnaud Charlet [Mon, 2 Nov 2020 11:21:45 +0000 (06:21 -0500)] 
[Ada] Fix tree for expanded instantiations corresponding to formal packages

gcc/ada/

* sem_ch12.adb (Instantiate_Object): Consistently use
New_Copy_Tree instead of New_Copy.

3 years ago[Ada] Adjust head comment of various subprograms in Exp_Fixd
Eric Botcazou [Sun, 1 Nov 2020 13:32:06 +0000 (14:32 +0100)] 
[Ada] Adjust head comment of various subprograms in Exp_Fixd

gcc/ada/

* exp_fixd.adb (Build_Conversion): Adjust head comment.
(Build_Divide): Likewise.
(Build_Double_Divide): Likewise.
(Build_Multiply): Likewise.
(Build_Rem): Likewise.
(Build_Scaled_Divide): Likewise.

3 years ago[Ada] To_Big_Integer and 128bits integers
Arnaud Charlet [Fri, 30 Oct 2020 15:29:00 +0000 (11:29 -0400)] 
[Ada] To_Big_Integer and 128bits integers

gcc/ada/

* libgnat/s-genbig.ads, libgnat/s-genbig.adb (To_Bignum): New
variant taking an Unsigned_128.
* libgnat/a-nbnbin.adb (To_Big_Integer): Add support for 128
bits signed and unsigned types.

3 years ago[Ada] Small tweaks to new implementation of Set_Image_Fixed
Eric Botcazou [Sat, 31 Oct 2020 23:15:52 +0000 (00:15 +0100)] 
[Ada] Small tweaks to new implementation of Set_Image_Fixed

gcc/ada/

* libgnat/s-imagef.adb (Set_Image_Fixed): Pass the full value
of the quotient to Set_Image_Integer during the first round and
adjust the handling of the minus sign.

3 years ago[Ada] Error in Big_Real comparison
Arnaud Charlet [Fri, 30 Oct 2020 15:17:29 +0000 (11:17 -0400)] 
[Ada] Error in Big_Real comparison

gcc/ada/

* libgnat/a-nbnbre.adb ("=", "<"): Fix.

3 years ago[Ada] Fix oversignt in genericized package System.Value_R
Eric Botcazou [Sat, 31 Oct 2020 13:03:04 +0000 (14:03 +0100)] 
[Ada] Fix oversignt in genericized package System.Value_R

gcc/ada/

* libgnat/s-valuer.adb (Scan_Raw_Real): Move pragma Annotate around
and adjust its parameters.

3 years ago[Ada] Optimize magnitude of integer operations for fixed point
Eric Botcazou [Sat, 31 Oct 2020 11:41:18 +0000 (12:41 +0100)] 
[Ada] Optimize magnitude of integer operations for fixed point

gcc/ada/

* exp_fixd.adb (Build_Double_Divide): Use the RM size of types and
a more precise estimate for the size of the denominator.
(Build_Double_Divide_Code): Likewise.
(Build_Multiply): Use a more precise estimate for the size of the
result.
(Build_Scaled_Divide):  Use the RM size of types and a more precise
estimate for the size of the numerator.
(Build_Scaled_Divide_Code): Likewise.

3 years agors6000: Change rs6000_expand_vector_set param
Xionghu Luo [Fri, 27 Nov 2020 05:38:33 +0000 (23:38 -0600)] 
rs6000: Change rs6000_expand_vector_set param

rs6000_expand_vector_set could accept insert either to constant position
or variable position, so change the operand to reg_or_cint_operand.

gcc/ChangeLog:

2020-11-27  Xionghu Luo  <luoxhu@linux.ibm.com>

* config/rs6000/rs6000-call.c (altivec_expand_vec_set_builtin):
Change call param 2 from type int to rtx.
* config/rs6000/rs6000-protos.h (rs6000_expand_vector_set):
Likewise.
* config/rs6000/rs6000.c (rs6000_expand_vector_init):
Change call param 2 from type int to rtx.
(rs6000_expand_vector_set): Likewise.
* config/rs6000/vector.md (vec_set<mode>): Support both constant
and variable index vec_set.

3 years agoThis patch adds absolute jump table support for rs6000.
Haochen Gui [Thu, 26 Nov 2020 06:23:45 +0000 (14:23 +0800)] 
This patch adds absolute jump table support for rs6000.

gcc/ChangeLog:

* config/rs6000/rs6000-protos.h (rs6000_output_addr_vec_elt): Declare.
* config/rs6000/rs6000.c (TARGET_ASM_GENERATE_PIC_ADDR_DIFF_VEC):
Define.
(rs6000_gen_pic_addr_diff_vec, rs6000_output_addr_vec_elt): Implement.
* config/rs6000/rs6000.h (CASE_VECTOR_PC_RELATIVE,
CASE_VECTOR_MODE, ASM_OUTPUT_ADDR_VEC_ELT): Define.
* config/rs6000/rs6000.md (tablejump<mode>_absolute,
tablejump<mode>_absolute_nospec): New expanders.
* config/rs6000/rs6000.opt (mrelative-jumptables): New.

3 years agoDaily bump.
GCC Administrator [Fri, 27 Nov 2020 00:16:31 +0000 (00:16 +0000)] 
Daily bump.

3 years agolibstdc++: Define (and use) _GLIBCXX_HAVE_ATOMIC_WAIT
Jonathan Wakely [Thu, 26 Nov 2020 22:23:11 +0000 (22:23 +0000)] 
libstdc++: Define (and use) _GLIBCXX_HAVE_ATOMIC_WAIT

In order to simplify the preprocessor checks for whether __atomic_wait
is available, this commit does:

-#if defined _GLIBCXX_HAS_GTHREADS || _GLIBCXX_HAVE_LINUX_FUTEX
+#ifdef _GLIBCXX_HAVE_ATOMIC_WAIT

The original was wrong anyway, as it should have used 'defined' to check
_GLIBCXX_HAVE_LINUX_FUTEX (for consistency with how that's used
elsewhere).

The new macro is defined in <bits/atomic_wait.h> when the file is
defines __atomic_wait and related facilities. All other code that
depends on those features can just check the one macro.

libstdc++-v3/ChangeLog:

* include/bits/atomic_wait.h (_GLIBCXX_HAVE_ATOMIC_WAIT):
Define.
* include/bits/atomic_base.h: Check _GLIBCXX_HAVE_ATOMIC_WAIT.
* include/bits/atomic_timed_wait.h: Likewise.
* include/bits/semaphore_base.h: Likewise.
* include/std/atomic: Likewise.
* include/std/latch: Likewise.
* include/std/semaphore: Likewise.

3 years agolibstdc++: Only define std::latch if atomic waiting is available
Jonathan Wakely [Thu, 26 Nov 2020 21:54:46 +0000 (21:54 +0000)] 
libstdc++: Only define std::latch if atomic waiting is available

libstdc++-v3/ChangeLog:

* include/std/latch: Depend on _GLIBCXX_HAS_GTHREADS and
_GLIBCXX_HAVE_LINUX_FUTEX.
* include/std/version (__cpp_lib_latch): Define conditionally.

3 years agolibstc++: Fix typo in new check_effective_target_gthreads proc
Jonathan Wakely [Thu, 26 Nov 2020 21:41:15 +0000 (21:41 +0000)] 
libstc++: Fix typo in new check_effective_target_gthreads proc

Also fix copy&pasted comments referring to the wrong things.

libstdc++-v3/ChangeLog:

* testsuite/lib/libstdc++.exp (check_effective_target_gthreads):
Call check_v3_target_gthreads not check_v3_target_gthreads_timed.

3 years agolibgfortran: Verify the presence of all functions for POSIX 2008 locale
Maciej W. Rozycki [Thu, 26 Nov 2020 17:26:43 +0000 (17:26 +0000)] 
libgfortran: Verify the presence of all functions for POSIX 2008 locale

While we have `configure' checks for the individual POSIX 2008 extended
locale functions we refer to and use to guard the respective call sites,
we only verify the presence of `newlocale' for our global feature enable
check.  Consequently compilation fails for targets like NetBSD that only
have partial support for POSIX 2008 locale features and in particular
lack the `uselocale' function:

.../libgfortran/io/transfer.c: In function 'data_transfer_init_worker':
.../libgfortran/io/transfer.c:3416:30: error:
'old_locale_lock' undeclared (first use in this function)
 3416 |       __gthread_mutex_lock (&old_locale_lock);
      |                              ^~~~~~~~~~~~~~~
.../libgfortran/io/transfer.c:3416:30: note: each undeclared identifier is reported only once for each function it appears in
.../libgfortran/io/transfer.c:3417:12: error:
'old_locale_ctr' undeclared (first use in this function)
 3417 |       if (!old_locale_ctr++)
      |            ^~~~~~~~~~~~~~
.../libgfortran/io/transfer.c:3419:11: error:
'old_locale' undeclared (first use in this function); did you mean 'c_locale'?
 3419 |           old_locale = setlocale (LC_NUMERIC, NULL);
      |           ^~~~~~~~~~
      |           c_locale
.../libgfortran/io/transfer.c: In function 'finalize_transfer':
.../libgfortran/io/transfer.c:4253:26: error:
'old_locale_lock' undeclared (first use in this function)
 4253 |   __gthread_mutex_lock (&old_locale_lock);
      |                          ^~~~~~~~~~~~~~~
.../libgfortran/io/transfer.c:4254:10: error:
'old_locale_ctr' undeclared (first use in this function)
 4254 |   if (!--old_locale_ctr)
      |          ^~~~~~~~~~~~~~
.../libgfortran/io/transfer.c:4256:30: error:
'old_locale' undeclared (first use in this function); did you mean 'c_locale'?
 4256 |       setlocale (LC_NUMERIC, old_locale);
      |                              ^~~~~~~~~~
      |                              c_locale
make[3]: *** [Makefile:6221: transfer.lo] Error 1

Only enable the use of POSIX 2008 extended locale features then when all
the three functions required are present, removing said build errors.

libgfortran/
* io/io.h [HAVE_NEWLOCALE]: Also check for HAVE_FREELOCALE and
HAVE_USELOCALE.
[HAVE_FREELOCALE && HAVE_NEWLOCALE && HAVE_USELOCALE]
(HAVE_POSIX_2008_LOCALE): New macro.
(st_parameter_dt) [HAVE_NEWLOCALE]: Check for
HAVE_POSIX_2008_LOCALE instead.
* io/transfer.c (data_transfer_init_worker, finalize_transfer)
[HAVE_USELOCALE]: Check for HAVE_POSIX_2008_LOCALE instead.
* io/unit.c [HAVE_NEWLOCALE]: Likewise.
(init_units) [HAVE_NEWLOCALE]: Likewise.
(close_units) [HAVE_FREELOCALE]: Likewise.
* runtime/error.c (gf_strerror) [HAVE_USELOCALE]: Likewise.

3 years agolibgfortran: Correct FP feature macro checks
Maciej W. Rozycki [Thu, 26 Nov 2020 17:26:43 +0000 (17:26 +0000)] 
libgfortran: Correct FP feature macro checks

The *_HAS_* floating-point feature macros are defined as 0/1 rather than
#undef/#define settings by gcc/c-family/c-cppbuiltin.c.  Consequently we
choose to use infinity and NaN features even with non-IEEE-754 targets
such as `vax-netbsdelf' that lack them, causing build warnings and
failures like:

In file included from .../libgfortran/generated/maxval_r4.c:26:
.../libgfortran/generated/maxval_r4.c: In function 'maxval_r4':
.../libgfortran/libgfortran.h:292:30: warning: target format does not support infinity
  292 | # define GFC_REAL_4_INFINITY __builtin_inff ()
      |                              ^~~~~~~~~~~~~~
.../libgfortran/generated/maxval_r4.c:149:19:
note: in expansion of macro 'GFC_REAL_4_INFINITY'
  149 |         result = -GFC_REAL_4_INFINITY;
      |                   ^~~~~~~~~~~~~~~~~~~
.../libgfortran/generated/maxval_r4.c: In function 'mmaxval_r4':
.../libgfortran/libgfortran.h:292:30: warning: target format does not support infinity
  292 | # define GFC_REAL_4_INFINITY __builtin_inff ()
      |                              ^~~~~~~~~~~~~~
.../libgfortran/generated/maxval_r4.c:363:19:
note: in expansion of macro 'GFC_REAL_4_INFINITY'
  363 |         result = -GFC_REAL_4_INFINITY;
      |                   ^~~~~~~~~~~~~~~~~~~
{standard input}: Assembler messages:
{standard input}:204: Fatal error: Can't relocate expression
make[3]: *** [Makefile:3358: maxval_r4.lo] Error 1

Correct the checks then for __FLT_HAS_INFINITY__, __DBL_HAS_INFINITY__,
__LDBL_HAS_INFINITY__, __FLT_HAS_QUIET_NAN__, __DBL_HAS_QUIET_NAN__, and
__LDBL_HAS_QUIET_NAN__ to match semantics and remove build issues coming
from the misinterpretation of these macros.

libgfortran/
* libgfortran.h: Use #if rather than #ifdef with
__FLT_HAS_INFINITY__, __DBL_HAS_INFINITY__,
__LDBL_HAS_INFINITY__, __FLT_HAS_QUIET_NAN__,
__DBL_HAS_QUIET_NAN__, and __LDBL_HAS_QUIET_NAN__.

3 years agolibstdc++: Set dg-timeout-factor for some slow tests
Jonathan Wakely [Thu, 26 Nov 2020 15:16:25 +0000 (15:16 +0000)] 
libstdc++: Set dg-timeout-factor for some slow tests

These tests are very, very slow to compile. If the testsuite is run with
a low tool_timeout value they are likely to fail. By adding a
multiplication factor to those tests, it's still possible to use a low
timeout without spurious failures.

libstdc++-v3/ChangeLog:

* testsuite/28_regex/algorithms/regex_match/basic/string_range_01_03.cc:
Add dg-timeout-factor directive.
* testsuite/28_regex/algorithms/regex_match/cstring_bracket_01.cc:
Likewise.
* testsuite/28_regex/algorithms/regex_match/ecma/char/backref.cc:
Likewise.
* testsuite/28_regex/algorithms/regex_match/ecma/wchar_t/63199.cc:
Likewise.
* testsuite/28_regex/algorithms/regex_match/ecma/wchar_t/anymatcher.cc:
Likewise.
* testsuite/28_regex/algorithms/regex_match/ecma/wchar_t/cjk_match.cc:
Likewise.
* testsuite/28_regex/algorithms/regex_match/ecma/wchar_t/hex.cc:
Likewise.
* testsuite/28_regex/algorithms/regex_match/extended/wstring_locale.cc:
Likewise.
* testsuite/28_regex/algorithms/regex_search/61720.cc: Likewise.
* testsuite/28_regex/algorithms/regex_search/ecma/assertion.cc:
Likewise.
* testsuite/28_regex/algorithms/regex_search/ecma/string_01.cc:
Likewise.
* testsuite/28_regex/basic_regex/ctors/deduction.cc: Likewise.

3 years agolibstdc++: Allow dejagnu tool_timeout to be overridden
Jonathan Wakely [Thu, 26 Nov 2020 14:42:09 +0000 (14:42 +0000)] 
libstdc++: Allow dejagnu tool_timeout to be overridden

This allows the default timeout for libstdc++ tests to be set by the
user, either in ~/.dejagnurc or a site.exp file that $DEJAGNU names.

libstdc++-v3/ChangeLog:

* testsuite/lib/libstdc++.exp (libstdc++_init): Only set
tool_timeout if it hasn't been set by the user already.

3 years agolibstdc++: Fix some more deadlocks in tests [PR 97936]
Jonathan Wakely [Thu, 26 Nov 2020 12:55:47 +0000 (12:55 +0000)] 
libstdc++: Fix some more deadlocks in tests [PR 97936]

The missed notifications fixed in r11-5383 also happen in some other
tests which have similar code.

libstdc++-v3/ChangeLog:

PR libstdc++/97936
* testsuite/29_atomics/atomic/wait_notify/bool.cc: Fix missed
notifications by making the new thread wait until the parent
thread is waiting on the condition variable.
* testsuite/29_atomics/atomic/wait_notify/pointers.cc: Likewise.
* testsuite/29_atomics/atomic_flag/wait_notify/1.cc: Likewise.
* testsuite/29_atomics/atomic_ref/wait_notify.cc: Likewise.

3 years agolibstdc++: Add "futex" and "gthreads" effective-target keywords
Jonathan Wakely [Thu, 26 Nov 2020 14:13:32 +0000 (14:13 +0000)] 
libstdc++: Add "futex" and "gthreads" effective-target keywords

This adds a new "futex" effective-target keyword that can be used to
selectively enable/disable tests based on _GLIBCXX_HAVE_LINUX_FUTEX,
instead of checking for that macro in the code.

It also adds "gthreads" as another one, to make the result of the
dg-require-gthreads directive usable in target selectors.

With these new keywords two tests that are currently only run for linux
can also be run for targets using gthr-single.h (e.g. AIX single-thread
multilib, and targets without a gthreads implementation).

libstdc++-v3/ChangeLog:

* testsuite/18_support/96817.cc: Use new effective-target
keywords to select supported targets more effectively.
* testsuite/30_threads/call_once/66146.cc: Likewise.
* testsuite/lib/libstdc++.exp (check_effective_target_futex):
Define new proc.
(check_effective_target_gthreads): Define new proc to replace
dg-require-gthreads.

3 years agoFix PR target/96607
Eric Botcazou [Thu, 26 Nov 2020 15:38:35 +0000 (16:38 +0100)] 
Fix PR target/96607

After 15 years trying to find out what can go into the delay slot of
the call to __tls_get_addr with the Solaris linker, it's now time to
concede defeat and consider it as not to be filled.

gcc/ChangeLog:
PR target/96607
* config/sparc/sparc-protos.h (eligible_for_call_delay): Delete.
* config/sparc/sparc.c (eligible_for_call_delay): Likewise.
* config/sparc/sparc.md (in_call_delay): Likewise.
(tls_delay_slot): New attribute.
(define_delay [call]): Use in_branch_delay.
(tgd_call<P:mode>): Set type to call_no_delay_slot when
tls_delay_slot is false.
(tldm_call<P:mode>): Likewise.

3 years agomatch.pd: Use ranges to optimize some x * y / y to x [PR97997]
Jakub Jelinek [Thu, 26 Nov 2020 15:24:07 +0000 (16:24 +0100)] 
match.pd: Use ranges to optimize some x * y / y to x [PR97997]

For signed integers with undefined overflow we already optimize x * y / y
into x, but for signed integers with -fwrapv or unsigned integers we don't.
The following patch allows optimizing that into just x if value ranges
prove that x * y will never overflow.
It uses the global SSA_NAME_RANGE_INFO only, because like mentioned
in another PR we don't currently have a way to tell the ranger from match.pd
the use stmt (and we'd need in that case to tell ranger to only follow
SSA_NAME_DEF_STMTs + SSA_NAME_RANGE_INFO and never go in the other
direction, as following immediate uses seems forbidden in match.pd).
Another possibility would be to optimize this during vrp, but on the
other side the optimization itself is match.pd-ish.

2020-11-26  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/97997
* match.pd ((t * 2) / 2) -> t): Optimize even for defined
overflow if ranges prove there is no overflow.

* gcc.dg/tree-ssa/pr97997-1.c: New test.
* gcc.dg/tree-ssa/pr97997-2.c: New test.

3 years agotree-optimization/97953 - fix bougs range recorded by EVRP
Richard Biener [Thu, 26 Nov 2020 15:13:08 +0000 (16:13 +0100)] 
tree-optimization/97953 - fix bougs range recorded by EVRP

EVRP records some ranges from asserts into SSA_NAME_RANGE_INFO
but fails to assert that the condition the range is derived from
is always true after the SSA names definition.  The patch implements
the simplest post-dominance check, basic-block equality.

2020-11-26  Richard Biener  <rguenther@suse.de>

PR tree-optimization/97953
* gimple-ssa-evrp-analyze.c
(evrp_range_analyzer::record_ranges_from_incoming_edge): Make
sure the condition post-dominates the SSA definition before
recording into SSA_NAME_RANGE_INFO.

* gcc.dg/pr97953.c: New testcase.

3 years agotree-optimization/98015 - fix VEC_COND_EXPR lowering condition
Richard Biener [Thu, 26 Nov 2020 15:11:43 +0000 (16:11 +0100)] 
tree-optimization/98015 - fix VEC_COND_EXPR lowering condition

This fixes the condition to match the comment and only lower
VECTOR_BOOLEAN_TYPE_P VEC_COND_EXPRs.

2020-11-26  Richard Biener  <rguenther@suse.de>

* gimple-isel.cc (gimple_expand_vec_cond_expr): Only
lower VECTOR_BOOLEAN_TYPE_P VEC_COND_EXPRs.

3 years agoFix early-debug relocations
Andrew Stubbs [Thu, 22 Oct 2020 12:27:47 +0000 (13:27 +0100)] 
Fix early-debug relocations

The relocation symbols were inadvertantly wiped when the type was set in
mkoffload.

gcc/ChangeLog

* config/gcn/mkoffload.c (copy_early_debug_info): Don't wipe
relocation symbols.

3 years agoi386: Cleanup argument handling in ix86_expand_*_builtin functions.
Uros Bizjak [Thu, 26 Nov 2020 14:18:26 +0000 (15:18 +0100)] 
i386: Cleanup argument handling in ix86_expand_*_builtin functions.

There is no need for struct with rtx and mode members since mode is never used.

2020-11-26  Uroš Bizjak  <ubizjak@gmail.com>

gcc/
* config/i386/i386-expand.c (ix86_expand_multi_arg_builtin):
Remove args array of structs, declare rtx xops array instead.
Update all uses.
(ix86_expand_args_builtin): Ditto.
(ix86_expand_round_builtin): Ditto.
(ix86_expand_special_args_builtin): Ditto.

3 years agodwarf: fix language_string for C2X
Martin Liska [Wed, 25 Nov 2020 09:11:08 +0000 (10:11 +0100)] 
dwarf: fix language_string for C2X

gcc/ChangeLog:

* dwarf2out.c (gen_compile_unit_die): Fix missing == 0 in a
strcmp.

3 years agoada: c++: Get rid of libposix4, librt on Solaris
Rainer Orth [Thu, 26 Nov 2020 12:01:30 +0000 (13:01 +0100)] 
ada: c++: Get rid of libposix4, librt on Solaris

I recently noticed that neither libposix4 nor librt are needed on
Solaris 11 any longer:

* libposix4 was renamed to librt in Solaris 7 back in 1998.

* librt was folded into libc in the OpenSolaris timeframe, leaving librt
  only as a filter on libc.  Thus, it's no longer needed on either
  Solaris 11 or Illumos.

The following patch removes both uses.  At the same time, Ada's use of
libthread has gone: it was folded into libc in Solaris 10 already.
TIME_LIBRARY and friends in g++ are likewise removed: Solaris was the
only user.

Bootstrapped without regressions on i386-pc-solaris2.11,
sparc-sun-solaris2.11, and x86_64-pc-linux-gnu.

2020-11-16  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

gcc/cp:
* g++spec.c (TIMELIB, TIME_LIBRARY): Remove.
(lang_specific_driver): Remove TIME_LIBRARY handling.

gcc:
* config/sol2.h (TIME_LIBRARY): Remove.

libstdc++-v3:
* acinclude.m4 (GLIBCXX_ENABLE_LIBSTDCXX_TIME): Remove libposix4
references.
<solaris*>: Don't use -lrt any longer.
* configure: Regenerate.

* doc/xml/manual/configure.xml (--enable-libstdcxx-time=OPTION):
Remove libposix4 reference.

gcc/ada:
* Makefile.rtl <sparc*-sun-solaris*> (THREADSLIB): Remove.
(MISCLIB): Remove -lposix4.
<*86-*-solaris2*>: Likewise.
* libgnarl/s-osinte__solaris.ads (System.OS_Interface): Remove
-lposix4 -lthread.

3 years agolibstdc++: Fix undefined FILE* operations in test
Jonathan Wakely [Thu, 26 Nov 2020 11:25:55 +0000 (11:25 +0000)] 
libstdc++: Fix undefined FILE* operations in test

We only need to check that the constructor doesn't clear errno, so
there's no need to use an invalid FILE* for that.

libstdc++-v3/ChangeLog:

PR libstdc++/98001
* testsuite/ext/stdio_filebuf/char/79820.cc: Do not pass invalid
FILE* to constructor.

3 years agolibstdc++: Add new headers to stdc++.h
Jonathan Wakely [Thu, 26 Nov 2020 11:25:55 +0000 (11:25 +0000)] 
libstdc++: Add new headers to stdc++.h

libstdc++-v3/ChangeLog:

* include/precompiled/stdc++.h: Add new headers.
* include/std/stop_token: Include <semaphore> unconditionally.

3 years agors6000: Set param_vect_partial_vector_usage as 1 for P10
Kewen Lin [Thu, 26 Nov 2020 09:20:40 +0000 (03:20 -0600)] 
rs6000: Set param_vect_partial_vector_usage as 1 for P10

Due to the unexpected performance on Power9 of those vector
with length instructions, we didn't enable vectorization with
partial vectors before.

Some recent testings show that they perform expectedly on
Power10 now.  This patch is to set
param_vect_partial_vector_usage as 1 for P10 or later.

The performance evaluation on the whole SPEC2017 with option
set power10/Ofast/unroll shows it can speed up 525.x264_r by
10.80% and 554.roms_r by 1.94%.

Bootstrapped/regtested on powerpc64le-linux-gnu P10.

gcc/ChangeLog:

* config/rs6000/rs6000.c (rs6000_option_override_internal):
Set param_vect_partial_vector_usage as 1 for Power10 and up
by default.

3 years agogimple-fold: Use DECL_PADDING_P in __builtin_clear_padding
Jakub Jelinek [Thu, 26 Nov 2020 09:51:51 +0000 (10:51 +0100)] 
gimple-fold: Use DECL_PADDING_P in __builtin_clear_padding

On Wed, Nov 25, 2020 at 12:26:17PM -0500, Jason Merrill wrote:
> I think you want to check DECL_PADDING_P here; the C and C++ front ends set
> it on unnamed bit-fields, and that's what is_empty_type looks at.

While the above has been written in the context of __builtin_bit_cast patch,
I think it applies to __builtin_clear_padding too.

So this patch implements that.  The C FE sets DECL_PADDING_P solely on the
DECL_BIT_FIELD !DECL_NAME FIELD_DECLs, the C++ FE sets it on those and in
another spot I haven't really figured out what it is about.

2020-11-26  Jakub Jelinek  <jakub@redhat.com>

* gimple-fold.c (clear_padding_union): Ignore DECL_PADDING_P
fields.
(clear_padding_type): Ignore DECL_PADDING_P fields, rather than
DECL_BIT_FIELD with NULL DECL_NAME.

3 years agomatch.pd: Avoid ICE with shifts [PR97979]
Jakub Jelinek [Thu, 26 Nov 2020 09:50:23 +0000 (10:50 +0100)] 
match.pd: Avoid ICE with shifts [PR97979]

My recent wide_int_binop changes caused ICE on this testcase.
The problem is that for shift where amount has MSB set now fails to optimize
into a constant (IMHO we should treat out of bounds shifts the same later),
but there is a precedent for that already - e.g. division by zero fails
to optimize into a constant too.  I think it is better if path isolation
checks for these UBs and does something the user chooses (__builtin_trap vs.
__builtin_unreachable, and either a deferred warning about the UB or
nothing).
This patch just doesn't optimize if int_const_binop failed.

2020-11-26  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/97979
* match.pd ((X {&,^,|} C2) << C1 into (X << C1) {&,^,|} (C2 << C1)):
Only optimize if int_const_binop returned non-NULL.

* gcc.dg/pr97979.c: New test.
* gcc.c-torture/compile/pr97979.c: New test.

3 years agoDelete dead code in ix86_expand_special_args_builtin
liuhongt [Thu, 26 Nov 2020 01:49:18 +0000 (09:49 +0800)] 
Delete dead code in ix86_expand_special_args_builtin

gcc/ChangeLog:
* config/i386/i386-expand.c
(ix86_expand_special_args_builtin): Delete last_arg_constant
and match.

3 years agotestsuite/98002 - fix gcc.dg/strncmp-2.c
Richard Biener [Thu, 26 Nov 2020 09:07:06 +0000 (10:07 +0100)] 
testsuite/98002 - fix gcc.dg/strncmp-2.c

This makes sure not to free() memory we have mprotected to PROT_NONE
by calling mprotect again with PROT_READ|PROT_WRITE.  This avoids
crashing the allocator when in debug mode.

2020-11-16  Richard Biener  <rguenther@suse.de>

PR testsuite/98002
* gcc.dg/strncmp-2.c: Call mprotect again before free.

3 years agoDon't create location wrapper nodes within OpenACC clauses
Thomas Schwinge [Wed, 25 Nov 2020 19:36:55 +0000 (20:36 +0100)] 
Don't create location wrapper nodes within OpenACC clauses

This fixes a GCC 11, 10, 9 regression introduced by commit
dfd7fdca2ac17d8b823a16700525824ca312ade0 (Subversion r267272) "C++: more
location wrapper nodes (PR c++/43064, PR c++/43486)".  But: this isn't
intending to blame David, because back then, the problem hasn't been visible in
the testsuite (or else I'm sure would've been addressed right away) because of
our all dear friend: missing testsuite coverage.  Thus, for GCC 8, I'm likewise
enhancing the testsuite, without the C++ front end code changes.

I actually had presumed that there may be an issue for OpenACC:
<http://mid.mail-archive.com/874lb9qr2u.fsf@euler.schwinge.homeip.net>, so here
we are, two years (and many "wasted" hours...) later...

gcc/cp/
* parser.c (cp_parser_omp_var_list_no_open): Assert that array
section's 'low_bound', 'length' are not location wrapper nodes.
(cp_parser_oacc_all_clauses, cp_parser_oacc_cache): Instantiate
'auto_suppress_location_wrappers'.
gcc/testsuite/
* c-c++-common/goacc/cache-3-1.c: New.
* c-c++-common/goacc/cache-3-2.c: Likewise.
* c-c++-common/goacc/data-clause-1.c: Likewise.
* c-c++-common/goacc/data-clause-2.c: Likewise.
* c-c++-common/gomp/map-1.c: Adjust.
* c-c++-common/gomp/map-2.c: Likewise.
* g++.dg/goacc/cache-3-1.C: New.
* g++.dg/goacc/cache-3-2.C: Likewise.
* g++.dg/goacc/data-clause-1.C: Likewise.
* g++.dg/goacc/data-clause-2.C: Likewise.
* g++.dg/gomp/map-1.C: Adjust.
* g++.dg/gomp/map-2.C: Likewise.

Reported-by: Sandra Loosemore <sandra@codesourcery.com>
3 years agoi386: Use SDWIM mode iterator for abs and maxmin [PR97873]
Uros Bizjak [Thu, 26 Nov 2020 08:47:01 +0000 (09:47 +0100)] 
i386: Use SDWIM mode iterator for abs and maxmin [PR97873]

Generate special double mode sequence also for QImode and HImode.

Without QImode and HImode patterns, middle-end extends operands to SImode
and emits SImode conditional move instruction with paradoxical SImode output
register.  This form is not recognized by STV pass, but a single abs with
input operand in a register would not be converted anyway due to relatively
high register conversion cost.

2020-11-26  Uroš Bizjak  <ubizjak@gmail.com>

PR target/97873

gcc/
* config/i386/i386.md (abs<mode>2): Use SDWIM mode iterator.
(*abs<mode>2_1): Use SWI mode iterator.

(<maxmin:code><mode>3): Use SDWIM mode iterator.
(*<maxmin:code><mode>3_1): Use SWI mode iterator.

gcc/testsuite/
* gcc.target/i386/pr97873-3.c: New test.

3 years ago[Ada] Ada.Numerics.Big_Numbers.Big_Reals.To_Big_Real looses precision
Arnaud Charlet [Fri, 30 Oct 2020 15:23:49 +0000 (11:23 -0400)] 
[Ada] Ada.Numerics.Big_Numbers.Big_Reals.To_Big_Real looses precision

gcc/ada/

* libgnat/a-nbnbre.adb (To_Big_Real): Do not loose precision.

3 years ago[Ada] Ada 2020 AI12-0401 Renaming of qualified expression of variable
Arnaud Charlet [Wed, 28 Oct 2020 08:55:16 +0000 (04:55 -0400)] 
[Ada] Ada 2020 AI12-0401 Renaming of qualified expression of variable

gcc/ada/

* sem_ch8.adb (Analyze_Object_Renaming): Check for AI12-0401.

3 years ago[Ada] Add support for 128-bit fixed-point types on 64-bit platforms
Eric Botcazou [Tue, 13 Oct 2020 16:15:40 +0000 (18:15 +0200)] 
[Ada] Add support for 128-bit fixed-point types on 64-bit platforms

gcc/ada/

* Makefile.rtl (GNATRTL_NONTASKING_OBJS): Likewise.
(GNATRTL_128BIT_OBJS): Likewise.
(GNATRTL_128BIT_PAIRS): Add new 128-bit variants.
* cstand.adb (Create_Standard): Create Standard_Integer_128.
* doc/gnat_rm/implementation_defined_characteristics.rst: Document
new limits on 64-bit platforms in entry for 3.5.9(10).
* gnat_rm.texi: Regenerate.
* exp_attr.adb: Add with and use clauses for Urealp.
(Expand_N_Attribute_Reference) <Attribute_Fore>: Call new routines
for decimal fixed-point types and common ordinary fixed-point types.
* exp_ch4.adb (Real_Range_Check): Extend conversion trick to all
ordinary fixed-point types and use Small_Integer_Type_For.
* exp_fixd.adb: Add with and use clauses for Ttypes.
(Build_Divide): Add special case for 32-bit values and deal with
128-bit types.
(Build_Double_Divide): Deal with 128-bit types.
(Build_Double_Divide_Code): Likewise.  Do not apply conversions
before calling Build_Multiply.
(Build_Multiply): Likewise.  Add special case for 32-bit values.
(Build_Scaled_Divide): Deal with 128-bit types.
(Build_Scaled_Divide_Code): Likewise.  Fix size computation.  Do not
apply conversions before calling Build_Multiply.
(Do_Multiply_Fixed_Fixed): Minor tweak.
(Integer_Literal): Deal with 128-bit values.
* exp_imgv.adb (Has_Decimal_Small): Delete.
(Expand_Image_Attribute): Call new routines for common ordinary
fixed-point types.
(Expand_Value_Attribute): Likewise.
(Expand_Width_Attribute): Add new expansion for fixed-point types.
* freeze.adb (Freeze_Entity): Move error checks for ordinary
fixed-point types to...
(Freeze_Fixed_Point_Type): ...here.  Deal with 128-bit types and
adjust limitations for 32-bnt and 64-bit types.
* rtsfind.ads (RTU_Id): Add entries for new System_Fore, System_Img,
and System_Val units and remove them for obsolete units.
(RE_Id): Add entries for Double_Divide128, Scaled_Divide128, the new
Fore, Image, Value routines and remove them for obsolete units.
(RE_Unit_Table): Likewise.
* sem_ch3.adb (Decimal_Fixed_Point_Type_Declaration): Deal with
128-bit types.
* stand.ads (Standard_Entity_Type): Add Standard_Integer_128.
* uintp.ads (Uint_31): New deferred constant.
(Uint_Minus_18): Likewise.
(Uint_Minus_31): Likewise.
(Uint_Minus_76): Likewise.
(Uint_Minus_127): Likewise.
* urealp.ads (Ureal_2_31): New function.
(Ureal_2_63): Likewise.
(Ureal_2_127): Likewise.
(Ureal_2_M_127): Likewise.
(Ureal_2_10_18): Likewise.
(Ureal_M_2_10_18): Likewise.
(Ureal_9_10_36): Likewise.
(Ureal_M_9_10_36): Likewise.
(Ureal_10_76): Likewise.
(Ureal_M_10_76): Likewise.
(Ureal_10_36): Delete.
(Ureal_M_10_36): Likewise.
* urealp.adb (UR_2_10_18): New variable.
(UR_9_10_36): Likewise.
(UR_10_76): Likewise.
(UR_M_2_10_18): Likewise.
(UR_M_9_10_36): Likewise.
(UR_M_10_76): Likewise.
(UR_2_31): Likewise.
(UR_2_63): Likewise.
(UR_2_127): Likewise.
(UR_2_M_127): Likewise.
(UR_10_36): Delete.
(UR_M_10_36): Likewise.
(Initialize): Initialize them.
(UR_Write): Do not use awkward Ada literal style.
(Ureal_2_10_18): New function.
(Ureal_9_10_36): Likewise.
(Ureal_10_76): Likewise.
(Ureal_2_31): Likewise.
(Ureal_2_63): Likewise.
(Ureal_2_127): Likewise.
(Ureal_2_M_127): Likewise.
(Ureal_M_2_10_18): Likewise.
(Ureal_M_9_10_36): Likewise.
(Ureal_10_76): Likewise.
(Ureal_M_10_76): Likewise.
(Ureal_10_36): Delete.
(Ureal_M_10_36): Likewise.
* libgnat/a-decima__128.ads: New file.
* libgnat/a-tideau.ads, libgnat/a-tideau.adb: Reimplement as
generic unit.
* libgnat/a-tideio.adb: Reimplement.
* libgnat/a-tideio__128.adb: New file.
* libgnat/a-tifiau.ads, libgnat/a-tifiau.adb: New generic unit.
* libgnat/a-tifiio.adb: Move bulk of implementation to s-imagef
and reimplement.
* libgnat/a-tifiio__128.adb: New file.
* libgnat/a-tiflau.adb (Get): Minor consistency fix.
(Gets): Likewise.
* libgnat/a-wtdeau.ads, libgnat/a-wtdeau.adb: Reimplement as
generic unit.
* libgnat/a-wtdeio.adb: Reimplement.
* libgnat/a-wtdeio__128.adb: New file.
* libgnat/a-wtfiau.ads, libgnat/a-wtfiau.adb: New generic unit.
* libgnat/a-wtfiio.adb: Reimplement.
* libgnat/a-wtfiio__128.adb: New file.
* libgnat/a-ztdeau.ads, libgnat/a-ztdeau.adb: Reimplement as
generic unit.
* libgnat/a-ztdeio.adb: Reimplement.
* libgnat/a-ztdeio__128.adb: New file.
* libgnat/a-ztfiau.ads, libgnat/a-ztfiau.adb: New generic unit.
* libgnat/a-ztfiio.adb: Reimplement.
* libgnat/a-ztfiio__128.adb: New file.
* libgnat/g-rannum.adb (Random_Decimal_Fixed): Use a subtype of the
appropiate size for the instantiation.
(Random_Ordinary_Fixed): Likewise.
* libgnat/s-arit32.ads, libgnat/s-arit32.adb: New support unit.
* libgnat/s-fode128.ads: New instantiation.
* libgnat/s-fode32.ads: Likewise.
* libgnat/s-fode64.ads: Likewise.
* libgnat/s-fofi128.ads: Likewise.
* libgnat/s-fofi32.ads: Likewise.
* libgnat/s-fofi64.ads: Likewise.
* libgnat/s-fore_d.ads, libgnat/s-fore_d.adb: New generic unit.
* libgnat/s-fore_f.ads, libgnat/s-fore_f.adb: Likewise.
* libgnat/s-fore.ads, libgnat/s-fore.adb: Rename into...
* libgnat/s-forrea.ads, libgnat/s-forrea.adb: ...this.
* libgnat/s-imaged.ads, libgnat/s-imaged.adb: New generic unit.
* libgnat/s-imagef.ads, libgnat/s-imagef.adb: Likewise, taken
from a-tifiio.adb.
* libgnat/s-imde128.ads: New instantiation.
* libgnat/s-imde32.ads: Likewise.
* libgnat/s-imde64.ads: Likewise.
* libgnat/s-imfi128.ads: Likewise.
* libgnat/s-imfi32.ads: Likewise.
* libgnat/s-imfi64.ads: Likewise.
* libgnat/s-imgdec.ads, libgnat/s-imgdec.adb: Delete.
* libgnat/s-imglld.ads, libgnat/s-imglld.adb: Likewise.
* libgnat/s-imgrea.adb (Set_Image_Real): Replace Sign local variable
with Minus local variable for the sake of consistency.
* libgnat/s-imguti.ads, libgnat/s-imguti.adb: New support unit.
* libgnat/s-vade128.ads: New instantiation.
* libgnat/s-vade32.ads: Likewise.
* libgnat/s-vade64.ads: Likewise.
* libgnat/s-vafi128.ads: Likewise.
* libgnat/s-vafi32.ads: Likewise.
* libgnat/s-vafi64.ads: Likewise.
* libgnat/s-valdec.ads, libgnat/s-valdec.adb: Delete.
* libgnat/s-vallld.ads, libgnat/s-vallld.adb: Likewise.
* libgnat/s-valued.ads, libgnat/s-valued.adb: New generic unit.
* libgnat/s-valuef.ads, libgnat/s-valuef.adb: Likewise.
* libgnat/s-valuei.adb: Minor rewording.
* libgnat/s-valrea.adb: Move bulk of implementation to...
* libgnat/s-valuer.ads, libgnat/s-valuer.adb: ...here.  New
generic unit.
* libgnat/system-aix.ads (Max_Mantissa): Adjust.
* libgnat/system-darwin-arm.ads (Max_Mantissa): Likewise.
* libgnat/system-darwin-ppc.ads (Max_Mantissa): Likewise.
* libgnat/system-darwin-x86.ads (Max_Mantissa): Likewise.
* libgnat/system-djgpp.ads (Max_Mantissa): Likewise.
* libgnat/system-dragonfly-x86_64.ads (Max_Mantissa): Likewise.
* libgnat/system-freebsd.ads (Max_Mantissa): Likewise.
* libgnat/system-hpux-ia64.ads (Max_Mantissa): Likewise.
* libgnat/system-hpux.ads (Max_Mantissa): Likewise.
* libgnat/system-linux-alpha.ads (Max_Mantissa): Likewise.
* libgnat/system-linux-arm.ads (Max_Mantissa): Likewise.
* libgnat/system-linux-hppa.ads (Max_Mantissa): Likewise.
* libgnat/system-linux-ia64.ads (Max_Mantissa): Likewise.
* libgnat/system-linux-m68k.ads (Max_Mantissa): Likewise.
* libgnat/system-linux-mips.ads (Max_Mantissa): Likewise.
* libgnat/system-linux-ppc.ads (Max_Mantissa): Likewise.
* libgnat/system-linux-riscv.ads (Max_Mantissa): Likewise.
* libgnat/system-linux-s390.ads (Max_Mantissa): Likewise.
* libgnat/system-linux-sh4.ads (Max_Mantissa): Likewise.
* libgnat/system-linux-sparc.ads (Max_Mantissa): Likewise.
* libgnat/system-linux-x86.ads (Max_Mantissa): Likewise.
* libgnat/system-lynxos178-ppc.ads (Max_Mantissa): Likewise.
* libgnat/system-lynxos178-x86.ads (Max_Mantissa): Likewise.
* libgnat/system-mingw.ads (Max_Mantissa): Likewise.
* libgnat/system-qnx-aarch64.ads (Max_Mantissa): Likewise.
* libgnat/system-rtems.ads (Max_Mantissa): Likewise.
* libgnat/system-solaris-sparc.ads (Max_Mantissa): Likewise.
* libgnat/system-solaris-x86.ads (Max_Mantissa): Likewise.
* libgnat/system-vxworks-arm-rtp-smp.ads (Max_Mantissa): Likewise.
* libgnat/system-vxworks-arm-rtp.ads (Max_Mantissa): Likewise.
* libgnat/system-vxworks-arm.ads (Max_Mantissa): Likewise.
* libgnat/system-vxworks-e500-kernel.ads (Max_Mantissa): Likewise.
* libgnat/system-vxworks-e500-rtp-smp.ads (Max_Mantissa): Likewise.
* libgnat/system-vxworks-e500-rtp.ads (Max_Mantissa): Likewise.
* libgnat/system-vxworks-e500-vthread.ads (Max_Mantissa): Likewise.
* libgnat/system-vxworks-ppc-kernel.ads (Max_Mantissa): Likewise.
* libgnat/system-vxworks-ppc-ravenscar.ads (Max_Mantissa): Likewise.
* libgnat/system-vxworks-ppc-rtp-smp.ads (Max_Mantissa): Likewise.
* libgnat/system-vxworks-ppc-rtp.ads (Max_Mantissa): Likewise.
* libgnat/system-vxworks-ppc-vthread.ads (Max_Mantissa): Likewise.
* libgnat/system-vxworks-ppc.ads (Max_Mantissa): Likewise.
* libgnat/system-vxworks-x86-kernel.ads (Max_Mantissa): Likewise.
* libgnat/system-vxworks-x86-rtp-smp.ads (Max_Mantissa): Likewise.
* libgnat/system-vxworks-x86-rtp.ads (Max_Mantissa): Likewise.
* libgnat/system-vxworks-x86-vthread.ads (Max_Mantissa): Likewise.
* libgnat/system-vxworks-x86.ads (Max_Mantissa): Likewise.
* libgnat/system-vxworks7-aarch64-rtp-smp.ads (Max_Mantissa):
Likewise.
* libgnat/system-vxworks7-aarch64.ads (Max_Mantissa): Likewise.
* libgnat/system-vxworks7-arm-rtp-smp.ads (Max_Mantissa): Likewise.
* libgnat/system-vxworks7-arm.ads (Max_Mantissa): Likewise.
* libgnat/system-vxworks7-e500-kernel.ads (Max_Mantissa): Likewise.
* libgnat/system-vxworks7-e500-rtp-smp.ads (Max_Mantissa): Likewise.
* libgnat/system-vxworks7-e500-rtp.ads (Max_Mantissa): Likewise.
* libgnat/system-vxworks7-ppc-kernel.ads (Max_Mantissa): Likewise.
* libgnat/system-vxworks7-ppc-rtp-smp.ads (Max_Mantissa): Likewise.
* libgnat/system-vxworks7-ppc-rtp.ads (Max_Mantissa): Likewise.
* libgnat/system-vxworks7-ppc64-kernel.ads (Max_Mantissa): Likewise.
* libgnat/system-vxworks7-ppc64-rtp-smp.ads (Max_Mantissa): Likewise.
* libgnat/system-vxworks7-x86-kernel.ads (Max_Mantissa): Likewise.
* libgnat/system-vxworks7-x86-rtp-smp.ads (Max_Mantissa): Likewise.
* libgnat/system-vxworks7-x86-rtp.ads (Max_Mantissa): Likewise.
* libgnat/system-vxworks7-x86_64-kernel.ads (Max_Mantissa): Likewise.
* libgnat/system-vxworks7-x86_64-rtp-smp.ads (Max_Mantissa): Likewise.

gcc/testsuite/

* gnat.dg/multfixed.adb: Robustify.

3 years ago[Ada] Add the remark concerning the use of Image_Ordinary_Fixed_Point
Liaiss Merzougue [Fri, 30 Oct 2020 08:19:09 +0000 (08:19 +0000)] 
[Ada] Add the remark concerning the use of Image_Ordinary_Fixed_Point

gcc/ada/

* libgnat/s-imgrea.ads (Image_Ordinary_Fixed_Point): Add a
remark concerning the irrelevant use of Inf and -0.0

3 years ago[Ada] Add support for .c output file
Arnaud Charlet [Thu, 29 Oct 2020 09:41:22 +0000 (10:41 +0100)] 
[Ada] Add support for .c output file

gcc/ada/

* osint-c.adb (Set_Output_Object_File_Name): Add support for
.c output file.

3 years ago[Ada] Reuse Is_Generic_Subprogram where possible
Piotr Trojanek [Wed, 28 Oct 2020 08:27:18 +0000 (09:27 +0100)] 
[Ada] Reuse Is_Generic_Subprogram where possible

gcc/ada/

* lib-writ.adb, sem_ch8.adb, sem_prag.adb: Use
Is_Generic_Subprogram instead of low-level membership tests.

3 years ago[Ada] Minor reformatting and a typo fix
Gary Dismukes [Wed, 28 Oct 2020 05:08:44 +0000 (01:08 -0400)] 
[Ada] Minor reformatting and a typo fix

gcc/ada/

* sem_ch6.adb (Analyze_Call_And_Resolve): Reformatted a comment.
* sem_prag.adb (Process_Restrictions_Or_Restriction_Warnings):
Fixed a typo.

3 years ago[Ada] Replace warning suppression with assertion
Piotr Trojanek [Tue, 20 Oct 2020 08:15:20 +0000 (10:15 +0200)] 
[Ada] Replace warning suppression with assertion

gcc/ada/

* sem_res.adb (Resolve_Membership_Op): Replace pragma Warnings
with pragma Assert.