Commit Graph

183851 Commits

Author SHA1 Message Date
GCC Administrator
bc2127767a Daily bump. 2021-03-17 00:16:25 +00:00
Christophe Lyon
a2a6e9214e aarch64: Fix up aarch64_simd_clone_compute_vecsize_and_simdlen [PR99542]
The gcc.dg/declare-simd.c test does not emit a warning with
-mabi=ilp32.

2021-03-16  Christophe Lyon  <christophe.lyon@linaro.org>

	PR target/99542
	gcc/testsuite/
	* gcc.dg/declare-simd.c (fn2): Expect a warning only under lp64.
2021-03-16 21:51:39 +00:00
Jason Merrill
a4101e5aaf c++: Fix NaN as C++20 template argument
C++20 allows floating-point types for non-type template parameters;
floating-point values are considered to be equivalent template arguments if
they are "identical", which conveniently seems to map onto an existing GCC
predicate.

gcc/cp/ChangeLog:

	* tree.c (cp_tree_equal): Use real_identical.

gcc/testsuite/ChangeLog:

	* g++.dg/cpp2a/nontype-float1.C: New test.
2021-03-16 17:47:22 -04:00
Jakub Jelinek
0251051db6 c++: Ensure correct destruction order of local statics [PR99613]
As mentioned in the PR, if end of two constructions of local statics
is strongly ordered, their destructors should be run in the reverse order.
As we run __cxa_guard_release before calling __cxa_atexit, it is possible
that we have two threads that access two local statics in the same order
for the first time, one thread wins the __cxa_guard_acquire on the first
one but is rescheduled in between the __cxa_guard_release and __cxa_atexit
calls, then the other thread is scheduled and wins __cxa_guard_acquire
on the second one and calls __cxa_quard_release and __cxa_atexit and only
afterwards the first thread calls its __cxa_atexit.  This means a variable
whose completion of the constructor strongly happened after the completion
of the other one will be destructed after the other variable is destructed.

The following patch fixes that by swapping the __cxa_guard_release and
__cxa_atexit calls.

2021-03-16  Jakub Jelinek  <jakub@redhat.com>

	PR c++/99613
	* decl.c (expand_static_init): For thread guards, call __cxa_atexit
	before calling __cxa_guard_release rather than after it.  Formatting
	fixes.
2021-03-16 21:17:44 +01:00
Segher Boessenkool
a0b5843a9b rs6000: Workaround for PR98092
The bcdinvalid_<mode> RTL instruction uses the "unordered" comparison,
which cannot be used if we have -ffinite-math-only.  We really need
CCMODEs that describe what bits in a CR field are set by other insns
than just comparisons, but that is a lot more surgery, and it is stage 4
now.  This patch does a simple workaround.

2021-03-16  Segher Boessenkool  <segher@kernel.crashing.org>

	PR target/98092
	* config/rs6000/predicates.md (branch_comparison_operator): Allow
	ordered and unordered for CCFPmode, if flag_finite_math_only.

gcc/testsuite/
	PR target/98092
	* gcc.target/powerpc/pr98092.c: New.
2021-03-16 19:21:34 +00:00
Jakub Jelinek
d55ce33a34 i386: Avoid mutual recursion between two peephole2s [PR99600]
As the testcase shows, the compiler hangs and eats all memory when compiling
it.  This is because in r11-7274-gdecd8fb0128870d0d768ba53dae626913d6d9c54
I have changed the ix86_avoid_lea_for_addr splitting from a splitter
into a peephole2 (because during splitting passes we don't have guaranteed
df, while during peephole2 we do).
The problem is we have another peephole2 that works in the opposite way,
when seeing split lea (in particular ASHIFT followed by PLUS) it attempts
to turn it back into a lea.
In the past, they were fighting against each other, but as they were in
different passes, simply the last one won.  So, split after reload
split the lea into shift left and plus, peephole2 reverted that (but, note
not perfectly, the peephole2 doesn't understand that something can be placed
into lea disp; to be fixed for GCC12) and then another split pass split the
lea appart again.
But my changes and the way peephole2 works means that we endlessly iterate
over those two, the first peephole2 splits the lea, the second one reverts
it, the first peephole2 splits the new lea back into new 2 insns and so
forth forever.
So, we need to break the cycle somehow.  This patch does that by not emitting
an ASHIFT insn from ix86_split_lea_for_addr but emitting a corresponding
MULT by constant instead, and splitting that later back into ASHIFT.

2021-03-16  Jakub Jelinek  <jakub@redhat.com>

	PR target/99600
	* config/i386/i386-expand.c (ix86_split_lea_for_addr): Emit a MULT
	rather than ASHIFT.
	* config/i386/i386.md (mult by 1248 into ashift): New splitter.

	* gcc.target/i386/pr99600.c: New test.
2021-03-16 18:46:20 +01:00
Martin Liska
1c7bec8bfb c++: support target attr for DECL_LOCAL_DECL_P fns [PR99108]
We crash when target attribute get_function_versions_dispatcher is called
for a function that is not registered in call graph.  This was happening
because we were calling it for the function-local decls that aren't in the
symbol table, instead of the corresponding namespace-scope decls that are.

gcc/cp/ChangeLog:

	PR c++/99108
	* call.c (get_function_version_dispatcher): Handle
	DECL_LOCAL_DECL_P.
	* decl.c (maybe_version_functions): Likewise.
	(maybe_mark_function_versioned): New.
	* name-lookup.c (push_local_extern_decl_alias): No longer static.
	* name-lookup.h (push_local_extern_decl_alias): Adjust.

gcc/testsuite/ChangeLog:

	PR c++/99108
	* g++.target/i386/pr99108.C: New test.

Co-authored-by: Jason Merrill <jason@redhat.com>
2021-03-16 10:54:23 -04:00
Nick Clifton
f6e9c1c919 Fix potentially undefined behaviour when computing a sha1 value.
libiberty/
	* sha1.c (sha1_process_bytes): Use memmove in place of memcpy.
2021-03-16 14:43:17 +00:00
Martin Liska
408d137027 options: ignore flag_ipa_ra in cl_optimization_compare
gcc/ChangeLog:

	PR target/99592
	* optc-save-gen.awk: Add flag_ipa_ra to exceptions for
	cl_optimization_compare function.

gcc/testsuite/ChangeLog:

	PR target/99592
	* gcc.target/arm/pr99592.c: New test.
2021-03-16 14:44:26 +01:00
Ilya Leoshkevich
4073a09e23 IBM Z: Fix "+fvm" constraint with long doubles
When a long double is passed to an asm statement with a "+fvm"
constraint, a LRA loop occurs.  This happens, because LRA chooses the
widest register class in this case (VEC_REGS), but the code generated
by s390_md_asm_adjust() always wants FP_REGS.  Mismatching register
classes cause infinite reloading.

Fix by treating "fv" constraints as "v" in s390_md_asm_adjust().

gcc/ChangeLog:

	* config/s390/s390.c (f_constraint_p): Treat "fv" constraints
	as "v".

gcc/testsuite/ChangeLog:

	* gcc.target/s390/vector/long-double-asm-fprvrmem.c: New test.
2021-03-16 13:57:34 +01:00
Jonathan Wakely
995a740cb0 libstdc++: Remove symbols for new std::call_once implementation [PR 99341]
This removes the new symbols added for the new futex-based
std::call_once implementation. These symbols were new on trunk, so not
in any released version. However, they are already present in some
beta distro releases (Fedora Linux 34) and in Fedora Linux rawhide. This
change can be locally reverted by distros that need to keep the symbols
present until affected packages have been rebuilt.

libstdc++-v3/ChangeLog:

	PR libstdc++/99341
	* config/abi/post/aarch64-linux-gnu/baseline_symbols.txt: Remove
	std::once_flag symbols.
	* config/abi/post/ia64-linux-gnu/baseline_symbols.txt: Likewise.
	* config/abi/post/m68k-linux-gnu/baseline_symbols.txt: Likewise.
	* config/abi/post/riscv64-linux-gnu/baseline_symbols.txt:
	Likewise.
	* config/abi/pre/gnu.ver: Likewise.
	* src/c++11/mutex.cc [_GLIBCXX_HAVE_LINUX_FUTEX]
	(struct __once_flag_compat): Remove.
	(_ZNSt9once_flag11_M_activateEv): Remove.
	(_ZNSt9once_flag9_M_finishEb): Remove.
2021-03-16 12:25:28 +00:00
Jonathan Wakely
6ee24638ed libstdc++: Revert to old std::call_once implementation [PR 99341]
The new std::call_once implementation is not backwards compatible,
contrary to my intention. Because std::once_flag::_M_active() doesn't
write glibc's "fork generation" into the pthread_once_t object, it's
possible for glibc and libstdc++ to run two active executions
concurrently. This violates the primary invariant of the feature!

This patch reverts std::once_flag and std::call_once to the old
implementation that uses pthread_once. This means PR 66146 is a problem
again, but glibc has been changed to solve that. A new API similar to
pthread_once but supporting failure and resetting the pthread_once_t
will be proposed for inclusion in glibc and other C libraries.

This change doesn't simply revert r11-4691 because I want to retain the
new implementation for non-ghtreads targets (which didn't previously
support std::call_once at all, so there's no backwards compatibility
concern). This also leaves the new std::call_once::_M_activate() and
std::call_once::_M_finish(bool) symbols present in libstdc++.so.6 so
that code already compiled against GCC 11 can still use them. Those
symbols will be removed in a subsequent commit (which distros can choose
to temporarily revert if needed).

libstdc++-v3/ChangeLog:

	PR libstdc++/99341
	* include/std/mutex [_GLIBCXX_HAVE_LINUX_FUTEX] (once_flag):
	Revert to pthread_once_t implementation.
	[_GLIBCXX_HAVE_LINUX_FUTEX] (call_once): Likewise.
	* src/c++11/mutex.cc [_GLIBCXX_HAVE_LINUX_FUTEX]
	(struct __once_flag_compat): New type matching the reverted
	implementation of once_flag using futexes.
	(once_flag::_M_activate): Remove, replace with ...
	(_ZNSt9once_flag11_M_activateEv): ... alias symbol.
	(once_flag::_M_finish): Remove, replace with ...
	(_ZNSt9once_flag9_M_finishEb): ... alias symbol.
	* testsuite/30_threads/call_once/66146.cc: Removed.
2021-03-16 12:25:28 +00:00
Nathan Sidwell
7b900dca60 c++: Incorrect type equivalence [PR 99496]
This bug was caused by not marking dependent template aliases
correctly -- these things look like typedefs, but are not
(necessarily) equivalent to the canonical type.  We need to record that.

	PR c++/99496
	gcc/cp/
	* module.cc (trees_out::decl_value): Adjust typedef streaming,
	indicate whether it is a dependent alias.
	(trees_in::decl_value): Likewise.  Set as dependent alias, if it
	is one.
	gcc/testsuite/
	* g++.dg/modules/pr99496_a.H: New.
	* g++.dg/modules/pr99496_b.C: New.
2021-03-16 04:37:33 -07:00
GCC Administrator
3c5b6d24e6 Daily bump. 2021-03-16 10:55:35 +00:00
Martin Liska
5f6a43d691 gcc-changelog: skip broken commit in git_update_version.py.
contrib/ChangeLog:

	* gcc-changelog/git_update_version.py: Skip one problematic
	commit.
2021-03-16 11:50:50 +01:00
Jakub Jelinek
82085eb3d4 i386: Fix up _mm256_vzeroupper() handling [PR99563]
My r10-6451-gb7b3378f91c0641f2ef4d88db22af62a571c9359 fix for
vzeroupper vs. ms ABI apparently broke the explicit vzeroupper handling
when the implicit vzeroupper handling is disabled.
The epilogue_completed splitter for vzeroupper now adds clobbers for all
registers which don't have explicit sets in the pattern and the sets are
added during vzeroupper pass.  Before my changes, for explicit user
vzeroupper, we just weren't modelling its effects at all, it was just
unspec that didn't tell that it clobbers the upper parts of all XMM < %xmm16
registers.  But now the splitter will even for those add clobbers and as
it has no sets, it will add clobbers for all registers, which means
we optimize away anything that lived across that vzeroupper.

The vzeroupper pass has two parts, one is the mode switching that computes
where to put the implicit vzeroupper calls and puts them there, and then
another that uses df to figure out what sets to add to all the vzeroupper.
The former part should be done only under the conditions we have in the
gate, but the latter as this PR shows needs to happen either if we perform
the implicit vzeroupper additions, or if there are (or could be) any
explicit vzeroupper instructions.  As that function does df_analyze and
walks the whole IL, I think it would be too expensive to run it always
whenever TARGET_AVX, so this patch remembers if we've expanded at least
one __builtin_ia32_vzeroupper in the function and runs that part of the
vzeroupper pass both when the old condition is true or when this new
flag is set.

2021-03-16  Jakub Jelinek  <jakub@redhat.com>

	PR target/99563
	* config/i386/i386.h (struct machine_function): Add
	has_explicit_vzeroupper bitfield.
	* config/i386/i386-expand.c (ix86_expand_builtin): Set
	cfun->machine->has_explicit_vzeroupper when expanding
	IX86_BUILTIN_VZEROUPPER.
	* config/i386/i386-features.c (rest_of_handle_insert_vzeroupper):
	Do the mode switching only when TARGET_VZEROUPPER, expensive
	optimizations turned on and not optimizing for size.
	(pass_insert_vzeroupper::gate): Enable even when
	cfun->machine->has_explicit_vzeroupper is set.

	* gcc.target/i386/avx-pr99563.c: New test.
2021-03-16 11:16:15 +01:00
Jakub Jelinek
fcefc59bef aarch64: Fix up aarch64_simd_clone_compute_vecsize_and_simdlen [PR99542]
As the patch shows, there are several bugs in
aarch64_simd_clone_compute_vecsize_and_simdlen.
One is that unlike for function declarations that aren't definitions
it completely ignores argument types.  Such decls don't have DECL_ARGUMENTS,
but we can walk TYPE_ARG_TYPES instead, like the i386 backend does or like
the simd cloning code in the middle end does too.

Another problem is that it checks types of uniform arguments.  That is
unnecessary, uniform arguments are passed the way it normally is, it is
a scalar argument rather than vector, so there is no reason not to support
uniform argument of different size, or long double, structure etc.

2021-03-16  Jakub Jelinek  <jakub@redhat.com>

	PR target/99542
	* config/aarch64/aarch64.c
	(aarch64_simd_clone_compute_vecsize_and_simdlen): If not a function
	definition, walk TYPE_ARG_TYPES list if non-NULL for argument types
	instead of DECL_ARGUMENTS.  Ignore types for uniform arguments.

	* gcc.dg/gomp/pr99542.c: New test.
	* gcc.dg/gomp/pr59669-2.c (bar): Don't expect a warning on aarch64.
	* gcc.dg/gomp/simd-clones-2.c (setArray): Likewise.
	* g++.dg/vect/simd-clone-7.cc (bar): Likewise.
	* g++.dg/gomp/declare-simd-1.C (f37): Expect a different warning
	on aarch64.
	* gcc.dg/declare-simd.c (fn2): Expect a new warning on aarch64.
2021-03-16 10:34:44 +01:00
Jakub Jelinek
1973beaf92 testsuite: Fix up target selector syntax errors in modules/builtin-3*.C [PR99601]
Without this patch I'm seeing:
ERROR: tcl error sourcing /home/jakub/src/gcc/gcc/testsuite/g++.dg/modules/modules.exp.
ERROR: unmatched open brace in list
    while executing
"foreach op $tmp {
        switch [lindex $op 0] {
            "dg-options" {
                set std_prefix "-std=gnu++"
                if { [string match "*-std=*" [lindex $op 2]] } {
                    ..."
    (procedure "module-init" line 7)
    invoked from within
"module-init $src"
    invoked from within
"if [runtest_file_p $runtests $src] {
        set tests [lsort [find [file dirname $src]  [regsub {_a.[CHX]$} [file tail $src] {_[a-z].[CHX]}]]]

        set std_lis..."
    ("foreach" body line 3)
    invoked from within
"foreach src [lsort [find $srcdir/$subdir {*_a.[CHX}]] {
    # use the FOO_a.C name as the parallelization key
    if [runtest_file_p $runtests $src] {..."
    (file "/home/jakub/src/gcc/gcc/testsuite/g++.dg/modules/modules.exp" line 304)
    invoked from within
"source /home/jakub/src/gcc/gcc/testsuite/g++.dg/modules/modules.exp"
    ("uplevel" body line 1)
    invoked from within
"uplevel #0 source /home/jakub/src/gcc/gcc/testsuite/g++.dg/modules/modules.exp"
    invoked from within
"catch "uplevel #0 source $test_file_name""

2021-03-16  Jakub Jelinek  <jakub@redhat.com>

	PR c++/99601
	* g++.dg/modules/builtin-3_a.C: Fix target selector syntax errors.
	* g++.dg/modules/builtin-3_b.C: Likewise.
2021-03-16 00:24:15 +01:00
Ian Lance Taylor
3a5bcac339 libgo: update to Go 1.16.2 release
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/301459
2021-03-15 14:52:55 -07:00
Joseph Myers
7b843d4716 Update gcc sv.po.
* sv.po: Update.
2021-03-15 20:30:40 +00:00
Nathan Sidwell
770d3487ef c++: Fix 2 testcases [PR 99601]
I'd failed to correctly restrict some checks to lp64 x86 targets.

	PR c++/99601
	gcc/testsuite/
	* g++.dg/modules/builtin-3_a.C: Fix lp64 x86 detection.
	* g++.dg/modules/builtin-3_b.C: Fix lp64 x86 detection.
2021-03-15 15:25:32 -04:00
Caroline Tice
c2be82058f libstdc++-v3: Update VTV vars for libtool link commands [PR99172]
This fixes PR 99172

Currently when GCC is configured with --enable-vtable-verify, the
libstdc++-v3 Makefiles add "-fvtable-verify=std
-Wl,-u_vtable_map_vars_start,-u_vtable_map_vars_end" to libtool link
commands. The "-fvtable-verify=std" piece causes alternate versions of
libtool (such as slibtool) to fail, unable to find "-lvtv" (GNU
libtool just removes that piece).

This patch updates the libstdc++-v3 Makefiles to not pass
"-fvtable-verify=std" to the libtool link commands.
2021-03-15 09:22:45 -07:00
Iain Sandoe
541840b891 coroutines : Convert await_ready () expressions to bool [PR99047].
The awaiter.await_ready() should be converted per [expr.await]/3

(3.6) await-ready is the expression e.await_ready(), contextually
      converted to bool.

gcc/cp/ChangeLog:

	PR c++/99047
	* coroutines.cc (expand_one_await_expression): If the
	await_ready() expression is not a boolean then convert it
	as required.

gcc/testsuite/ChangeLog:

	PR c++/99047
	* g++.dg/coroutines/pr99047.C: New test.
2021-03-15 15:57:42 +00:00
Iain Sandoe
020b286c76 coroutines : Handle rethrow from unhandled_exception [PR98704].
Although there is still some discussion in CWG 2451 on this, the
implementors are agreed on the intent.

When promise.unhandled_exception () is entered, the coroutine is
considered to be still running - returning from the method will
cause the final await expression to be evaluated.

If the method throws, that action is considered to make the
coroutine suspend (since, otherwise, it would be impossible to
reclaim its resources, since one cannot destroy a running coro).

The wording issue is to do with how to represent the place at
which the coroutine should be considered suspended.

For the implementation here, that place is immediately before the
promise life-time ends. A handler for the rethrown exception, can
thus call xxxx.destroy() which will run DTORs for the promise and
any parameter copies [as needed] then the coroutine frame will be
deallocated.

At present, we also set "done=true" in this case (for compatibility
with other current implementations).  One might consider 'done()'
to be misleading in the case of an abnormal termination - that is
also part of the CWG 2451 discussion.

gcc/cp/ChangeLog:

	PR c++/98704
	* coroutines.cc (build_actor_fn): Make destroy index 1
	correspond to the abnormal unhandled_exception() exit.
	Substitute the proxy for the resume index.
	(coro_rewrite_function_body): Arrange to reset the resume
	index and make done = true for a rethrown exception from
	unhandled_exception ().
	(morph_fn_to_coro): Adjust calls to build_actor_fn and
	coro_rewrite_function_body.

gcc/testsuite/ChangeLog:

	PR c++/98704
	* g++.dg/coroutines/torture/pr98704.C: New test.
2021-03-15 15:54:29 +00:00
Iain Sandoe
26e0eb1071 coroutines : Handle for await expressions in for stmts [PR98480].
The handling of await expressions in the init, condition and iteration
expressions of for loops had been omitted.  Fixed thus.

gcc/cp/ChangeLog:

	PR c++/98480
	* coroutines.cc (replace_continue): Rewrite continue into
	'goto label'.
	(await_statement_walker): Handle await expressions in the
	initializer, condition and iteration expressions of for
	loops.

gcc/testsuite/ChangeLog:

	PR c++/98480
	* g++.dg/coroutines/pr98480.C: New test.
	* g++.dg/coroutines/torture/co-await-24-for-init.C: New test.
	* g++.dg/coroutines/torture/co-await-25-for-condition.C: New test.
	* g++.dg/coroutines/torture/co-await-26-for-iteration-expr.C: New test.
2021-03-15 15:50:25 +00:00
Iain Sandoe
ed81984617 coroutines : Avoid generating empty statements [PR96749].
In the compiler-only idiom:
" a = (target expr creats temp, op uses temp) "
the target expression variable needs to be promoted to a frame one
(if the expression has a suspend point).  However, the only uses of
the var are in the second part of the compound expression - and we
were creating an empty statement corresponding to the (now unused)
first arm.  This then produces the spurious warnings noted.

Fixed by avoiding generation of a separate variable nest for
isolated target expressions (or similarly isolated co_awaits used
in a function call).

gcc/cp/ChangeLog:

	PR c++/96749
	* coroutines.cc (flatten_await_stmt): Allow for the case
	where a target expression variable only has uses in the
	second part of a compound expression.
	(maybe_promote_temps): Avoid emiting empty statements.

gcc/testsuite/ChangeLog:

	PR c++/96749
	* g++.dg/coroutines/pr96749-1.C: New test.
	* g++.dg/coroutines/pr96749-2.C: New test.
2021-03-15 15:48:14 +00:00
Iain Sandoe
6f4b0ff2b1 libstdc++, testsuite, Darwin : Adjust for names used in system headers.
For all current Darwin SDKs inttypes.h has:
extern intmax_t imaxabs(intmax_t j);

So we need to exclude j from the defined test symbols.

libstdc++-v3/ChangeLog:

	* testsuite/17_intro/names.cc: Exclude j from the list
	of test symbols for Darwin.
2021-03-15 15:42:39 +00:00
Iain Sandoe
f8aa819b4a libstdc++, Darwin, ppc : Add new long double symbols.
We need to add the symbols for to_chars and from_chars for the
long double cases.

libstdc++-v3/ChangeLog:

	* config/os/bsd/darwin/ppc-extra.ver: Add matching for
	to_chars and from_chars for long double.
2021-03-15 15:34:11 +00:00
Richard Biener
99415d0f18 tree-optimization/98834 - fix optimization regression with _b_c_p
The following makes FRE optimize a load we formerly required
SRA + CCP for which now run after we get rid of all __builtin_constant_p
calls.

2021-03-15  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/98834
	* tree-ssa-sccvn.c (vn_reference_lookup_3): Handle missing
	subsetting by truncating the access size.

	* g++.dg/opt/pr98834.C: New testcase.
2021-03-15 16:00:20 +01:00
Patrick Palka
dce586ff83 libstdc++: Implement missing operator overloads in max_size_type.h
This implements operator++, operator-- and operator<=> for the
integer-class types defined in max_size_type.h, which I overlooked
when originally implementing the class.

libstdc++-v3/ChangeLog:

	* include/bits/max_size_type.h (__max_size_type::operator _Tp):
	Fix formatting.
	(__max_size_type::operator++): Define.
	(__max_size_type::operator--): Likewise.
	(__max_size_type::operator<=>): Conditionally define (in place
	of the other comparison operators).
	(__max_diff_type::operator _Tp): Fix formatting.
	(__max_diff_type::operator++): Define.
	(__max_diff_type::operator--): Likewise.
	(__max_diff_type::operator<=>): Conditionally define (in place
	of the other comparison operators).
	* testsuite/std/ranges/iota/max_size_type.cc (test01): Test
	these operator overloads.
2021-03-15 10:31:45 -04:00
Martin Liska
33f36b34ac analyzer: fix missing comma in initializer
Fixes the following valid warning:

gcc/analyzer/sm-file.cc:250:5: warning: suspicious concatenation of string literals in an array initialization;
did you mean to separate the elements with a comma? [-Wstring-concatenation]

gcc/analyzer/ChangeLog:

	* sm-file.cc (get_file_using_fns): Add missing comma in initializer.
2021-03-15 15:01:52 +01:00
Jan Hubicka
5b32a1817d znver3 tuning part 1
2021-03-15  Jan Hubicka  <hubicka@ucw.cz>

	* config/i386/i386-options.c (processor_cost_table): Add znver3_cost.
	* config/i386/x86-tune-costs.h (znver3_cost): New gobal variable; copy
	of znver2_cost.
2021-03-15 11:36:52 +01:00
Thomas Koenig
52654036a5 Handle EXEC_IOLENGTH in doloop_contained_procedure_code.
This rather obvious patch fixes an ICE on valid which came about
because I did not handle EXEC_IOLENGTH as start of an I/O statement
when checking for the DO loop variable.  This is an 11 regression.

gcc/fortran/ChangeLog:

	PR fortran/99345
	* frontend-passes.c (doloop_contained_procedure_code):
	Properly handle EXEC_IOLENGTH.

gcc/testsuite/ChangeLog:

	PR fortran/99345
	* gfortran.dg/do_check_16.f90: New test.
	* gfortran.dg/do_check_17.f90: New test.
2021-03-15 11:02:02 +01:00
Paul Thomas
21ced2776a Fortran: Fix problem with allocate initialization [PR99545].
2021-03-15  Paul Thomas  <pault@gcc.gnu.org>

gcc/fortran/ChangeLog

	PR fortran/99545
	* trans-stmt.c (gfc_trans_allocate): Mark the initialization
	assignment by setting init_flag.

gcc/testsuite/ChangeLog

	PR fortran/99545
	* gfortran.dg/pr99545.f90: New test.
2021-03-15 09:32:52 +00:00
Tobias Burnus
f20fe2cb21 OpenMP: Fix 'omp declare target' handling for vars [PR99509]
For variables with 'declare target' attribute,
varpool_node::get_create marks variables as offload; however,
if the node already exists, it is not updated. C/C++ may tag
decl with 'declare target implicit', which may only be after
varpool creation turned into 'declare target' or 'declare target link';
in this case, the tagging has to happen in the FE.

gcc/c/ChangeLog:

	PR c++/99509
	* c-decl.c (finish_decl): For 'omp declare target implicit' vars,
	ensure that the varpool node is marked as offloadable.

gcc/cp/ChangeLog:

	PR c++/99509
	* decl.c (cp_finish_decl): For 'omp declare target implicit' vars,
	ensure that the varpool node is marked as offloadable.

libgomp/ChangeLog:

	PR c++/99509
	* testsuite/libgomp.c-c++-common/declare_target-1.c: New test.
2021-03-15 10:12:58 +01:00
Martin Liska
b516a15371 Fix -Wstring-concatenation warning.
Fix the following clang warning:
gcc/spellcheck.c:477:3: warning: suspicious concatenation of string literals in an array initialization;
did you mean to separate the elements with a comma? [-Wstring-concatenation]

gcc/ChangeLog:

	* spellcheck.c: Add missing comma in initialization.
2021-03-15 09:29:10 +01:00
David Edelsohn
52b67943d1 testsuite: fix typo in testcase pr99492.c
gcc/testsuite/ChangeLog:

	* gcc.target/powerpc/pr99492.c: Fix typo.
2021-03-14 20:41:38 -04:00
GCC Administrator
9844eeff5a Daily bump. 2021-03-15 00:16:26 +00:00
Harald Anlauf
c2d7c39fcb PR fortran/99112 - ICE with runtime diagnostics for SIZE intrinsic function
Add/fix handling of runtime checks for CLASS arguments with ALLOCATABLE
or POINTER attribute.

gcc/fortran/ChangeLog:

	* trans-expr.c (gfc_conv_procedure_call): Fix runtime checks for
	CLASS arguments.
	* trans-intrinsic.c (gfc_conv_intrinsic_size): Likewise.

gcc/testsuite/ChangeLog:

	* gfortran.dg/pr99112.f90: New test.

Co-authored-by: Paul Thomas <pault@gcc.gnu.org>
2021-03-14 20:39:58 +01:00
Uros Bizjak
553488851d i386: Some more -mavx512vl -mno-avx512bw fixes [PR99321]
2021-03-14  Uroš Bizjak  <ubizjak@gmail.com>

gcc/
	* config/i386/sse.md (*vec_extract<mode>): Merge alternative 0 with
	alternative 2 and alternative 1 with alternative 3 using
	YW register constraint.
	(*vec_extract<PEXTR_MODE12:mode>_zext): Merge alternatives
	using YW register constraint.
	(*vec_extractv16qi_zext): Ditto.
	(*vec_extractv4si): Merge alternatives 4 and 5
	using Yw register constraint.
	(*ssse3_palignr<mode>_perm): Use Yw instead of v for alternative 3.
2021-03-14 18:52:13 +01:00
GCC Administrator
5e93c2f08f Daily bump. 2021-03-14 00:16:18 +00:00
Martin Sebor
77643ac4bb PR tree-optimization/99489 - ICE calling strncat after strcat
gcc/ChangeLog:

	PR tree-optimization/99489
	* builtins.c (gimple_call_alloc_size): Fail gracefully when argument
	is not a call statement.

gcc/testsuite/ChangeLog:

	PR tree-optimization/99489
	* gcc.dg/Wstringop-truncation-9.c: New test.
2021-03-13 13:45:51 -07:00
Paul Thomas
7987beec67 Fortran: Fix for class defined operators [PR99125].
2021-03-13  Paul Thomas  <pault@gcc.gnu.org>

gcc/fortran
	PR fortran/99125
	* trans-array.c (gfc_conv_expr_descriptor): For deferred length
	length components use the ss_info string length instead of
	gfc_get_expr_charlen. Make sure that the deferred string length
	is a variable before assigning to it. Otherwise use the expr.
	* trans-expr.c (gfc_conv_string_length): Make sure that the
	deferred string length is a variable before assigning to it.

gcc/testsuite/
	PR fortran/99125
	* gfortran.dg/alloc_deferred_comp_1.f90: New test.
2021-03-13 11:39:57 +00:00
Jakub Jelinek
bbdf59fdbc match.pd: Don't optimize vector X + (X << C) -> X * (1 + (1 << C)) if there is no mult support [PR99544]
E.g. on aarch64, the target has V2DImode addition and shift by scalar
optabs, but doesn't have V2DImode multiply.  The following testcase
ICEs because this simplification is done after last lowering, but
generally, even if it is done before that, turning it into a multiplication
will not be an improvement because that means scalarization, while the former
can be done in vectors.

It would be nice if we added expansion support for vector multiplication
by uniform constants using shifts and additions like we have for scalar
multiplication, but that is something that can be done in stage1.

2021-03-13  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/99544
	* match.pd (X + (X << C) -> X * (1 + (1 << C))): Don't simplify
	if for vector types multiplication can't be done in type's mode.

	* gcc.dg/gomp/pr99544.c: New test.
2021-03-13 08:56:15 +01:00
Ian Lance Taylor
3972574f11 misc/cgo/testcarchive: don't use == for string equality in C code
Backport of https://golang.org/cl/300993.

For PR go/99553

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/301458
2021-03-12 20:06:50 -08:00
Eugene Rozenfeld
8c2cf7f4f7 MAINTAINERS: Add myself for write after approval
ChangeLog:

2021-03-12  Eugene Rozenfeld  <erozen@microsoft.com>

	* MAINTAINERS (Write After Approval): Add myself.
2021-03-12 17:45:39 -08:00
Mike Frysinger
ff4816dff0 sim: drop dep on configure-gdb
I'm not entirely sure why this is here since the sim doesn't use
anything from the gdb/ dir directly, and the commit that added it
included a bunch more changes and doesn't seem to call out this
dep specifically.

ChangeLog:

	* Makefile.def: Remove all-sim dependency on configure-gdb.
	* Makefile.in: Regenerated.
2021-03-12 19:48:13 -05:00
GCC Administrator
6da2762a3b Daily bump. 2021-03-13 00:16:20 +00:00
Nathan Sidwell
6e885ad328 c++: ICE with using-decl [PR 99238]
This ICE was caused by a stray TREE_VISITED marker.  The lookup
machinery was leaving it there due to the way I'd arranged for it to
be cleared.  That was presuming the name_lookup::value field didn't
change, and that wasn't always true in the using-decl processing.  I
took the opportunity to break out a helper, and then call it
immediately after lookups, rather than wait until destructor time.
Added some asserts the module machinery to catch further cases of
this.

	PR c++/99238
	gcc/cp/
	* module.cc (depset:#️⃣:add_binding_entity): Assert not
	visited.
	(depset::add::add_specializations): Likewise.
	* name-lookup.c (name_lookup::dedup): New.
	(name_lookup::~name_lookup): Assert not deduping.
	(name_lookup::restore_state): Likewise.
	(name_lookup::add_overload): Replace outlined code with dedup
	call.
	(name_lookup::add_value): Likewise.
	(name_lookup::search_namespace_only): Likewise.
	(name_lookup::adl_namespace_fns): Likewise.
	(name_lookup::adl_class_fns): Likewise.
	(name_lookup::search_adl): Likewise.  Add clearing dedup call.
	(name_lookup::search_qualified): Likewise.
	(name_lookup::search_unqualified): Likewise.
	gcc/testsuite/
	* g++.dg/modules/pr99238.h: New.
	* g++.dg/modules/pr99238_a.H: New.
	* g++.dg/modules/pr99238_b.H: New.
2021-03-12 10:23:05 -08:00
Eric Botcazou
d8b84e2771 Fix memory constraint bug in SPARC back-end
It's a bug exposed by the recent LRA changes, whereby the T constraint
fails to behave properly when LRA is enabled (unlike when reload is
enabled).  The patch also gets rid of the awkward W constraint, which
is strictly equivalent to m in 64-bit mode and, as a result, renames
the w constraint into W.

gcc/
	PR target/99422
	* config/sparc/constraints.md (w): Rename to...
	(W): ... this and ditch previous implementation.
	* config/sparc/sparc.md (*movdi_insn_sp64): Replace W with m.
	(*movdf_insn_sp64): Likewise.
	(*mov<VM64:mode>_insn_sp64): Likewise.
	* config/sparc/sync.md (*atomic_compare_and_swap<mode>_1): Replace
	w with W.
	(atomic_compare_and_swap_leon3_1): Likewise.
	(*atomic_compare_and_swapdi_v8plus): Likewise.
	* config/sparc/sparc.c (memory_ok_for_ldd): Remove useless test on
	architecture and add missing address validity check during LRA.
2021-03-12 18:52:07 +01:00