Commit Graph

184529 Commits

Author SHA1 Message Date
Jonathan Wakely
3f4aa4579a libstdc++: Add missing 'inline' specifiers to net::ip functions [PR 100259]
libstdc++-v3/ChangeLog:

	PR libstdc++/100259
	* include/experimental/internet (net::ip::make_error_code)
	(net::ip::make_error_condition, net::ip::make_network_v4)
	(net::ip::operator==(const udp&, const udp&)): Add 'inline'.
2021-04-26 11:40:13 +01:00
Thomas Schwinge
22cff118f7 Add '-Wopenacc-parallelism'
... to diagnose potentially suboptimal choices regarding OpenACC parallelism.

Not enabled by default: too noisy ("*potentially* suboptimal choices"); see
XFAILed 'dg-bogus'es.

	gcc/c-family/
	* c.opt (Wopenacc-parallelism): New.
	gcc/fortran/
	* lang.opt (Wopenacc-parallelism): New.
	gcc/
	* omp-offload.c (oacc_validate_dims): Implement
	'-Wopenacc-parallelism'.
	* doc/invoke.texi (-Wopenacc-parallelism): Document.
	gcc/testsuite/
	* c-c++-common/goacc/diag-parallelism-1.c: New.
	* c-c++-common/goacc/acc-icf.c: Specify '-Wopenacc-parallelism',
	and match diagnostics, as appropriate.
	* c-c++-common/goacc/classify-kernels-unparallelized.c: Likewise.
	* c-c++-common/goacc/classify-kernels.c: Likewise.
	* c-c++-common/goacc/classify-parallel.c: Likewise.
	* c-c++-common/goacc/classify-routine.c: Likewise.
	* c-c++-common/goacc/classify-serial.c: Likewise.
	* c-c++-common/goacc/kernels-decompose-1.c: Likewise.
	* c-c++-common/goacc/kernels-decompose-2.c: Likewise.
	* c-c++-common/goacc/parallel-dims-1.c: Likewise.
	* c-c++-common/goacc/parallel-reduction.c: Likewise.
	* c-c++-common/goacc/pr70688.c: Likewise.
	* c-c++-common/goacc/routine-1.c: Likewise.
	* c-c++-common/goacc/routine-level-of-parallelism-2.c: Likewise.
	* c-c++-common/goacc/uninit-dim-clause.c: Likewise.
	* gfortran.dg/goacc/classify-kernels-unparallelized.f95: Likewise.
	* gfortran.dg/goacc/classify-kernels.f95: Likewise.
	* gfortran.dg/goacc/classify-parallel.f95: Likewise.
	* gfortran.dg/goacc/classify-routine.f95: Likewise.
	* gfortran.dg/goacc/classify-serial.f95: Likewise.
	* gfortran.dg/goacc/kernels-decompose-1.f95: Likewise.
	* gfortran.dg/goacc/kernels-decompose-2.f95: Likewise.
	* gfortran.dg/goacc/parallel-tree.f95: Likewise.
	* gfortran.dg/goacc/routine-4.f90: Likewise.
	* gfortran.dg/goacc/routine-level-of-parallelism-1.f90: Likewise.
	* gfortran.dg/goacc/routine-module-mod-1.f90: Likewise.
	* gfortran.dg/goacc/routine-multiple-directives-1.f90: Likewise.
	* gfortran.dg/goacc/uninit-dim-clause.f95: Likewise.
	libgomp/
	* testsuite/libgomp.oacc-c-c++-common/firstprivate-1.c: Specify
	'-Wopenacc-parallelism', and match diagnostics, as appropriate.
	* testsuite/libgomp.oacc-c-c++-common/loop-auto-1.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/loop-red-w-1.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/loop-red-w-2.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/loop-w-1.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/mode-transitions.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/par-reduction-1.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/par-reduction-2.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/parallel-dims.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/parallel-reduction.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/pr85381-3.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/private-variables.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/reduction-5.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/reduction-7.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/routine-g-1.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/routine-w-1.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/routine-wv-2.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/static-variable-1.c:
	Likewise.
	* testsuite/libgomp.oacc-fortran/optional-private.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/par-reduction-2-1.f: Likewise.
	* testsuite/libgomp.oacc-fortran/par-reduction-2-2.f: Likewise.
	* testsuite/libgomp.oacc-fortran/parallel-dims.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/parallel-reduction.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/pr84028.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/private-variables.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/reduction-1.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/reduction-5.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/reduction-6.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/routine-7.f90: Likewise.

Co-Authored-By: Nathan Sidwell <nathan@codesourcery.com>
Co-Authored-By: Tom de Vries <vries@codesourcery.com>
Co-Authored-By: Julian Brown <julian@codesourcery.com>
Co-Authored-By: Kwok Cheung Yeung <kcy@codesourcery.com>
2021-04-26 12:32:00 +02:00
Thomas Schwinge
7c640779bf [OpenACC] Don't compile libgomp testcases with '-w'
We'd like to actually catch compiler diagnostics (and currently there aren't
any).

	libgomp/
	* testsuite/libgomp.oacc-c-c++-common/par-reduction-1.c: Don't
	compile with '-w'.
	* testsuite/libgomp.oacc-c-c++-common/par-reduction-2.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/parallel-reduction.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/reduction-5.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/reduction-6.c: Likewise.
	* testsuite/libgomp.oacc-fortran/parallel-reduction.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/reduction-1.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/reduction-5.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/reduction-6.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/reduction-7.f90: Likewise.
2021-04-26 12:05:53 +02:00
Richard Biener
b972e036f4 Move gimplify_buildN API local to only remaining user
This moves the legacy gimplify_buildN API to tree-vect-generic.c,
its only user and elides the gimplification step, making it a wrapper
around gimple_build, adjusting tree_vec_extract for this.

I've noticed that vector CTOR expansion doesn't deal with unfolded
{} and thus this makes it more resilent.  I've also adjusted the
match.pd vector CTOR extraction code to make sure it doesn't
produce a CTOR when folding would make it a vector constant.

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

	* tree-cfg.h (gimplify_build1): Remove.
	(gimplify_build2): Likewise.
	(gimplify_build3): Likewise.
	* tree-cfg.c (gimplify_build1): Move to tree-vect-generic.c.
	(gimplify_build2): Likewise.
	(gimplify_build3): Likewise.
	* tree-vect-generic.c (gimplify_build1): Move from tree-cfg.c.
	Modernize.
	(gimplify_build2): Likewise.
	(gimplify_build3): Likewise.
	(tree_vec_extract): Use resimplify with following SSA edges.
	(expand_vector_parallel): Avoid passing NULL size/bitpos
	to tree_vec_extract.
	* expr.c (store_constructor): Deal with zero-element CTORs.
	* match.pd (bit_field_ref <vector CTOR>): Make sure to
	produce vector constants when possible.
2021-04-26 11:04:00 +02:00
Richard Biener
152334cfb7 Remove gimplify_buildN API use from complex lowering
This removes the legacy gimplify_buildN API use from complex lowering.

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

	* tree-complex.c: Include gimple-fold.h.
	(expand_complex_addition): Use gimple_build.
	(expand_complex_multiplication_components): Likewise.
	(expand_complex_multiplication): Likewise.
	(expand_complex_div_straight): Likewise.
	(expand_complex_div_wide): Likewise.
	(expand_complex_division): Likewise.
	(expand_complex_conjugate): Likewise.
	(expand_complex_comparison): Likewise.
2021-04-26 11:04:00 +02:00
Richard Biener
76da5b8e65 Remove gimplify_buildN API use from phiopt
This removes use of the legacy gimplify_buildN API from phiopt.

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

	* tree-ssa-phiopt.c (two_value_replacement): Remove use
	of legacy gimplify_buildN API.
2021-04-26 11:04:00 +02:00
Richard Biener
577d05fc91 tree-optimization/99473 - more cselim
This fixes the pre-condition on cselim to include all references
and decls when they end up as auto-var.

Bootstrapped/tested on x86_64-linux

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

	PR tree-optimization/99473
	* tree-ssa-phiopt.c (cond_store_replacement): Handle all
	stores.

	* gcc.dg/tree-ssa/pr99473-1.c: New testcase.
2021-04-26 10:10:06 +02:00
Richard Biener
52a5515ed6 Simplify {gimplify_and_,}update_call_from_tree API
This removes update_call_from_tree in favor of
gimplify_and_update_call_from_tree, removing some code duplication
and simplifying the API use.  Some users of update_call_from_tree
have been transitioned to replace_call_with_value and the API
and its dependences have been moved to gimple-fold.h.

This shaves off another user of valid_gimple_rhs_p which is now
only used from within gimple-fold.c and thus moved and made private.

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

	* tree-ssa-propagate.h (valid_gimple_rhs_p): Remove.
	(update_gimple_call): Likewise.
	(update_call_from_tree): Likewise.
	* tree-ssa-propagate.c (valid_gimple_rhs_p): Remove.
	(valid_gimple_call_p): Likewise.
	(move_ssa_defining_stmt_for_defs): Likewise.
	(finish_update_gimple_call): Likewise.
	(update_gimple_call): Likewise.
	(update_call_from_tree): Likewise.
	(propagate_tree_value_into_stmt): Use replace_call_with_value.
	* gimple-fold.h (update_gimple_call): Declare.
	* gimple-fold.c (valid_gimple_rhs_p): Move here from
	tree-ssa-propagate.c.
	(update_gimple_call): Likewise.
	(valid_gimple_call_p): Likewise.
	(finish_update_gimple_call): Likewise, and simplify.
	(gimplify_and_update_call_from_tree): Implement
	update_call_from_tree functionality, avoid excessive
	push/pop_gimplify_context.
	(gimple_fold_builtin): Use only gimplify_and_update_call_from_tree.
	(gimple_fold_call): Likewise.
	* gimple-ssa-sprintf.c (try_substitute_return_value): Likewise.
	* tree-ssa-ccp.c (ccp_folder::fold_stmt): Likewise.
	(pass_fold_builtins::execute): Likewise.
	(optimize_stack_restore): Use replace_call_with_value.
	* tree-cfg.c (fold_loop_internal_call): Likewise.
	* tree-ssa-dce.c (maybe_optimize_arith_overflow): Use
	only gimplify_and_update_call_from_tree.
	* tree-ssa-strlen.c (handle_builtin_strlen): Likewise.
	(handle_builtin_strchr): Likewise.
	* tsan.c: Include gimple-fold.h instead of tree-ssa-propagate.h.

	* config/rs6000/rs6000-call.c (rs6000_gimple_fold_builtin):
	Use replace_call_with_value.
2021-04-26 10:08:46 +02:00
Jakub Jelinek
297bfacdb4 vmsdbgout: Remove useless register keywords
register keyword was removed in C++17, and in vmsdbgout.c it served no
useful purpose.

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

	PR debug/100255
	* vmsdbgout.c (ASM_OUTPUT_DEBUG_STRING, vmsdbgout_begin_block,
	vmsdbgout_end_block, lookup_filename, vmsdbgout_source_line): Remove
	register keywords.
2021-04-26 09:59:15 +02:00
GCC Administrator
3971aee9dd Daily bump. 2021-04-26 00:16:26 +00:00
liuhongt
c54a9f7259 Add folding and remove expanders for x86 *pcmp{et,gt}* builtins [PR target/98911]
gcc/ChangeLog:

	PR target/98911
	* config/i386/i386-builtin.def (BDESC): Change the icode of
	the following builtins to CODE_FOR_nothing.
	* config/i386/i386.c (ix86_gimple_fold_builtin): Fold
	IX86_BUILTIN_PCMPEQB128, IX86_BUILTIN_PCMPEQW128,
	IX86_BUILTIN_PCMPEQD128, IX86_BUILTIN_PCMPEQQ,
	IX86_BUILTIN_PCMPEQB256, IX86_BUILTIN_PCMPEQW256,
	IX86_BUILTIN_PCMPEQD256, IX86_BUILTIN_PCMPEQQ256,
	IX86_BUILTIN_PCMPGTB128, IX86_BUILTIN_PCMPGTW128,
	IX86_BUILTIN_PCMPGTD128, IX86_BUILTIN_PCMPGTQ,
	IX86_BUILTIN_PCMPGTB256, IX86_BUILTIN_PCMPGTW256,
	IX86_BUILTIN_PCMPGTD256, IX86_BUILTIN_PCMPGTQ256.
	* config/i386/sse.md (avx2_eq<mode>3): Deleted.
	(sse2_eq<mode>3): Ditto.
	(sse4_1_eqv2di3): Ditto.
	(sse2_gt<mode>3): Rename to ..
	(*sse2_gt<mode>3): .. this.

gcc/testsuite/ChangeLog:

	PR target/98911
	* gcc.target/i386/pr98911.c: New test.
	* gcc.target/i386/funcspec-8.c: Replace __builtin_ia32_pcmpgtq
	with __builtin_ia32_pcmpistrm128 since it has been folded.
2021-04-25 09:18:08 +08:00
GCC Administrator
502ef97c4f Daily bump. 2021-04-25 00:16:26 +00:00
David Malcolm
61bfff562e analyzer: fix ICE on NULL change.m_expr [PR100244]
PR analyzer/100244 reports an ICE on a -Wanalyzer-free-of-non-heap
due to a case where free_of_non_heap::describe_state_change can be
passed a NULL change.m_expr for a suitably complicated symbolic value.

Bulletproof it by checking for change.m_expr being NULL before
dereferencing it.

gcc/analyzer/ChangeLog:
	PR analyzer/100244
	* sm-malloc.cc (free_of_non_heap::describe_state_change):
	Bulletproof against change.m_expr being NULL.

gcc/testsuite/ChangeLog:
	PR analyzer/100244
	* g++.dg/analyzer/pr100244.C: New test.
2021-04-24 19:49:31 -04:00
Harald Anlauf
d0e7833b94 PR fortran/100154 - ICE in gfc_conv_procedure_call, at fortran/trans-expr.c:6131
Add appropriate static checks for the character and status arguments to
the GNU Fortran intrinsic extensions fget[c], fput[c].  Extend variable
check to allow a function reference having a data pointer result.

gcc/fortran/ChangeLog:

	PR fortran/100154
	* check.c (variable_check): Allow function reference having a data
	pointer result.
	(arg_strlen_is_zero): New function.
	(gfc_check_fgetputc_sub): Add static check of character and status
	arguments.
	(gfc_check_fgetput_sub): Likewise.
	* intrinsic.c (add_subroutines): Fix argument name for the
	character argument to intrinsic subroutines fget[c], fput[c].

gcc/testsuite/ChangeLog:

	PR fortran/100154
	* gfortran.dg/pr100154.f90: New test.
2021-04-24 20:51:41 +02:00
Harald Anlauf
32c4d970ea Fortran - allow target of pointer from evaluation of function-reference
Fortran allows the target of a pointer from the evaluation of a
function-reference in a variable definition context (e.g. F2018:R902).

gcc/fortran/ChangeLog:

	PR fortran/100218
	* expr.c (gfc_check_vardef_context): Extend check to allow pointer
	from a function reference.

gcc/testsuite/ChangeLog:

	PR fortran/100218
	* gfortran.dg/ptr-func-4.f90: New test.
2021-04-24 20:39:14 +02:00
Iain Sandoe
a1765b421e Revert "Darwin : Adjust darwin_binds_local_p for PIC code [PR100152]."
Unfortunately, although this is required to fix the PR, and is
notionally correct, it regresses some of the sanitizer and IPA
tests.  Reverting until this can be analysed.

This reverts commit b6600392bf.
2021-04-24 19:31:25 +01:00
David Edelsohn
fb6b24c66e testuite: fix libtdc++ libatomic flags
Some ports require libatomic for atomic operations, at least for some
data types and widths.  The libstdc++ testsuite previously was updated
to link against libatomic, but the search path was hard-coded to
something that is not always correct, and the shared library search
path was not set.

The search path was hard-coded to the expected location of the
libatomic build directory relative to the libstdc++ testsuite
directory, but if one uses parallelism when invoking the libstdc++
testsuite, the tests are run in the "normalXX" sub-directories, for
which the hard-coded search path is incorrect. The path also is
incorrect for alternative multilib and tool options.

This patch adopts the logic from gcc/testsuite/lib/atomic-dg.exp to
search for the library and adds the logic to the libstdc++ testsuite
libatomic seatch path code.  Previously the libstdc++ testsuite atomic
tests failed depending on the build configuration and if a build of
libatomic was installed in the default search path.

Bootstrapped on powerpc-ibm-aix7.2.3.0.

libstdc++-v3/ChangeLog:

	* testsuite/lib/dg-options.exp (atomic_link_flags): New.
	(add_options_for_libatomic): Use atomic_link_flags.
2021-04-24 11:57:05 -04:00
Iain Sandoe
b6600392bf Darwin : Adjust darwin_binds_local_p for PIC code [PR100152].
Darwin's dynamic linker supports interposition and lazy symbol binding.
If we are generating PIC code and a symbol is public, then it could
potentially be indirected via a lazy-resolver stub; we cannot tell at
compile-time if this will be done (since the indirection can be the
result of adding a -flat-namespace option at link-time).  Here we are
conservative and assume that any such symbol cannot bind locally.
The default implementation for binds_local_p handles undefined, weak and
common symbols which are always indirected (for mdynamic-no-pic also).

gcc/ChangeLog:

	PR target/100152
	* config/darwin.c (darwin_binds_local_p): Assume that any
	public symbol might be interposed for PIC code. Update function
	header comment to reflect current Darwin capability.
2021-04-24 13:45:14 +01:00
Richard Sandiford
f31ddad8ac Adjust guality xfails for aarch64*-*-*
This patch gives clean guality.exp test results for aarch64-linux-gnu
with modern (top-of-tree) gdb.

For people using older gdbs, it will trade one set of noisy results for
another set.  I still think it's better to have the xfails based on
one “clean” and “modern” run rather than have FAILs and XPASSes for
all runs.

It's hard to tell which of these results are aarch64-specific and
which aren't.  If other target maintainers want to do something similar,
and are prepared to assume the same gdb version, then it should become
clearer over time which ones are target-specific and which aren't.

There are no new skips here, so changes in test results will still
show up as XPASSes.

I've not analysed the failures or filed PRs for them.  In some
ways the guality directory itself seems like the best place to
start looking for xfails, if someone's interested in working
in this area.

gcc/testsuite/
	* gcc.dg/guality/example.c: Update aarch64*-*-* xfails.
	* gcc.dg/guality/guality.c: Likewise.
	* gcc.dg/guality/inline-params.c: Likewise.
	* gcc.dg/guality/loop-1.c: Likewise.
	* gcc.dg/guality/pr36728-1.c: Likewise.
	* gcc.dg/guality/pr36728-2.c: Likewise.
	* gcc.dg/guality/pr36728-3.c: Likewise.
	* gcc.dg/guality/pr41447-1.c: Likewise.
	* gcc.dg/guality/pr54200.c:  Likewise.
	* gcc.dg/guality/pr54519-1.c: Likewise.
	* gcc.dg/guality/pr54519-2.c: Likewise.
	* gcc.dg/guality/pr54519-3.c: Likewise.
	* gcc.dg/guality/pr54519-4.c: Likewise.
	* gcc.dg/guality/pr54519-5.c: Likewise.
	* gcc.dg/guality/pr54519-6.c: Likewise.
	* gcc.dg/guality/pr54693-2.c: Likewise.
	* gcc.dg/guality/pr56154-1.c: Likewise.
	* gcc.dg/guality/pr59776.c: Likewise.
	* gcc.dg/guality/pr68860-1.c: Likewise.
	* gcc.dg/guality/pr68860-2.c: Likewise.
	* gcc.dg/guality/pr90074.c: Likewise.
	* gcc.dg/guality/pr90716.c: Likewise.
	* gcc.dg/guality/sra-1.c: Likewise.
2021-04-24 09:35:16 +01:00
Richard Sandiford
0d923657c2 Add dg-final option-based target selectors
This patch adds target selectors of the form:

  { any-opts "opt1" ... "optn" }
  { no-opts "opt1" ... "optn" }

for skipping or xfailing tests based on compiler options.  It only
works for dg-final selectors.

The patch then uses no-opts to exclude -O0 and (sometimes) -Og from
some guality.exp xfails.  AFAICT (based on gcc-testresults) these
tests pass for those options for all targets.

gcc/
	* doc/sourcebuild.texi: Document no-opts and any-opts target
	selectors.

gcc/testsuite/
	* lib/target-supports-dg.exp (selector_expression): Handle any-opts
	and no-opts.
	* gcc.dg/guality/pr41353-1.c: Exclude -O0 from xfail.
	* gcc.dg/guality/pr59776.c: Likewise.
	* gcc.dg/guality/pr54970.c: Likewise -O0 and -Og.
2021-04-24 09:35:16 +01:00
Patrick Palka
bcd77b7b9f c++: do_class_deduction and dependent init [PR93383]
Here we're crashing during CTAD with a dependent initializer (performed
from convert_template_argument) because one of the initializer's
elements has an empty TREE_TYPE, which ends up making resolve_args
unhappy.

Besides the case where we're initializing one template placeholder
from another, which is already specifically handled earlier in
do_class_deduction, it seems we can't in general correctly resolve a
template placeholder using a dependent initializer, so this patch makes
the function just punt until instantiation time instead.

gcc/cp/ChangeLog:

	PR c++/89565
	PR c++/93383
	PR c++/95291
	PR c++/99200
	PR c++/99683
	* pt.c (do_class_deduction): Punt if the initializer is
	type-dependent.

gcc/testsuite/ChangeLog:

	PR c++/89565
	PR c++/93383
	PR c++/95291
	PR c++/99200
	PR c++/99683
	* g++.dg/cpp2a/nontype-class39.C: Remove dg-ice directive.
	* g++.dg/cpp2a/nontype-class45.C: New test.
	* g++.dg/cpp2a/nontype-class46.C: New test.
	* g++.dg/cpp2a/nontype-class47.C: New test.
	* g++.dg/cpp2a/nontype-class48.C: New test.
2021-04-24 00:14:29 -04:00
Patrick Palka
5f1a2cb9c2 c++: Hard error with tentative parse and CTAD [PR87709]
When parsing e.g. the operand of sizeof, where both types and
expressions are accepted, if during the tentative type parse we
encounter an unexpected template placeholder, we must simulate
an error rather than issue a real error because the expression
parse can still succeed.

gcc/cp/ChangeLog:

	PR c++/87709
	* parser.c (cp_parser_type_id_1): If we see a template
	placeholder, first try simulating an error before issuing
	a real error.

gcc/testsuite/ChangeLog:

	PR c++/87709
	* g++.dg/cpp1z/class-deduction86.C: New test.
2021-04-24 00:01:42 -04:00
GCC Administrator
05ec629f05 Daily bump. 2021-04-24 00:16:37 +00:00
Michael Meissner
9a30a3f06b Fix logic error in 32-bit trampolines.
The test in the PowerPC 32-bit trampoline support is backwards.  It aborts
if the trampoline size is greater than the expected size.  It should abort
when the trampoline size is less than the expected size.  I fixed the test
so the operands are reversed.  I then folded the load immediate into the
compare instruction.

I verified this by creating a 32-bit trampoline program and manually
changing the size of the trampoline to be 48 instead of 40.  The program
aborted with the larger size.  I updated this code and ran the test again
and it passed.

I added a test case that runs on PowerPC 32-bit Linux systems and it calls
the __trampoline_setup function with a larger buffer size than the
compiler uses.  The test is not run on 64-bit systems, since the function
__trampoline_setup is not called.  I also limited the test to just Linux
systems, in case trampolines are handled differently in other systems.

libgcc/
2021-04-23  Michael Meissner  <meissner@linux.ibm.com>

	PR target/98952
	* config/rs6000/tramp.S (__trampoline_setup, elfv1 #ifdef): Fix
	trampoline size comparison in 32-bit by reversing test and
	combining load immediate with compare.
	(__trampoline_setup, elfv2 #ifdef): Fix trampoline size comparison
	in 32-bit by reversing test and combining load immediate with
	compare.

gcc/testsuite/
2021-04-23  Michael Meissner  <meissner@linux.ibm.com>

	PR target/98952
	* gcc.target/powerpc/pr98952.c: New test.
2021-04-23 18:16:03 -04:00
YiFei Zhu
886b6c1e8a bpf: allow BSS symbols to be global symbols
Prior to this, a BSS declaration such as:

  int foo;
  static int bar;

Generates:

  .global foo
  .local  foo
  .comm   foo,4,4
  .local  bar
  .comm	  bar,4,4

Creating symbols:

  0000000000000000 b foo
  0000000000000004 b bar

Both symbols are local. However, libbpf bpf_object__variable_offset
rquires symbols to be STB_GLOBAL & STT_OBJECT for data section lookup.
This patch makes the same declaration generate:

  .global foo
  .type   foo, @object
  .lcomm  foo,4,4
  .local  bar
  .comm   bar,4,4

Creating symbols:

  0000000000000000 B foo
  0000000000000004 b bar

And libbpf will be okay with looking up the global symbol "foo".

2021-04-22  YiFei Zhu  <zhuyifei1999@gmail.com>

gcc/

	* config/bpf/bpf.h (ASM_OUTPUT_ALIGNED_BSS): Use .type and .lcomm.
2021-04-23 09:56:21 -07:00
YiFei Zhu
0a662e103e bpf: align function entry point to 64 bits
Libbpf does not treat paddings after functions well. If function
symbols does not cover a whole text section, it will emit error
similar to:

  libbpf: sec '.text': failed to find program symbol at offset 56

Each instruction in BPF is a multiple of 8 bytes, so align the
functions to 8 bytes, similar to how clang does it.

2021-04-22  YiFei Zhu  <zhuyifei1999@gmail.com>

gcc/

	* config/bpf/bpf.h (FUNCTION_BOUNDARY): Set to 64.
2021-04-23 09:56:20 -07:00
Uros Bizjak
716bb02b40 i386: Reject -m96bit-long-double for 64bit targets [PR100041]
64bit targets default to 128bit long double, so -m96bit-long-double should
not be used.  Together with -m128bit-long-double, this option was intended
to be an optimization for 32bit targets only.

Error out when -m96bit-long-double is used with 64bit targets.

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

gcc/
	PR target/100041
	* config/i386/i386-options.c (ix86_option_override_internal):
	Error out when -m96bit-long-double is used with 64bit targets.
	* config/i386/i386.md (*pushxf_rounded): Remove pattern.

gcc/testsuite/

	PR target/100041
	* gcc.target/i386/pr79514.c (dg-error):
	Expect error for 64bit targets.
2021-04-23 18:46:00 +02:00
Martin Liska
d54693f806 Remove not feasible FIXME
gcc/ChangeLog:

	* lto-wrapper.c: Remove FIXME about usage of
	hardware_concurrency. The function is not on par with
	what we have now.
2021-04-23 18:25:43 +02:00
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