Commit Graph

184651 Commits

Author SHA1 Message Date
David Faust
d992ebaa80 MAINTAINERS: Add myself for write after approval
ChangeLog:

2021-04-23  David Faust  <david.faust@oracle.com>

	* MAINTAINERS (Write After Approval): Add myself.
2021-04-23 09:12:43 -07:00
Uros Bizjak
d2324a5ab3 i386: Fix atomic FP peepholes [PR100182]
64bit loads to/stores from x87 and SSE registers are atomic also on 32-bit
targets, so there is no need for additional atomic moves to a temporary
register.

Introduced load peephole2 patterns assume that there won't be any additional
loads from the load location outside the peepholed sequence and wrongly
removed the source location initialization.

OTOH, introduced store peephole2 patterns assume there won't be any additional
loads from the stored location outside the peepholed sequence and wrongly
removed the destination location initialization.  Note that we can't use plain
x87 FST instruction to initialize destination location because FST converts
the value to the double-precision format, changing bits during move.

The patch restores removed initializations in load and store patterns.
Additionally, plain x87 FST in store peephole2 patterns is prevented by
limiting the store operand source to SSE registers.

2021-04-23  Uroš Bizjak  <ubizjak@gmail.com>

gcc/
	PR target/100182
	* config/i386/sync.md (FILD_ATOMIC/FIST_ATOMIC FP load peephole2):
	Copy operand 3 to operand 4.  Use sse_reg_operand
	as operand 3 predicate.
	(FILD_ATOMIC/FIST_ATOMIC FP load peephole2 with mem blockage): Ditto.
	(LDX_ATOMIC/STX_ATOMIC FP load peephole2): Ditto.
	(LDX_ATOMIC/LDX_ATOMIC FP load peephole2 with mem blockage): Ditto.
	(FILD_ATOMIC/FIST_ATOMIC FP store peephole2):
	Copy operand 1 to operand 0.
	(FILD_ATOMIC/FIST_ATOMIC FP store peephole2 with mem blockage): Ditto.
	(LDX_ATOMIC/STX_ATOMIC FP store peephole2): Ditto.
	(LDX_ATOMIC/LDX_ATOMIC FP store peephole2 with mem blockage): Ditto.

gcc/testsuite/

	PR target/100182
	* gcc.target/i386/pr100182.c: New test.
	* gcc.target/i386/pr71245-1.c (dg-final): Xfail scan-assembler-not.
	* gcc.target/i386/pr71245-2.c (dg-final): Ditto.
2021-04-23 17:30:34 +02:00
Alex Coplan
5d87c2251c early-remat.c: Fix new/delete mismatch [PR100230]
This simple patch fixes a mistmatched operator new/delete in
early-remat.c which triggers ASan errors on (at least) AArch64 when
compiling SVE code.

gcc/ChangeLog:

	PR rtl-optimization/100230
	* early-remat.c (early_remat::sort_candidates): Use delete[]
	instead of delete for array allocated with new[].
2021-04-23 14:09:15 +01:00
Jonathan Wakely
0e1e7b7790 libstdc++: Allow net::io_context to compile without <poll.h> [PR 100180]
This adds dummy placeholders to net::io_context so that it can still be
compiled on targets without <poll.h>.

libstdc++-v3/ChangeLog:

	PR libstdc++/100180
	* include/experimental/io_context (io_context): Define
	dummy_pollfd type so that most member functions still compile
	without <poll.h> and struct pollfd.
2021-04-23 13:54:39 +01:00
Jonathan Wakely
3517dfe05c libstdc++: Clarify argument to net::io_context::async_wait
Add a comment documenting the __w parameter of the private
ios_context::async_wait function. Add casts to callers, making the
conversions explicit.

libstdc++-v3/ChangeLog:

	* include/experimental/io_context (io_context::async_wait): Add
	comment.
	* include/experimental/socket (basic_socket::async_connect):
	Cast wait_type constant to int.
	(basic_datagram_socket::async_receive): Likewise.
	(basic_datagram_socket::async_receive_from): Likewise.
	(basic_datagram_socket::async_send): Likewise.
	(basic_datagram_socket::async_send_to): Likewise.
	(basic_stream_socket::async_receive): Likewise.
	(basic_stream_socket::async_send): Likewise. Use io_context
	parameter directly, instead of via an executor.
	(basic_socket_acceptor::async_accept): Likewise.
2021-04-23 13:54:39 +01:00
Jonathan Wakely
a752a43073 libstdc++ Simplify definition of net::socket_base constants
libstdc++-v3/ChangeLog:

	* include/experimental/socket (socket_base::shutdown_type):
	(socket_base::wait_type, socket_base::message_flags):
	Remove enumerators. Initialize constants directly with desired
	values.
	(socket_base::message_flags): Make all operators constexpr and
	noexcept.
	* testsuite/util/testsuite_common_types.h (test_bitmask_values):
	New test utility.
	* testsuite/experimental/net/socket/socket_base.cc: New test.
2021-04-23 13:54:34 +01:00
Patrick Palka
87fc34a461 c++: Fix pretty printing pointer to function type [PR98767]
When pretty printing a pointer to function type,
pp_cxx_parameter_declaration_clause ends up always outputting an empty
function parameter list because the loop that outputs the list iterates
over 'args' instead of 'types', and 'args' is empty when a FUNCTION_TYPE
is passed to this routine (as opposed to a FUNCTION_DECL).

This patch fixes this by making the loop iterate over 'types' instead.
This patch also moves the retrofitted chain-of-PARM_DECLs printing from
here to pp_cxx_requires_expr, the only caller that uses it.  Doing so
lets us easily output the trailing '...' in the parameter list of a
variadic function, which this patch also implements.

gcc/cp/ChangeLog:

	PR c++/98767
	* cxx-pretty-print.c (pp_cxx_parameter_declaration_clause):
	Adjust parameter list loop to iterate over 'types' instead of
	'args'.  Output the trailing '...' for a variadic function.
	Remove PARM_DECL support.
	(pp_cxx_requires_expr): Pretty print the parameter list directly
	instead of going through pp_cxx_parameter_declaration_clause.

gcc/testsuite/ChangeLog:

	PR c++/98767
	* g++.dg/concepts/diagnostic17.C: New test.
2021-04-23 08:47:02 -04:00
Patrick Palka
5f8aed72e7 c++: Refine enum direct-list-initialization [CWG2374]
This implements the wording changes of CWG2374, which clarifies the
wording of P0138 to forbid e.g. direct-list-initialization of a scoped
enumeration from a different scoped enumeration.

gcc/cp/ChangeLog:

	DR 2374
	* decl.c (is_direct_enum_init): Check the implicit
	convertibility requirement added by CWG 2374.

gcc/testsuite/ChangeLog:

	DR 2374
	* g++.dg/cpp1z/direct-enum-init2.C: New test.
2021-04-23 08:28:58 -04:00
Richard Biener
35b2be219f VEC_COND_EXPR code cleanup
This removes now unnecessary special-casings of VEC_COND_EXPRs after
making its first operand a gimple value.

2021-04-14  Richard Biener  <rguenther@suse.de>

	* genmatch.c (lower_cond): Remove VEC_COND_EXPR special-casing.
	(capture_info::capture_info): Likewise.
	(capture_info::walk_match): Likewise.
	(expr::gen_transform): Likewise.
	(dt_simplify::gen_1): Likewise.
	* gimple-match-head.c (maybe_resimplify_conditional_op):
	Remove VEC_COND_EXPR special-casing.
	(gimple_simplify): Likewise.
	* gimple.c (gimple_could_trap_p_1): Adjust.
	* tree-ssa-pre.c (compute_avail): Allow VEC_COND_EXPR
	to participate in PRE.
2021-04-23 13:05:45 +02:00
Richard Biener
58ad6b2802 First do add_noreturn_fake_exit_edges in connect_infinite_loops_to_exit
Most callers of connect_infinite_loops_to_exit already do this but
the few that do not end up with extra exit edges.  The following
makes that consistent, also matching the post-dominance DFS walk code.

2021-02-25  Richard Biener  <rguenther@suse.de>

	* cfganal.c (connect_infinite_loops_to_exit): First call
	add_noreturn_fake_exit_edges.
	* ipa-sra.c (process_scan_results): Do not call the now redundant
	add_noreturn_fake_exit_edges.
	* predict.c (tree_estimate_probability): Likewise.
	(rebuild_frequencies): Likewise.
	* store-motion.c (one_store_motion_pass): Likewise.
2021-04-23 12:05:42 +02:00
Richard Biener
500305a92e tree-optimization/100222 - remove redundant mark_irreducible_loops calls
loop_optimizer_init (LOOPS_NORMAL) already performs this (quite
expensive) marking.

2021-04-23  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/100222
	* predict.c (pass_profile::execute): Remove redundant call to
	mark_irreducible_loops.
	(report_predictor_hitrates): Likewise.
2021-04-23 12:05:36 +02:00
Richard Biener
b26485f1af Avoid more temporaries in IVOPTs
This avoids use of valid_gimple_rhs_p and instead gimplifies to
such a RHS, avoiding more SSA copies being generated by IVOPTs.

2021-04-14  Richard Biener  <rguenther@suse.de>

	* tree-ssa-loop-ivopts.c (rewrite_use_nonlinear_expr): Avoid
	valid_gimple_rhs_p by instead gimplifying to one.
2021-04-23 10:28:10 +02:00
Martin Liska
cbca62831c c++: Use STATIC_ASSERT for OVL_OP_MAX.
gcc/cp/ChangeLog:

	* cp-tree.h (STATIC_ASSERT): Prefer static assert.
	* lex.c (init_operators): Remove run-time check.
2021-04-23 09:37:18 +02:00
Richard Biener
700e542971 tree-optimization/99971 - improve BB vect dependence analysis
We can use TBAA even when we have a DR, do so.  For the testcase
that means fully vectorizing it instead of only vectorizing
the first store group resulting in suboptimal code.

2021-04-09  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/99971
	* tree-vect-data-refs.c (vect_slp_analyze_node_dependences):
	Always use TBAA for loads.

	* g++.dg/vect/slp-pr99971.cc: New testcase.
2021-04-23 08:46:06 +02:00
liuhongt
342de04d99 MASK_AVX256_SPLIT_UNALIGNED_STORE/LOAD should be cleared in opts->x_target_flags when X86_TUNE_AVX256_UNALIGNED_LOAD/STORE_OPTIMAL is enabled by target attribute.
gcc/ChangeLog:

	PR target/100093
	* config/i386/i386-options.c (ix86_option_override_internal):
	Clear MASK_AVX256_SPLIT_UNALIGNED_LOAD/STORE in x_target_flags
	when X86_TUNE_AVX256_UNALIGNED_LOAD/STORE_OPTIMAL is enabled
	by target attribute.

gcc/testsuite/ChangeLog:

	PR target/100093
	* gcc.target/i386/pr100093.c: New test.
2021-04-23 09:19:03 +08:00
GCC Administrator
e3948473e9 Daily bump. 2021-04-23 00:16:25 +00:00
David Edelsohn
6a2f49c699 aix: Switch AIX configurtion to DWARF2 debugging
This patch is in preparation for removing stabs debugging support from GCC.

The rs6000 configuration files remain somewhat intertwined with the
stabs debugging support, but the configuration no longer generates
stabs debugging information.

This patch means that earlier releases (Technology Levels) of AIX 7.1
and 7.2, prior to DWARF support and fixes, cannot build GCC or support
GCC.

gcc/ChangeLog:

	* config/rs6000/aix71.h (PREFERRED_DEBUGGING_TYPE): Change to
	DWARF2_DEBUG.
	* config/rs6000/aix72.h (PREFERRED_DEBUGGING_TYPE): Same.
2021-04-22 20:11:16 -04:00
David Edelsohn
0745b6fa66 aix: Remove AIX 6.1 support.
AIX 6.1 is past end of life and extended support.  This patch removes
the configuration option and references to AIX 6.1.

contrib/ChangeLog:

	* config-list.mk: Remove rs6000-ibm-aix6.1.
	Rename rs6000-ibm-aix7.1 to powerpc-ibm-aix7.1.
	Add powerpc-ibm-aix7.2.

gcc/ChangeLog:

	* config.gcc (powerpc-ibm-aix6.*): Remove.
	* config/rs6000/aix61.h: Delete.
2021-04-22 19:43:55 -04:00
David Edelsohn
b5f79f4d38 aix: delete AIX pre-PowerPC version of atomicity.h
The AIX-specific version of atomicity.h that provides compatibility
for the origina POWER architecture without atomic instructions no longer
is referenced.  This patch deletes the file.

libstdc++-v3/ChangeLog:

	* config/os/aix/atomicity.h: Delete.
2021-04-22 19:38:36 -04:00
Patrick Palka
4e1aaf32dd c++: Add testcase for already fixed PR [PR94508]
We correctly accept this testcase since r11-8144.

gcc/testsuite/ChangeLog:

	PR c++/94508
	* g++.dg/cpp2a/concepts-uneval3.C: New test.
2021-04-22 17:47:02 -04:00
Patrick Palka
92664c058d c++: Add testcase for already fixed PR [PR77435]
We correctly accept this testcase since r8-1437.

gcc/testsuite/ChangeLog:

	PR c++/77435
	* g++.dg/template/partial-specialization9.C: New test.
2021-04-22 17:47:00 -04:00
Marek Polacek
244dfb9511 c++: Prevent bogus -Wtype-limits warning with NTTP [PR100161]
Recently, we made sure that we never call value_dependent_expression_p
on an expression that isn't potential_constant_expression.  That caused
this bogus warning with a non-type template parameter, something that
users don't want to see.

The problem is that in tsubst_copy_and_build/LE_EXPR 't' is "i < n",
which, due to 'i', is not p_c_e, therefore we call t_d_e_p.  But the
type of 'n' isn't dependent, so we think the whole 't' expression is
not dependent.  It seems we need to test both op0 and op1 separately
to suppress this warning.

gcc/cp/ChangeLog:

	PR c++/100161
	* pt.c (tsubst_copy_and_build) <case PLUS_EXPR>: Test op0 and
	op1 separately for value- or type-dependence.

gcc/testsuite/ChangeLog:

	PR c++/100161
	* g++.dg/warn/Wtype-limits6.C: New test.
2021-04-22 17:35:38 -04:00
Patrick Palka
3275f2e2af c++: Add testcase for already fixed PR [PR84689]
We correctly accept this testcase since r11-1638.

gcc/testsuite/ChangeLog:

	PR c++/84689
	* g++.dg/cpp0x/sfinae67.C: New test.
2021-04-22 13:32:44 -04:00
Patrick Palka
330cc29c06 c++: Add testcase for already fixed PR [PR16617]
We correctly diagnose the invalid access since r11-1350.

gcc/testsuite/ChangeLog:

	PR c++/16617
	* g++.dg/template/access36.C: New test.
2021-04-22 13:32:40 -04:00
Tobias Burnus
ac456fd981 testsuite/substr_{9,10}.f90: Move to gfortran.dg/
gcc/testsuite/
	* substr_9.f90: Move to ...
	* gfortran.dg/substr_9.f90: ... here.
	* substr_10.f90: Move to ...
	* gfortran.dg/substr_10.f90: ... here.
2021-04-22 19:16:44 +02:00
Jonathan Wakely
6924588774 libstdc++: Fix semaphore to work with system_clock timeouts
The __cond_wait_until_impl function takes a steady_clock timeout, but
then sometimes tries to compare it to a time from the system_clock,
which won't compile.  Additionally, that function gets called with
system_clock timeouts, which also won't compile. This makes the function
accept timeouts for either clock, and compare to the time from the right
clock.

This fixes the compilation error that was causing two tests to fail on
non-futex targets, so we can revert the r12-11 change to disable them.

libstdc++-v3/ChangeLog:

	* include/bits/atomic_timed_wait.h (__cond_wait_until_impl):
	Handle system_clock as well as steady_clock.
	* testsuite/30_threads/semaphore/try_acquire_for.cc: Re-enable.
	* testsuite/30_threads/semaphore/try_acquire_until.cc:
	Re-enable.
2021-04-22 17:35:00 +01:00
Jonathan Wakely
58871c0331 libstdc++: Add options for libatomic to test
This fixes a linker error on AIX:

FAIL: 30_threads/semaphore/try_acquire_posix.cc (test for excess errors)
Excess errors:
ld: 0711-317 ERROR: Undefined symbol: .__atomic_fetch_add_8
ld: 0711-317 ERROR: Undefined symbol: .__atomic_load_8
ld: 0711-317 ERROR: Undefined symbol: .__atomic_fetch_sub_8
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
collect2: error: ld returned 8 exit status

libstdc++-v3/ChangeLog:

	* testsuite/30_threads/semaphore/try_acquire_posix.cc: Add
	options for libatomic.
2021-04-22 15:51:08 +01:00
Jonathan Wakely
19aa9bc989 libstdc++: Fix typo in comment
libstdc++-v3/ChangeLog:

	* config/os/gnu-linux/os_defines.h: Fix type in comment.
2021-04-22 15:49:27 +01:00
Jonathan Wakely
55650236cd libstdc++: Reject std::make_shared<T[]> [PR 99006]
Prior to C++20 it should be ill-formed to use std::make_shared with an
array type (and we don't support the C++20 feature to make it valid yet
anyway).

libstdc++-v3/ChangeLog:

	PR libstdc++/99006
	* include/bits/shared_ptr.h (allocate_shared): Assert that _Tp
	is not an array type.
	* include/bits/shared_ptr_base.h (__allocate_shared): Likewise.
	* testsuite/20_util/shared_ptr/creation/99006.cc: New test.
2021-04-22 15:49:27 +01:00
Martin Liska
3bb6a9c01f Fix various typos.
PR testsuite/100159
	PR testsuite/100192

gcc/ChangeLog:

	* builtins.c (expand_builtin): Fix typos and missing comments.
	* dwarf2out.c (gen_subprogram_die): Likewise.
	(gen_struct_or_union_type_die): Likewise.

gcc/fortran/ChangeLog:

	* frontend-passes.c (optimize_expr): Fix typos and missing comments.

gcc/testsuite/ChangeLog:

	* g++.dg/template/nontype29.C: Fix typos and missing comments.
	* gcc.dg/Warray-bounds-64.c: Likewise.
	* gcc.dg/Warray-parameter.c: Likewise.
	* gcc.dg/Wstring-compare.c: Likewise.
	* gcc.dg/format/gcc_diag-11.c: Likewise.
	* gfortran.dg/array_constructor_3.f90: Likewise.
	* gfortran.dg/matmul_bounds_9.f90: Likewise.
	* gfortran.dg/pr78033.f90: Likewise.
	* gfortran.dg/pr96325.f90: Likewise.
2021-04-22 16:36:54 +02:00
Thomas Rodgers
ae2f6e0174 libstdc++: Fix "bare" notifications dropped by waiters check
For types that track whether or not there extant waiters (e.g.
semaphore) internally, the __atomic_notify_address_bare() call was
introduced to avoid the overhead of loading the atomic count of
waiters. For platforms that don't have Futex, however, there was
still a check for waiters, and seeing that there are none (because
in the bare case, the count is not incremented), the notification
is dropped. This commit addresses that case.

libstdc++-v3/ChangeLog:
	* include/bits/atomic_wait.h: Always notify waiters in the
	case of 'bare' address notification.
2021-04-22 07:34:02 -07:00
Uros Bizjak
0cda606d08 i386: Fix unsigned int -> double conversion on i386 w/ -mfpmath=sse [PR100119]
2021-04-22  Uroš Bizjak  <ubizjak@gmail.com>

gcc/
	PR target/100119
	* config/i386/i386-expand.c (ix86_expand_convert_uns_sidf_sse):
	Remove the sign with FE_DOWNWARD, where x - x = -0.0.

gcc/testsuite/

	PR target/100119
	* gcc.target/i386/pr100119.c: New test.
2021-04-22 16:31:44 +02:00
Jakub Jelinek
0f4588141f libstdc++: Add workaround for ia32 floating atomics miscompilations [PR100184]
gcc on ia32 miscompiles various atomics involving floating point,
unfortunately I'm afraid it is too late to fix that for 11.1 and
as I'm quite lost on it, it might take a while for 12 too
(disabling all the 8 peephole2s would be easiest, but then we'd
run into optimization regressions).

While 1.cc just FAILs, with dejagnu 1.6.1 wait_notify.cc hangs the
make check even after the timeout fires.  The following patch therefore
xfails the former and skips the latter.

Tested on x86_64-linux where
make check RUNTESTFLAGS='conformance.exp=atomic_float/*.cc'
is still
                === libstdc++ Summary ===

 # of expected passes            8
and on i686-linux, where it is now
                === libstdc++ Summary ===

 # of expected passes            5
 # of expected failures          1
 # of unsupported tests          1

2021-04-22  Jakub Jelinek  <jakub@redhat.com>

	PR target/100182
	* testsuite/29_atomics/atomic_float/1.cc: Add dg-xfail-run-if for
	ia32.
	* testsuite/29_atomics/atomic_float/wait_notify.cc: Add dg-skip-if for
	ia32.
2021-04-22 15:09:58 +02:00
Jonathan Wakely
4b2db80771 libstdc++: Remove #error from <semaphore> implementation [PR 100179]
This removes the #error from <bits/semaphore_base.h> for the case where
neither __atomic_semaphore nor __platform_semaphore is defined.

Also rename the _GLIBCXX_REQUIRE_POSIX_SEMAPHORE macro to
_GLIBCXX_USE_POSIX_SEMAPHORE for consistency with the similar
_GLIBCXX_USE_CXX11_ABI macro that can be used to request an alternative
(ABI-changing) implementation.

libstdc++-v3/ChangeLog:

	PR libstdc++/100179
	* include/bits/semaphore_base.h: Remove #error.
	* include/std/semaphore: Do not define anything unless one of
	the implementations is available.
2021-04-22 13:59:32 +01:00
Christophe Lyon
d44d8ed6b4 testsuite/aarch64: Run pr99988.c test under lp64 only
The new test fails with -mabi=ilp32:
sorry, unimplemented: return address signing is only supported for '-mabi=lp64'

2021-04-22  Christophe Lyon  <christophe.lyon@linaro.org>

	gcc/testsuite/
	PR target/99988
	* gcc.target/aarch64/pr99988.c: Skip if not lp64 target.
2021-04-22 12:46:22 +00:00
Tobias Burnus
faf7d413a3 gfortran.dg/pr68078.f90: Avoid increasing RLIMIT_AS
pr68078.f90 tests out-of-memory handling and calls set_vm_limit to set the
soft limit.  However, setrlimit was then called with hard limit RLIM_INFINITY,
which failed when the current hard limit was lower.

gcc/testsuite/
	* gfortran.dg/set_vm_limit.c (set_vm_limit): Call getrlimit, use
	obtained hard limit, and only call setrlimit if new softlimit is lower.
2021-04-22 11:14:18 +02:00
Richard Biener
5668843346 testsuite/100176 - fix struct-layout-1_generate.c compile
With -Werror=return-type we run into compile fails complaining about
missing return stmts.

2021-04-21  Richard Biener  <rguenther@suse.de>

	PR testsuite/100176
	* objc.dg/gnu-encoding/struct-layout-encoding-1_generate.c: Add
	missing return.
2021-04-22 09:51:01 +02:00
Richard Biener
d42088e453 Avoid -latomic for amdgcn offloading
libatomic isn't built for amdgcn but reduction-16.c adds it
via -foffload=-latomic when offloading for nvptx is enabled.
The following avoids linker errors when offloading to amdgcn is enabled
as well.

2021-04-21  Richard Biener  <rguenther@suse.de>

libgomp/
	* testsuite/libgomp.c-c++-common/reduction-16.c: Use -latomic
	only on nvptx-none.
2021-04-22 08:29:11 +02:00
Michael Meissner
3cf04d1afa Fix Fortran rounding issues, PR fortran/96983.
I was looking at Fortran PR 96983, which fails on the PowerPC when trying to
run the test PR96711.F90.  The compiler ICEs because the PowerPC does not have
a floating point type with a type precision of 128.  The reason is that the
PowerPC has 3 different 128 bit floating point types (__float128/_Float128,
__ibm128, and long double).  Currently long double uses the IBM extended double
type, but we would like to switch to using IEEE 128-bit long doubles in the
future.

In order to prevent the compiler from converting explicit __ibm128 types to
long double when long double uses the IEEE 128-bit representation, we have set
up the precision for __ibm128 to be 128, long double to be 127, and
__float128/_Float128 to be 126.

Originally, I was trying to see if for Fortran, I could change the precision of
long double to be 128 (Fortran doesn't access __ibm128), but it quickly became
hard to get the changes to work.

I looked at the Fortran code in build_round_expr, and I came to the conclusion
that there is no reason to promote the floating point type.  If you just do a
normal round of the value using the current floating point format and then
convert it to the integer type.  We don't have an appropriate built-in function
that provides the equivalent of llround for 128-bit integer types.

This patch fixes the compiler crash.

However, while with this patch, the PowerPC compiler will not crash when
building the test case, it will not run on the current default installation.
The failure is because the test is explicitly expecting 128-bit floating point
to handle 10384593717069655257060992658440192_16 (i.e. 2**113).

By default, the PowerPC uses IBM extended double used for 128-bit floating
point.  The IBM extended double format is a pair of doubles that provides more
mantissa bits but does not grow the expoenent range.  The value in the test is
fine for IEEE 128-bit floating point, but it is too large for the PowerPC
extended double setup.

I have built the following tests with this patch:

   * I have built a bootstrap compiler on a little endian power9 Linux system
     with the default long double format (IBM extended double).  The
     pr96711.f90 test builds, but it does not run due to the range of the
     real*16 exponent.  There were no other regressions in the C/C++/Fortran
     tests.

   * I have built a bootstrap compiler on a little endian power9 Linux system
     with the default long double format set to IEEE 128-bit. I used the
     Advance Toolchain 14.0-2 to provide the IEEE 128-bits.  The compiler was
     configured to build power9 code by default, so the test generated native
     power9 IEEE 128-bit instructions.  The pr96711.f90 test builds and runs
     correctly in this setup.

   * I have built a bootstrap compiler on a big endian power8 Linux system with
     the default long double format (IBM extended double).  Like the first
     case, the pr96711.f90 test does not crash the compiler, but the test fails
     due to the range of the real*16 exponent.    There were no other
     regressions in the C/C++/Fortran tests.

   * I built a bootstrap compiler on my x86_64 laptop.  There were no
     regressions in the tests.

gcc/fortran/
2021-04-21  Michael Meissner  <meissner@linux.ibm.com>

	PR fortran/96983
	* trans-intrinsic.c (build_round_expr): If int type is larger than
	long long, do the round and convert to the integer type.  Do not
	try to find a floating point type the exact size of the integer
	type.
2021-04-21 23:03:05 -04:00
GCC Administrator
c1ef0c9234 Daily bump. 2021-04-22 00:16:32 +00:00
Tobias Burnus
0c0bdcc60c libgomp.fortran/depobj-1.f90: Fix omp_depend_kind
libgomp/
	* testsuite/libgomp.fortran/depobj-1.f90: Use omp_lib's
	omp_depend_kind instead of defining it as 16.
2021-04-21 22:47:18 +02:00
Thomas Rodgers
7eeb8c04e5 [libstdc++] Fix test timeout in stop_calback/destroy.cc
A change was made to __atomic_semaphore::_S_do_try_acquire() to
(ideally) let the compare_exchange reload the value of __old rather than
always reloading it twice. This causes _M_acquire to spin indefinitely
if the value of __old is already 0.

libstdc++-v3/ChangeLog:
	* include/bits/semaphore_base.h: Always reload __old in
	__atomic_semaphore::_S_do_try_acquire().
	* testsuite/30_threads/stop_token/stop_callback/destroy.cc:
	re-enable testcase.
2021-04-21 13:28:08 -07:00
Iain Sandoe
a44895ce7f Darwin, X86 : Fix bootstrap break from flags changes.
The changes from r12-36-g1751bec027f030515889fcf4baa9c91501aafc85
did not remove the uses of TARGET_ISA_* from i386/darwin.h.

Fixed thus.

gcc/ChangeLog:

	* config/i386/darwin.h (TARGET_64BIT): Remove definition
	based on TARGET_ISA_64BIT.
	(TARGET_64BIT_P): Remove definition based on
	TARGET_ISA_64BIT_P().
2021-04-21 20:40:48 +01:00
Martin Liska
f2b4f212a9 Revert "Use std:🧵:hardware_concurrency in lto-wrapper.c."
This reverts commit 0a18305ee1.
2021-04-21 21:33:41 +02:00
Martin Liska
a63035ae26 Call toplev::finalize in CHECKING_P mode.
gcc/ChangeLog:

	PR jit/98615
	* main.c (main): Call toplev::finalize in CHECKING_P mode.
	* ipa-modref.c (ipa_modref_c_finalize): summaries are NULL
	when incremental LTO linking happens.
2021-04-21 20:09:19 +02:00
Tobias Burnus
95dfc3ac7b libgomp/testsuite: Fix checks for dg-excess-errors
For the tests modified below, the effective target line has to be effective
when compiling for an offload target, except that variable-not-offloaded.c
would compile with unified-share memory and pr86416-*.c if long double/float128
is supported.
The previous check used a run-time device ability check. This new variant
now enables those dg- lines when _compiling_ for nvptx or gcn.

libgomp/ChangeLog:

	* testsuite/lib/libgomp.exp (offload_target_to_openacc_device_type):
	New, based on check_effective_target_offload_target_nvptx.
	(check_effective_target_offload_target_nvptx): Call it.
	(check_effective_target_offload_target_amdgcn): New.
	* testsuite/libgomp.c-c++-common/function-not-offloaded.c:
	Require target offload_target_nvptx || offload_target_amdgcn.
	* testsuite/libgomp.c-c++-common/variable-not-offloaded.c: Likewise.
	* testsuite/libgomp.c/pr86416-1.c: Likewise.
	* testsuite/libgomp.c/pr86416-2.c: Likewise.
2021-04-21 20:07:19 +02:00
Philippe Blain
c2fc1702cb libstdc++: Install libstdc++*-gdb.py more robustly [PR 99453]
In order for GDB to auto-load the pretty printers, they must be installed
as "libstdc++.$ext-gdb.py", where 'libstdc++.$ext' is the name of the
object file that is loaded by GDB [1], i.e. the libstdc++ shared library.

The approach taken in libstdc++-v3/python/Makefile.am is to loop over
files matching 'libstdc++*' in $(DESTDIR)$(toolexeclibdir) and choose
the last file matching that glob that is not a symlink, the Libtool
'*.la' file or a Python file.

That works fine for ELF targets where the matching names are:

  libstdc++.a
  libstdc++.so
  libstdc++.so.6
  libstdc++.so.6.0.29

But not for macOS with:

  libstdc++.6.dylib
  libstdc++.a

Or MinGW with:

  libstdc++-6.dll
  libstdc++.dll.a

Try to make a better job at installing the pretty printers with the
correct name by copying the approach taken by isl [2], that is, using
a sed invocation on the Libtool-generated 'libstdc++.la' to read the
correct name for the current platform.

[1] https://sourceware.org/gdb/onlinedocs/gdb/objfile_002dgdbdotext-file.html
[2] https://repo.or.cz/isl.git/blob/HEAD:/Makefile.am#l611

libstdc++-v3/ChangeLog:

	PR libstdc++/99453
	* python/Makefile.am: Install libstdc++*-gdb.py more robustly.
	* python/Makefile.in: Regenerate.

Co-authored-by: Jonathan Wakely <jwakely@redhat.com>
2021-04-21 16:55:15 +01:00
David Edelsohn
2d468b1326 testsuite: Fix bind_c_array_params_2.f90 on AIX
gcc/testsuite/ChangeLog:

	* gfortran.dg/bind_c_array_params_2.f90: Look for AIX-specific call
	pattern.
2021-04-21 11:43:18 -04:00
Thomas Rodgers
5445da1a94 [libstdc++] Add missing _M_try_acquire() to __platform_semaphore
libstdc++-v3/ChangeLog:
	* include/bits/semaphore_base.h: Add missing _M_try_acquire()
	member to __platform_wait.
2021-04-21 08:18:28 -07:00
Martin Liska
7f9b7ccf0c LTO: fallback to -flto=N if -flto=jobserver does not work.
gcc/ChangeLog:

	* lto-wrapper.c (run_gcc): When -flto=jobserver is used, but the
	makeserver cannot be detected, then use -flto=N fallback.
2021-04-21 17:15:27 +02:00