Commit Graph

194178 Commits

Author SHA1 Message Date
David Malcolm
894ddeacda Add 'final' and 'override' on dom_walker vfunc impls
gcc/ChangeLog:
	* compare-elim.cc: Add "final" and "override" to dom_walker vfunc
	implementations, removing redundant "virtual" as appropriate.
	* gimple-ssa-strength-reduction.cc: Likewise.
	* ipa-prop.cc: Likewise.
	* rtl-ssa/blocks.cc: Likewise.
	* tree-into-ssa.cc: Likewise.
	* tree-ssa-dom.cc: Likewise.
	* tree-ssa-math-opts.cc: Likewise.
	* tree-ssa-phiopt.cc: Likewise.
	* tree-ssa-propagate.cc: Likewise.
	* tree-ssa-sccvn.cc: Likewise.
	* tree-ssa-strlen.cc: Likewise.
	* tree-ssa-uncprop.cc: Likewise.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
2022-06-27 17:00:33 -04:00
David Malcolm
725793af78 Add 'final' and 'override' to opt_pass vfunc impls
gcc/ChangeLog:
	* adjust-alignment.cc: Add "final" and "override" to opt_pass
	vfunc implementations, removing redundant "virtual" as
	appropriate.
	* asan.cc: Likewise.
	* auto-inc-dec.cc: Likewise.
	* auto-profile.cc: Likewise.
	* bb-reorder.cc: Likewise.
	* cfgcleanup.cc: Likewise.
	* cfgexpand.cc: Likewise.
	* cfgrtl.cc: Likewise.
	* cgraphbuild.cc: Likewise.
	* combine-stack-adj.cc: Likewise.
	* combine.cc: Likewise.
	* compare-elim.cc: Likewise.
	* config/i386/i386-features.cc: Likewise.
	* coroutine-passes.cc: Likewise.
	* cprop.cc: Likewise.
	* cse.cc: Likewise.
	* dce.cc: Likewise.
	* df-core.cc: Likewise.
	* dse.cc: Likewise.
	* dwarf2cfi.cc: Likewise.
	* early-remat.cc: Likewise.
	* except.cc: Likewise.
	* final.cc: Likewise.
	* function.cc: Likewise.
	* fwprop.cc: Likewise.
	* gcse.cc: Likewise.
	* gimple-harden-conditionals.cc: Likewise.
	* gimple-if-to-switch.cc: Likewise.
	* gimple-isel.cc: Likewise.
	* gimple-laddress.cc: Likewise.
	* gimple-loop-interchange.cc: Likewise.
	* gimple-loop-jam.cc: Likewise.
	* gimple-loop-versioning.cc: Likewise.
	* gimple-low.cc: Likewise.
	* gimple-ssa-backprop.cc: Likewise.
	* gimple-ssa-evrp.cc: Likewise.
	* gimple-ssa-isolate-paths.cc: Likewise.
	* gimple-ssa-nonnull-compare.cc: Likewise.
	* gimple-ssa-split-paths.cc: Likewise.
	* gimple-ssa-store-merging.cc: Likewise.
	* gimple-ssa-strength-reduction.cc: Likewise.
	* gimple-ssa-warn-access.cc: Likewise.
	* gimple-ssa-warn-alloca.cc: Likewise.
	* gimple-ssa-warn-restrict.cc: Likewise.
	* gimple-warn-recursion.cc: Likewise.
	* graphite.cc: Likewise.
	* ifcvt.cc: Likewise.
	* init-regs.cc: Likewise.
	* ipa-comdats.cc: Likewise.
	* ipa-cp.cc: Likewise.
	* ipa-devirt.cc: Likewise.
	* ipa-fnsummary.cc: Likewise.
	* ipa-free-lang-data.cc: Likewise.
	* ipa-icf.cc: Likewise.
	* ipa-inline.cc: Likewise.
	* ipa-modref.cc: Likewise.
	* ipa-profile.cc: Likewise.
	* ipa-pure-const.cc: Likewise.
	* ipa-reference.cc: Likewise.
	* ipa-split.cc: Likewise.
	* ipa-sra.cc: Likewise.
	* ipa-visibility.cc: Likewise.
	* ipa.cc: Likewise.
	* ira.cc: Likewise.
	* jump.cc: Likewise.
	* loop-init.cc: Likewise.
	* lower-subreg.cc: Likewise.
	* mode-switching.cc: Likewise.
	* modulo-sched.cc: Likewise.
	* multiple_target.cc: Likewise.
	* omp-expand.cc: Likewise.
	* omp-low.cc: Likewise.
	* omp-oacc-kernels-decompose.cc: Likewise.
	* omp-oacc-neuter-broadcast.cc: Likewise.
	* omp-offload.cc: Likewise.
	* omp-simd-clone.cc: Likewise.
	* passes.cc: Likewise.
	* postreload-gcse.cc: Likewise.
	* postreload.cc: Likewise.
	* predict.cc: Likewise.
	* recog.cc: Likewise.
	* ree.cc: Likewise.
	* reg-stack.cc: Likewise.
	* regcprop.cc: Likewise.
	* reginfo.cc: Likewise.
	* regrename.cc: Likewise.
	* reorg.cc: Likewise.
	* sancov.cc: Likewise.
	* sanopt.cc: Likewise.
	* sched-rgn.cc: Likewise.
	* stack-ptr-mod.cc: Likewise.
	* store-motion.cc: Likewise.
	* tracer.cc: Likewise.
	* trans-mem.cc: Likewise.
	* tree-call-cdce.cc: Likewise.
	* tree-cfg.cc: Likewise.
	* tree-cfgcleanup.cc: Likewise.
	* tree-complex.cc: Likewise.
	* tree-eh.cc: Likewise.
	* tree-emutls.cc: Likewise.
	* tree-if-conv.cc: Likewise.
	* tree-into-ssa.cc: Likewise.
	* tree-loop-distribution.cc: Likewise.
	* tree-nrv.cc: Likewise.
	* tree-object-size.cc: Likewise.
	* tree-parloops.cc: Likewise.
	* tree-predcom.cc: Likewise.
	* tree-profile.cc: Likewise.
	* tree-sra.cc: Likewise.
	* tree-ssa-ccp.cc: Likewise.
	* tree-ssa-copy.cc: Likewise.
	* tree-ssa-dce.cc: Likewise.
	* tree-ssa-dom.cc: Likewise.
	* tree-ssa-dse.cc: Likewise.
	* tree-ssa-forwprop.cc: Likewise.
	* tree-ssa-ifcombine.cc: Likewise.
	* tree-ssa-loop-ch.cc: Likewise.
	* tree-ssa-loop-im.cc: Likewise.
	* tree-ssa-loop-ivcanon.cc: Likewise.
	* tree-ssa-loop-prefetch.cc: Likewise.
	* tree-ssa-loop-split.cc: Likewise.
	* tree-ssa-loop-unswitch.cc: Likewise.
	* tree-ssa-loop.cc: Likewise.
	* tree-ssa-math-opts.cc: Likewise.
	* tree-ssa-phiopt.cc: Likewise.
	* tree-ssa-phiprop.cc: Likewise.
	* tree-ssa-pre.cc: Likewise.
	* tree-ssa-reassoc.cc: Likewise.
	* tree-ssa-sccvn.cc: Likewise.
	* tree-ssa-sink.cc: Likewise.
	* tree-ssa-strlen.cc: Likewise.
	* tree-ssa-structalias.cc: Likewise.
	* tree-ssa-uncprop.cc: Likewise.
	* tree-ssa-uninit.cc: Likewise.
	* tree-ssanames.cc: Likewise.
	* tree-stdarg.cc: Likewise.
	* tree-switch-conversion.cc: Likewise.
	* tree-tailcall.cc: Likewise.
	* tree-vect-generic.cc: Likewise.
	* tree-vectorizer.cc: Likewise.
	* tree-vrp.cc: Likewise.
	* tsan.cc: Likewise.
	* ubsan.cc: Likewise.
	* var-tracking.cc: Likewise.
	* vtable-verify.cc: Likewise.
	* web.cc: Likewise.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
2022-06-27 17:00:33 -04:00
Ian Lance Taylor
6ce49a6e69 libbacktrace: replace fgrep with grep in configure script
Patch by Xi Ruoyao.

	* configure.ac: Use grep instead of fgrep.
	* configure, Makefile.in: Regenerate.
2022-06-27 13:00:01 -07:00
Marek Polacek
508231d544 c++: Add fixed test [PR89197]
Fixed since bug 97899 was fixed.

	PR c++/89197

gcc/testsuite/ChangeLog:

	* g++.dg/cpp0x/initlist130.C: New test.
2022-06-27 14:55:53 -04:00
Ian Lance Taylor
5f6b649403 compiler: don't use sink as parameter in method expression thunk
Also fix a couple of cases where the error led to a later compiler crash.

Test case is https://go.dev/cl/414336.

Fixes golang/go#52871

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/414354
2022-06-27 09:53:22 -07:00
Ian Lance Taylor
722750a44a compiler: always initialize mpfr in integer import
Test case is https://go.dev/cl/413980.

Fixes golang/go#52862

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/413981
2022-06-27 09:50:39 -07:00
Andrew Stubbs
a1f8a3860f amdgcn: test global constructors
The tests are disabled for historical reasons only.

gcc/testsuite/ChangeLog:

	* lib/target-supports.exp (check_effective_target_global_constructor):
	Remove amdgcn.
2022-06-27 15:11:29 +01:00
Jakub Jelinek
00063459f6 testsuite: Fix up pr106070.c test [PR106070]
The test FAILs on 32-bit targets, because when unsigned long
is 32-bit, (unsigned long) -1 isn't 0xffffffffffffffff.
The options to fix this would be either using -1UL, or switch
to unsigned long long and using -1ULL, I chose the latter because
the test then FAILs in r13-1242 even on 32-bit targets.
And while at it, some deobfuscation and formatting tweaks.

2022-06-27  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/106070
	* gcc.dg/torture/pr106070.c: Use unsigned long long instead of
	unsigned long and -1ULL instead of 0xffffffffffffffff, deobcuscate
	and improve formatting.
2022-06-27 15:36:14 +02:00
Alexandre Oliva
01e094f82d libstdc++: testsuite: use cmath long double overloads
In case we need to supplement the C standard library with additional
definitions for float and long double, the declarations expected to be
in the C headers may not be there.  Rely on the cmath overloads
instead.


for  libstdc++-v3/ChangeLog

	* testsuite/20_util/to_chars/long_double.cc: Use cmath
	long double overloads for nexttoward and ldexp.
2022-06-27 10:34:19 -03:00
Alexandre Oliva
8fce31f69b libstdc++: testsuite: require cmath for exp simd
simd_math.h assumes declarations for many C99 functions to be present,
that libstdc++ doesn't add to target systems that don't have them in
the C library.

Add the C99 math requirement to tests for simd features, so that they
don't fail because of limitations of the target C library.


for  libstdc++-v3/ChangeLog

	* testsuite/experimental/simd/standard_abi_usable.cc: Require
	cmath support.
	* testsuite/experimental/simd/standard_abi_usable_2.cc:
	Likewise.
2022-06-27 10:34:19 -03:00
Alexandre Oliva
3e3744d37e libstdc++: testsuite: complex proj requirements
The template version of complex::proj returns its argument without
testing for infinities, and that's all we have when neither C99
complex nor C99 math functions are available, and it seems too hard to
do better without isinf and copysign.

I suppose just calling them and expecting users will supply
specializations as needed has been ruled out, and so has refraining
from defining it when it can't be implemented correctly.

It's pointless to run the proj.cc test under these circumstances, so
arrange for it to be skipped.  In an unusual way, after trying to
introduce dg-require tests for ccomplex-or-cmath, and found their
results to be misleading due to variations across -std=* versions.


for  libstdc++-v3/ChangeLog

	* testsuite/26_numerics/complex/proj.cc: Skip test in the
	circumstances in which the implementation of proj is known to
	be broken.
2022-06-27 10:34:18 -03:00
Alexandre Oliva
0a3bb459e5 testsuite: pthread: call sched_yield for non-preemptive targets
Systems without preemptive multi-threading require sched_yield calls
to be placed at points in which a context switch might be needed to
enable the test to complete.


for  gcc/testsuite/ChangeLog

	* gcc.dg/atomic/c11-atomic-exec-4.c: Call sched_yield.
	* gcc.dg/atomic/c11-atomic-exec-5.c: Likewise.
	* gcc.dg/atomic/pr80640-2.c: Likewise.
	* gcc.dg/atomic/pr80640.c: Likewise.
	* gcc.dg/atomic/pr81316.c: Likewise.
	* gcc.dg/di-sync-multithread.c: Likewise.
2022-06-27 10:34:17 -03:00
Alexandre Oliva
486893b1d3 libstdc++: check for openat with dirfd in std::filesystem
In the recent patch to check for openat, I missed an occurrence of
dirfd in std::filesystem.


for  libstdc++-v3/ChangeLog

	* src/c++17/fs_dir.cc (dir_and_pathname): Use dirfd if
	_GLIBCXX_HAVE_OPENAT.
2022-06-27 10:34:16 -03:00
Alexandre Oliva
ca35ebaec8 libstdc++: testsuite: conditionalize another symlink test
In the recent patch that introduced NO_SYMLINKS, I missed one of the
testcases that created symlinks.


for  libstdc++-v3/ChangeLog

	* testsuite/27_io/filesystem/iterators/recursive_directory_iterator.cc
	(test06): Don't create symlinks when NO_SYMLINKS is defined.
2022-06-27 10:34:15 -03:00
Alexandre Oliva
250b95a994 libstdc++: xfail experimental/net tests on rtems
Some net/timer/waitable tests fail on rtems because poll() is not
available.

The above, as well as net/internet/resolver/ops tests and
net/timer/waitable/cons.cc, will fail early at runtime unless mkfifo
is enabled in the RTEMS configuration, because the io_context ctor
throws when pipe() fails.

However, even enabling pipes and adjusting the net_ts link command to
use --gc-sections for -lbsd as recommended, both
net/internet/resolver/ops still fail at runtime.


for  libstdc++-v3/ChangeLog

	* testsuite/lib/dg-options.exp (add_options_for_net_ts):
	Add -Wl,--gc-sections for RTEMS targets.
	* testsuite/experimental/net/timer/waitable/dest.cc: Link-time
	xfail on RTEMS.
	* testsuite/experimental/net/timer/waitable/ops.cc: Likewise.
	* testsuite/experimental/net/internet/resolver/ops/lookup.cc:
	Execution-time xfail on RTEMS.
	* testsuite/experimental/net/internet/resolver/ops/reverse.cc:
	Likewise.
2022-06-27 10:34:14 -03:00
Andrew Stubbs
b06a282921 amdgcn: remove obsolete assembler workarounds
This nonsense is no longer required, now that the minimum supported
assembler version is LLVM 13.0.1.

gcc/ChangeLog:

	* config/gcn/gcn.md (*movbi): Remove assembler bug workarounds.
	(jump): Likewise.
	(movdi_symbol_save_scc): Likewise.
2022-06-27 13:47:45 +01:00
Jonathan Wakely
c10a7546cf libstdc++: testsuite: Add missing <string> header
libstdc++-v3/ChangeLog:

	* testsuite/ext/mt_allocator/22309_thread.cc: Include <string>.
2022-06-27 11:08:17 +01:00
Joel Brobecker
30a8f67295 libstdc++: testsuite: avoid predicable mkstemp
We have noticed that, on RTEMS, a small number of testscases are
failing because two calls to this method return the same filename.
This happens for instance in 27_io/filesystem/operations/copy_file.cc
where it does:

  auto from = __gnu_test::nonexistent_path();
  auto to = __gnu_test::nonexistent_path();

We tracked this issue down to the fact that the implementation of
mkstemp on that system appears to use a very predictable algorithm
for chosing the name of the temporary file, where the same filename
appears to be tried in the same order, regardless of past calls.
So, as long as the file gets deleted after a call to mkstemp (something
we do here in our nonexistent_path method), the next call to mkstemps
ends up returning the same filename, causing the collision we se above.

This commit enhances the __gnu_test::nonexistent_path method to
introduce in the filename being returned a counter which gets
incremented at every call of this method.

Co-authored-by: Jonathan Wakely <jwakely@redhat.com>

libstdc++-v3/ChangeLog:

	* testsuite/util/testsuite_fs.h (__gnu_test::nonexistent_path):
	Always include a counter in the filename returned.
2022-06-27 11:08:17 +01:00
Jonathan Wakely
a364488f7a libstdc++: Make std::move_only_function never valueless in std::variant
This is not suitable to backport, as it affects the ABI of std::variant
and so isn't appropriate for a release branch.

libstdc++-v3/ChangeLog:

	* include/bits/move_only_function.h (_Never_valueless_alt):
	Define partial specialization for std::move_only_function.
2022-06-27 11:08:16 +01:00
Jonathan Wakely
da55353e95 libstdc++: Simplify std::variant construction using variable templates
libstdc++-v3/ChangeLog:

	* include/std/variant (_Build_FUN::_S_fun): Define fallback case
	as deleted.
	(__accepted_index, _Extra_visit_slot_needed): Replace class
	templates with variable templates.
2022-06-27 11:08:16 +01:00
Jonathan Wakely
6177f60d91 libstdc++: Simplify fs::path construction using variable template
libstdc++-v3/ChangeLog:

	* include/bits/fs_path.h (__is_path_iter_src): Replace class
	template with variable template.
2022-06-27 11:08:16 +01:00
Jonathan Wakely
48099f7daf libstdc++: Invert relationship between std::is_clock and std::is_clock_v
This redefines std::is_clock in terms of std::is_clock_v, instead of the
other way around. This avoids instantiatng the class template for code
that only uses the variable template.

libstdc++-v3/ChangeLog:

	* include/bits/chrono.h (is_clock_v): Define to false.
	(is_clock_v<T>): Define partial specialization for true cases.
	(is_clock): Define in terms of is_clock_v.
2022-06-27 11:08:16 +01:00
Tom de Vries
153689603f [gdb/build] Fix gdbserver build with -fsanitize=thread
When building gdbserver with -fsanitize=thread (added to CFLAGS/CXXFLAGS) we
run into:
...
ld: ../libiberty/libiberty.a(safe-ctype.o): warning: relocation against \
  `__tsan_init' in read-only section `.text'
ld: ../libiberty/libiberty.a(safe-ctype.o): relocation R_X86_64_PC32 \
  against symbol `__tsan_init' can not be used when making a shared object; \
  recompile with -fPIC
ld: final link failed: bad value
collect2: error: ld returned 1 exit status
make[1]: *** [libinproctrace.so] Error 1
...
which looks similar to what is described in commit 78e49486944 ("[gdb/build]
Fix gdbserver build with -fsanitize=address").

The gdbserver component builds a shared library libinproctrace.so, which uses
libiberty and therefore requires the pic variant.  The gdbserver Makefile is
setup to use this variant, if available, but it's not there.

Fix this by listing gdbserver in the toplevel configure alongside libcc1, as a
component that needs the libiberty pic variant, setting:
...
extra_host_libiberty_configure_flags=--enable-shared
...

Tested on x86_64-linux.

ChangeLog:

2022-06-27  Tom de Vries  <tdevries@suse.de>

	* configure.ac: Build libiberty pic variant for gdbserver.
	* configure: Regenerate.
2022-06-27 10:52:23 +02:00
Martin Liska
2669cae081 lto-plugin: make claim_file_handler thread-safe
lto-plugin/ChangeLog:

	* lto-plugin.c (plugin_lock): New lock.
	(claim_file_handler): Use mutex for critical section.
	(onload): Initialize mutex.
	* configure.ac: Check for pthread.h.
	* configure: Regenerate.
	* config.h.in: Regenerate.
2022-06-27 10:12:08 +02:00
Roger Sayle
64d4f27a0c Implement __imag__ of float _Complex using shufps on x86_64.
This patch is a follow-up improvement to my recent patch for
PR rtl-optimization/7061.  That patch added the test case
gcc.target/i386/pr7061-2.c:

float im(float _Complex a) { return __imag__ a; }

For which GCC on x86_64 currently generates:

        movq    %xmm0, %rax
        shrq    $32, %rax
        movd    %eax, %xmm0
        ret

but with this patch we now generate (the same as LLVM):

        shufps  $85, %xmm0, %xmm0
        ret

This is achieved by providing a define_insn_and_split that allows
truncated lshiftrt:DI by 32 to be performed on either SSE or general
regs, where if the register allocator prefers to use SSE, we split
to a shufps_v4si, or if not, we use a regular shrq.

2022-06-27  Roger Sayle  <roger@nextmovesoftware.com>

gcc/ChangeLog
	PR rtl-optimization/7061
	* config/i386/i386.md (*highpartdisi2): New define_insn_and_split.

gcc/testsuite/ChangeLog
	PR rtl-optimization/7061
	* gcc.target/i386/pr7061-2.c: Update to look for shufps.
2022-06-27 07:47:40 +01:00
Roger Sayle
f3f73e86ec [PATCH] PR tree-optimization/94026: Simplify (X>>8)&6 != 0 as X&1536 != 0.
This patch implements the missed optimization described in PR 94026,
where a the shift can be eliminated from the sequence of a shift,
followed by a bit-wise AND followed by an equality/inequality test.
Specifically, ((X << C1) & C2) cmp C3 into (X & (C2 >> C1)) cmp (C3 >> C1)
and likewise ((X >> C1) & C2) cmp C3 into (X & (C2 << C1)) cmp (C3 << C1)
where cmp is == or !=, and C1, C2 and C3 are integer constants.
The example in the subject line is taken from the hot function
self_atari from the Go program Leela (in SPEC CPU 2017).

2022-06-27  Roger Sayle  <roger@nextmovesoftware.com>

gcc/ChangeLog
	PR tree-optimization/94026
	* match.pd (((X << C1) & C2) eq/ne C3): New simplification.
	(((X >> C1) & C2) eq/ne C3): Likewise.

gcc/testsuite/ChangeLog
	PR tree-optimization/94026
	* gcc.dg/pr94026.c: New test case.
2022-06-27 07:44:49 +01:00
Prathamesh Kulkarni
2ae7895416 Emit asmname if set for decl with -fdump-statistics-asmname.
gcc/ChangeLog:

	* statistics.cc: Include tree.h.
	(get_function_name): New function.
	(statistics_fini_pass_2): Call get_function_name instead of
	current_function_name.
	(statistics_counter_event): Call get_function_name instead of
	function_name.
	(statistics_histogram_event): Likewise.
2022-06-27 11:55:45 +05:30
Takayuki 'January June' Suwa
773dffc50f xtensa: Optimize integer constant addition that is between -32896 and 32639
Such constants are often subject to the constant synthesis:

    int test(int a) {
      return a - 31999;
    }

    test:
	movi	a3, 1
	addmi	a3, a3, -0x7d00
	add	a2, a2, a3
	ret

This patch optimizes such case as follows:

    test:
	addi	a2, a2, 1
	addmi	a2, a2, -0x7d00
	ret

gcc/ChangeLog:

	* config/xtensa/xtensa.md:
	Suppress unnecessary emitting nop insn in the split patterns for
	integer/FP constant synthesis, and add new peephole2 pattern that
	folds such synthesized additions.
2022-06-26 20:40:42 -07:00
GCC Administrator
b2b72757b2 Daily bump. 2022-06-27 00:16:20 +00:00
Harald Anlauf
ff35dbc020 Fortran: fix simplification of INDEX(str1,str2) [PR105691]
gcc/fortran/ChangeLog:

	PR fortran/105691
	* simplify.cc (gfc_simplify_index): Replace old simplification
	code by the equivalent of the runtime library implementation.  Use
	HOST_WIDE_INT instead of int for string index, length variables.

gcc/testsuite/ChangeLog:

	PR fortran/105691
	* gfortran.dg/index_6.f90: New test.
2022-06-26 22:06:12 +02:00
Harald Anlauf
a312407bd7 Fortran: handle explicit-shape specs with constant bounds [PR105954]
gcc/fortran/ChangeLog:

	PR fortran/105954
	* decl.cc (variable_decl): Adjust upper bounds for explicit-shape
	specs with constant bound expressions to ensure non-negative
	extents.

gcc/testsuite/ChangeLog:

	PR fortran/105954
	* gfortran.dg/pr105954.f90: New test.
2022-06-26 22:01:49 +02:00
Vineet Gupta
ff01849dcc [PATCH] testsuite: constraint some of fp tests to hard_float
These tests validate fp conversions with various rounding modes which
would not work on soft-float ABIs.

On -march=rv64imac/-mabi=lp64 this reduces 5 unique failures (overall 35
due to multi flag combination builds)

gcc/testsuite/Changelog:
	* gcc.dg/torture/fp-double-convert-float-1.c: Add
	dg-require-effective-target hard_float.
	* gcc.dg/torture/fp-int-convert-timode-3.c: Ditto.
	* gcc.dg/torture/fp-int-convert-timode-4.c: Ditto.
	* gcc.dg/torture/fp-uint64-convert-double-1.c: Ditto.
	* gcc.dg/torture/fp-uint64-convert-double-2.c: Ditto.
2022-06-26 15:03:52 -04:00
Simon Marchi
1f237573ca Make it easier to rebuild configure files.
Add

  AC_CONFIG_MACRO_DIRS([../config])

So that just running:

  $ autoreconf -vf

... does the right thing (no need to specify -I ../config).

Note: I don't have access to the gcc repo, so if this patch is approved,
can somebody push it there on my behalf?  I can push it to binutils-gdb.

libiberty/ChangeLog:

	* configure.ac: Add AC_CONFIG_MACRO_DIRS call.
	* configure: Re-generate.
2022-06-26 14:43:33 -04:00
Lewis Hyatt
57988cbe73 libcpp: Update cpp_wcwidth() to Unicode 14.0.0
The procedure detailed in contrib/unicode/README was followed with nothing
notable coming up. The glibc scripts did not require any update, so the
only change was retrieving new versions of the Unicode data files and
rerunning gen_wcwidth.py.

contrib/ChangeLog:

	* unicode/EastAsianWidth.txt: Update to Unicode 14.0.0.
	* unicode/PropList.txt: Likewise.
	* unicode/README: Likewise.
	* unicode/UnicodeData.txt: Likewise.

libcpp/ChangeLog:

	* generated_cpp_wcwidth.h: Generated from updated Unicode data files.
2022-06-26 14:13:26 -04:00
Dimitar Dimitrov
d230906bf6 testsuite: Adjust btf-bitfields-1.c for default_packed
If target packs structures by default, the bitfield offset which the
test validates must be adjusted to not include padding.

gcc/testsuite/ChangeLog:

	* gcc.dg/debug/btf/btf-bitfields-1.c: Adjust the checked offsets
	for targets which pack structures by default.

Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
2022-06-26 20:32:19 +03:00
Aldy Hernandez
80ace9185d XFAIL a test in g++.dg/warn/Wstringop-overflow-4.C
As per the explanation in the test, and in the DOM conversion to
ranger patch, this is a known regression.  I had mentioned I would
XFAIL this test, but forgot to do so.  There is an analysis in the
test itself as to what is going on.

Tested on x86-64 Linux.

gcc/testsuite/ChangeLog:

	* g++.dg/warn/Wstringop-overflow-4.C: XFAIL a test.
2022-06-26 17:30:18 +02:00
Iain Sandoe
1edfc8f2d3 configure, Darwin: Correct a pasto in host-shared processing.
We do, of course, mean $host not $target in this case.  Corrected thus.

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

ChangeLog:

	* configure: Regenerate.
	* configure.ac: Correct use of $host.
2022-06-26 15:50:42 +01:00
GCC Administrator
8750978184 Daily bump. 2022-06-26 00:16:33 +00:00
Aldy Hernandez
8c99e307b2 Convert DOM to use Ranger rather than EVRP
[Jeff, this is the same patch I sent you last week with minor tweaks
to the commit message.]

[Despite the verbosity of the message, this is actually a pretty
straightforward patch.  It should've gone in last cycle, but there
was a nagging regression I couldn't get to until after stage1
had closed.]

There are 3 uses of EVRP in DOM that must be converted.
Unfortunately, they need to be converted in one go, so further
splitting of this patch would be problematic.

There's nothing here earth shattering.  It's all pretty obvious in
retrospect, but I've added a short description of each use to aid in
reviewing:

* Convert evrp use in cprop to ranger.

  This is easy, as cprop in DOM was converted to the ranger API last
  cycle, so this is just a matter of using a ranger instead of an
  evrp_range_analyzer.

* Convert evrp use in threader to ranger.

  The idea here is to use the hybrid approach we used for the initial
  VRP threader conversion last cycle.  The DOM threader will continue
  using the forward threader infrastructure while continuing to query
  DOM data structures, and only if the conditional does not relsolve,
  using the ranger.  This gives us the best of both worlds, and is a
  proven approach.

  Furthermore, as frange and prange come live in the next cycle, we
  can move away from the forward threader altogether, and just add
  another backward threader.  This will not only remove the last use
  of the forward threader, but will allow us to remove at least 1 or 2
  threader instances.

* Convert conditional folding to use the method used by the ranger and
  evrp.  Previously DOM was calling into the guts of
  simplify_using_ranges::vrp_visit_cond_stmt.  The blessed way now is
  using fold_cond() which rewrites the conditional and edges
  automatically.

  When legacy is removed, simplify_using_ranges will be further
  cleaned up, and there will only be one entry point into simplifying
  a statement.

* DOM was setting global ranges determined from unreachable edges as a
  side-effect of using the evrp engine.  We must handle these cases
  before nuking evrp, and DOM seems like a good fit.  I've just moved
  the snippet to DOM, but it could live anywhere else we do a DOM
  walk.

  For the record, this is the case *vrp handled:

	<bb C>:
	...
	if (c_5(D) != 5)
	goto <bb N>;
	else
	goto <bb M>;
	<bb N>:
	__builtin_unreachable ();
	<bb M>:

  If M dominates all uses of c_5, we can set the global range of c_5
  to [5,5].

I have tested on x86-64, pcc64le, and aarch64 Linux.

I also ran threading benchmarks as well as performance benchmarks.

DOM threads 1.56% more paths which ultimately yields a miniscule total
increase of 0.03%.

The conversion to ranger brings a 7.87% performance drop in DOM, which
is a wash in overall compilation.  This is in line with other
replacements of legacy evrp with ranger.  We handle a lot more cases.
It's not free .

There is a a regression on Wstringop-overflow-4.C which I'm planning
on XFAILing.  It's another variant of the usual middle-end false
positives: having no ranges produces no warnings, but slightly refined
ranges, or worse-- isolating specific problematic cases in the
threader causes flare-ups.

As an aside, as Richi has suggested, I think we should discuss
restricting the threader's ability to thread highly unlikely paths.
These cause no end of pain for middle-end warnings.  However,
I don't know if this would conflict with path isolation for
things like null dereferencing.  ISTR you were interested in this.

BTW, I think the Wstringop-overflow-4.C test is problematic and I've
attached my analysis.  Basically the regression is caused by a bad
interaction with the rounding/alignment that placement new has inlined
into the IL.  This happens for int16_r[] which the test is testing.
Ranger can glean some range info, which causes DOM threading to
isolate a path which causes a warning.

OK for trunk?

gcc/ChangeLog:

	* tree-ssa-dom.cc (dom_jt_state): Pass ranger to constructor
	instead of evrp.
	(dom_jt_state::push): Remove m_evrp.
	(dom_jt_state::pop): Same.
	(dom_jt_state::record_ranges_from_stmt): Remove.
	(dom_jt_state::register_equiv): Remove updating of evrp ranges.
	(class dom_jt_simplifier): Pass ranger to constructor.
	Inherit from hybrid_jt_simplifier.
	(dom_jt_simplifier::simplify): Convert to ranger.
	(pass_dominator::execute): Same.
	(all_uses_feed_or_dominated_by_stmt): New.
	(dom_opt_dom_walker::set_global_ranges_from_unreachable_edges): New.
	(dom_opt_dom_walker::before_dom_children): Call
	set_global_ranges_from_unreachable_edges.
	Do not call record_ranges_from_stmt.
	(dom_opt_dom_walker::after_dom_children): Remove evrp use.
	(cprop_operand): Use int_range<> instead of value_range.
	(dom_opt_dom_walker::fold_cond): New.
	(dom_opt_dom_walker::optimize_stmt): Pass ranger to
	cprop_into_stmt.
	Use fold_cond() instead of vrp_visit_cond_stmt().
	* tree-ssa-threadedge.cc (jt_state::register_equivs_stmt): Do not
	pass state to simplifier.
	* vr-values.h (class vr_values): Make fold_cond public.

gcc/testsuite/ChangeLog:

	* gcc.dg/sancov/cmp0.c: Adjust for conversion to ranger.
	* gcc.dg/tree-ssa/ssa-dom-branch-1.c: Same.
	* gcc.dg/tree-ssa/ssa-dom-thread-7.c: Same.
	* gcc.dg/vect/bb-slp-pr81635-2.c: Same.
	* gcc.dg/vect/bb-slp-pr81635-4.c: Same.
	* g++.dg/warn/Wstringop-overflow-4.C: Likewise.
	* gcc.target/mips/data-sym-multi-pool.c: Likewise.
	* gcc.target/mips/mips.exp: Likewise.
2022-06-25 19:04:01 -04:00
Jeff Law
fc259b522c Remove long deprecated tilegx and tilepro ports
/
	* MAINTAINERS: Remove tilegx and tilepro entries.
	* configure.ac: Remove tilegx and tilepro stanzas.
	* configure: Rebuilt.

contrib/
	* config-list.mk: Remove tilegx and tilepro entries.
	* gcc_update: Remove tilegx and tilepro entries.

gcc/
	* common/config/tilegx/tilegx-common.cc: Removed.
	* common/config/tilepro/tilepro-common.cc: Removed.
	* config.gcc: Remove tilegx and tilepro entries.
	* config/tilegx/constraints.md: Removed.
	* config/tilegx/feedback.h: Removed.
	* config/tilegx/linux.h: Removed.
	* config/tilegx/mul-tables.cc: Removed.
	* config/tilegx/predicates.md: Removed.
	* config/tilegx/sync.md: Removed.
	* config/tilegx/t-tilegx: Removed.
	* config/tilegx/tilegx-builtins.h: Removed.
	* config/tilegx/tilegx-c.cc: Removed.
	* config/tilegx/tilegx-generic.md: Removed.
	* config/tilegx/tilegx-modes.def: Removed.
	* config/tilegx/tilegx-multiply.h: Removed.
	* config/tilegx/tilegx-opts.h: Removed.
	* config/tilegx/tilegx-protos.h: Removed.
	* config/tilegx/tilegx.cc: Removed.
	* config/tilegx/tilegx.h: Removed.
	* config/tilegx/tilegx.md: Removed.
	* config/tilegx/tilegx.opt: Removed.
	* config/tilepro/constraints.md: Removed.
	* config/tilepro/feedback.h: Removed.
	* config/tilepro/gen-mul-tables.cc: Removed.
	* config/tilepro/linux.h: Removed.
	* config/tilepro/mul-tables.cc: Removed.
	* config/tilepro/predicates.md: Removed.
	* config/tilepro/t-tilepro: Removed.
	* config/tilepro/tilepro-builtins.h: Removed.
	* config/tilepro/tilepro-c.cc: Removed.
	* config/tilepro/tilepro-generic.md: Removed.
	* config/tilepro/tilepro-modes.def: Removed.
	* config/tilepro/tilepro-multiply.h: Removed.
	* config/tilepro/tilepro-protos.h: Removed.
	* config/tilepro/tilepro.cc: Removed.
	* config/tilepro/tilepro.h: Removed.
	* config/tilepro/tilepro.md: Removed.
	* config/tilepro/tilepro.opt: Removed.
	* configure.ac: Remove tilegx and tilepro entries.
	* configure: Rebuilt.
	* doc/extend.texi: Remove tilegx and tilepro entries.
	* doc/install.texi: Remove tilegx and tilepro entries.
	* doc/invoke.texi: Remove tilegx and tilepro entries.
	* doc/md.texi: Remove tilegx and tilepro entries.

gcc/testsuite/
	* gcc.dg/lower-subreg-1.c: Remove tilegx and tilepro entries.
	* gcc.misc-tests/linkage.exp: Remove tilegx and
	tilepro entries.

libgcc/
	* config.host: Removed tilegx and tilepro entries.
	* config/tilegx/sfp-machine.h: Removed.
	* config/tilegx/sfp-machine32.h: Removed.
	* config/tilegx/sfp-machine64.h: Removed.
	* config/tilegx/t-crtstuff: Removed.
	* config/tilegx/t-softfp: Removed.
	* config/tilegx/t-tilegx: Removed.
	* config/tilepro/atomic.c: Removed.
	* config/tilepro/atomic.h: Removed.
	* config/tilepro/linux-unwind.h: Removed.
	* config/tilepro/sfp-machine.h: Removed.
	* config/tilepro/softdivide.c: Removed.
	* config/tilepro/softmpy.S: Removed.
	* config/tilepro/t-crtstuff: Removed.
	* config/tilepro/t-tilepro: Removed.
2022-06-25 13:55:21 -04:00
Iain Sandoe
54a5f47848 testsuite, Darwin: Fix darwin-comm-1.c error messages for Darwin <= 10.
When amending the allowed alignment size to accommodate the larger values
permitted by newer tools, we retained the object file limit of 2^15 for
Darwin versions <= 10, since that is what the native tools expect there.

This triggers a different diagnostic path with a distinct error message,
which is checked in the revised test here.

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

gcc/testsuite/ChangeLog:

	* gcc.dg/darwin-comm-1.c: Check for the correct error message for
	Darwin <= 10.
2022-06-25 10:43:06 +01:00
Roger Sayle
defa8537af Iterating cprop_hardreg... Third time's a charm.
This middle-end patch proposes the "hard register constant propagation"
pass be performed up to three times on each basic block (up from the
current two times) if the second pass successfully made changes.

The motivation for three passes is to handle the "swap idiom" (i.e.
t = x; x = y; y = t;" sequences) that get generated by register allocation
(reload).

Consider the x86_64 test case for __int128 addition recently discussed
on gcc-patches.  With that proposed patch, the input to the cprop_hardreg
pass looks like:

	movq	%rdi, %r8
	movq	%rsi, %rdi
	movq	%r8, %rsi
        movq    %rdx, %rax
        movq    %rcx, %rdx
        addq    %rsi %rax
        adcq    %rdi, %rdx
        ret

where the first three instructions effectively swap %rsi and %rdi.

On the first pass of cprop_hardreg, we notice that the third insn,
%rsi := %r8, is redundant and can eliminated/propagated to produce:

        movq    %rdi, %r8
        movq    %rsi, %rdi
        movq    %rdx, %rax
        movq    %rcx, %rdx
        addq    %r8 %rax
        adcq    %rdi, %rdx
        ret

Because a successful propagation was found, cprop_hardreg then runs
a second pass/sweep on affected basic blocks (using worklist), and
on this second pass notices that the second instruction, %rdi := %rsi,
may now be propagated (%rsi was killed in the before the first transform),
and after a second pass, we now end up with:

        movq    %rdi, %r8
        movq    %rdx, %rax
        movq    %rcx, %rdx
        addq    %r8, %rax
        adcq    %rsi, %rdx
        ret

which is the current behaviour on mainline.  However, a third and final
pass would now notice that the first insn, "%r8 := %rdi" is also now
eliminable, and a third iteration would produce optimal code:

        movq    %rdx, %rax
        movq    %rcx, %rdx
        addq    %rdi, %rax
        adcq    %rsi, %rdx
        ret

The patch below creates two worklists, and alternates between them on
sucessive passes, populating NEXT with the basic block id's of blocks
that were updated during the current pass over the CURR worklist.
It should be noted that this a regression fix; GCC 4.8 generated
optimal code with two moves (whereas GCC 12 required 5 moves, up
from GCC 11's 4 moves).

2022-06-25  Roger Sayle  <roger@nextmovesoftware.com>
	    Richard Biener  <rguenther@suse.de>

gcc/ChangeLog
	* regcprop.cc (pass_cprop_hardreg::execute): Perform a third
	iteration over each basic block that was updated by the second
	iteration.
2022-06-25 09:35:45 +01:00
Xi Ruoyao
476ef855d0
intl: stop using fgrep for exgettext
fgrep has been deprecated in favor of grep -F for a long time, and the
next grep release (3.8 or 4.0) will print a warning of fgrep is used.
And, the fgrep command in exgettext is no longer useful after we
migrated from SVN to Git.  Remove the fgrep command so we won't see the
warning.

gcc/po/ChangeLog:

	* exgettext: Remove unneeded fgrep command.
2022-06-25 11:53:52 +08:00
GCC Administrator
84c2131d2c Daily bump. 2022-06-25 00:16:23 +00:00
Jason Merrill
113844d68e c++: Include -Woverloaded-virtual in -Wall [PR87729]
This seems like a good warning to have in -Wall, as requested.  But as
pointed out in PR20423, some users want a warning only when a derived
function doesn't override any base function.  So let's put that lesser
version in -Wall (and -Woverloaded-virtual=1) while leaving the semantics
for the existing option the same.

	PR c++/87729
	PR c++/20423

gcc/c-family/ChangeLog:

	* c.opt (Woverloaded-virtual): Add levels, include in -Wall.

gcc/ChangeLog:

	* doc/invoke.texi: Document changes.

gcc/cp/ChangeLog:

	* class.cc (warn_hidden): Handle -Woverloaded-virtual=1.

gcc/testsuite/ChangeLog:

	* g++.dg/warn/Woverloaded-virt1.C: New test.
	* g++.dg/warn/Woverloaded-virt2.C: New test.
2022-06-24 18:23:48 -04:00
Dimitar Dimitrov
75fa80bb56 testsuite: Skip btf-bitfields-1.c if int is less than 32-bits
This test spuriously fails on AVR with:
   error: width of 'bitfield_c' exceeds its type

8-bit and 16-bit microcontrollers do not seem to be the target audience
for BTF file format.  So the least intrusive fix is to simply skip the
test for them.

gcc/testsuite/ChangeLog:

	* gcc.dg/debug/btf/btf-bitfields-1.c: Skip if int is less than
	32-bits.

Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
2022-06-24 23:30:22 +03:00
Harald Anlauf
f21f17f95c Fortran: fix checking of arguments to UNPACK when MASK is a variable [PR105813]
gcc/fortran/ChangeLog:

	PR fortran/105813
	* check.cc (gfc_check_unpack): Try to simplify MASK argument to
	UNPACK so that checking of the VECTOR argument can work when MASK
	is a variable.

gcc/testsuite/ChangeLog:

	PR fortran/105813
	* gfortran.dg/unpack_vector_1.f90: New test.
2022-06-24 22:27:11 +02:00
Dimitar Dimitrov
5cd0e80019 testsuite: Handle default_packed for gcc.dg/builtin-object-size-20.c
The gcc.dg/builtin-object-size-20.c test case assumes that the target
inserts padding between structure members.  Obviously it fails for
targets which pack structures by default.

Split the cases into two tests, so that the ones requiring structure
padding can be skipped for default_packed targets.

gcc/testsuite/ChangeLog:

	* gcc.dg/builtin-object-size-20.c: Remove cases which
	work on default_packed targets.
	* gcc.dg/builtin-object-size-22.c: New test with the cases
	removed above.

Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
2022-06-24 23:22:14 +03:00
Dimitar Dimitrov
2e2371b5da testsuite: Rename test-defined macros
Epiphany, PRU, ARC and NDS32 may predefine __big_endian__ and
__little_endian__ macros.  This leads to spurious warnings like:
  gcc.dg/sso/memcpy-1.c:7: warning: "__little_endian__" redefined

Fix by renaming the macros in the test.

gcc/testsuite/ChangeLog:

	* gcc.dg/sso/memcpy-1.c (__big_endian__, __little_endian__):
	Rename macros to avoid conflicts with predefined ones.

Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
2022-06-24 23:22:14 +03:00
Dimitar Dimitrov
b1d0d3520e testsuite: Remove reliance on argc in lto/pr101868_0.c
Some embedded targets do not pass any argv arguments.  When argc is
zero, this causes spurious failures for lto/pr101868_0.c.  Fix by
following the strategy in r0-114701-g2c49569ecea56d.  Use a volatile
variable instead of argc to inject a runtime value into the test.

I validated the following:
  - No changes in testresults for x86_64-pc-linux-gnu.
  - The spurious failures are fixed for PRU target.
  - lto/pr101868_0.c still fails on x86_64-pc-linux-gnu, if
    the PR/101868 fix (r12-2254-gfedcf3c476aff7) is reverted.

	PR tree-optimization/101868

gcc/testsuite/ChangeLog:

	* gcc.dg/lto/pr101868_0.c (zero): New volatile variable.
	(main): Use it instead of argc.

Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
2022-06-24 23:22:14 +03:00