Commit Graph

193085 Commits

Author SHA1 Message Date
Thomas Koenig 1f27cd15b3 Fix exchanged period and letter in gfortan.texi.
gcc/fortran/ChangeLog:

	* gfortran.texi: Fix exchanged period and letter.

(cherry picked from commit 4a8b45e8bc)
2022-05-02 12:25:19 +02:00
Jakub Jelinek 860b71fa94 system.h: Include <initializer_list> in system.h unconditionally
On Sun, May 01, 2022 at 07:06:53PM +0100, Jonathan Wakely wrote:
> > >> the reason is that "gcc/analyzer/region-model.cc” uses initializer_lists, and it seems that <initializer_list>
> > >> is not transitively included by any used headers for _LIBCPP_VERSION < 4000.  I fixed that locally by
> > >> adding initializer_list into system.h (and adding INCLUDE_INITIALIZER_LIST to the top of gcc/analyzer/region-model.cc)
> > >> - with that change those versions do bootstrap and test OK***
> > >
> > > From what I can see, with libstdc++ it works because <utility> which is
> > > included by system.h includes <initializer_list>.
> > > If I rename initializer_list in analyzer/region-model.ii to initializer_listx, I
> > > also get:
> > > ../../gcc/analyzer/region-model.cc: In function ‘void ana::selftest::test_binop_svalue_folding()’:
> > > ../../gcc/analyzer/region-model.cc:4966:48: error: deducing from brace-enclosed initializer list requires ‘#include <initializer_list>’
> > > 4508 |
> > >  +++ |+#include <initializer_list>
> > > 4509 | static void
> > > ......
> > > 4966 |     for (auto op : {BIT_IOR_EXPR, TRUTH_OR_EXPR})
> > >      |                                                ^
> > > ../../gcc/analyzer/region-model.cc:4978:49: error: deducing from brace-enclosed initializer list requires ‘#include <initializer_list>’
> > > 4978 |     for (auto op : {BIT_AND_EXPR, TRUTH_AND_EXPR})
> > >      |                                                 ^
> > >
> > > I think we have 2 options, one is do what you wrote above,
> > > INCLUDE_INITIALIZER_LIST defined before system.h to get #include <initializer_list>.
> > > The other option is just to include that unconditionally, it is a very small
> > > header.  For libstdc++ it will make no difference as it is included anyway
> > > and the header is really small there, libc++ includes <cstddef> which isn't
> > > normally included and system.h includes <stddef.h> instead.
> >
> > I’d say unconditionally would be OK. I suppose the chance that any host
> > C++ is good enough to build GCC as-is but fails to provide
> > <initializer_list> is zero?
> >
>
> Yes, definitely.
>
> > I’d be OK to do this change without a new RC even.

2022-05-02  Jakub Jelinek  <jakub@redhat.com>

	* system.h: Include initializer_list.

(cherry picked from commit 4a0e89b10f)
2022-05-02 07:11:37 +02:00
GCC Administrator 14ed11b75b Daily bump. 2022-05-02 00:18:59 +00:00
GCC Administrator 25f6197633 Daily bump. 2022-05-01 00:18:44 +00:00
GCC Administrator 0faf3a1e62 Daily bump. 2022-04-30 00:19:19 +00:00
Jonathan Wakely 621650f64f libstdc++: Add missing exports for ppc64le --with-long-double-format=ibm [PR105417]
The --with-long-double-abi=ibm build is missing some exports that are
present in the --with-long-double-abi=ieee build. Those symbols never
should have been exported at all, but now that they have been, they
should be exported consistently by both ibm and ieee.

This simply defines them as aliases for equivalent symbols that are
already present. The abi-tag on num_get::_M_extract_int isn't really
needed, because it only uses a std::string as a local variable, not in
the return type or function parameters, so it's safe to define the
_M_extract_int[abi:cxx11] symbols as aliases for the corresponding
function without the abi-tag.

This causes some new symbols to be added to the GLIBCXX_3.4.29 version
for the ibm long double build mode, but there is no advantage to adding
them to 3.4.30 for that build. That would just create more
inconsistencies.

libstdc++-v3/ChangeLog:

	PR libstdc++/105417
	* config/abi/post/powerpc64-linux-gnu/baseline_symbols.txt:
	Regenerate.
	* src/c++11/compatibility-ldbl-alt128.cc [_GLIBCXX_USE_DUAL_ABI]:
	Define __gnu_ieee128::num_get<C>::_M_extract_int[abi:cxx11]<I>
	symbols as aliases for corresponding symbols without abi-tag.

(cherry picked from commit bb7cf39b05)
2022-04-29 14:43:52 +01:00
Rainer Orth c733f40f87 libstdc++: Update Solaris baselines for GCC 12.1
The following patch updates the Solaris baselines for GCC 12.1.

Tested on i386-pc-solaris2.11 and sparc-sun-solaris2.11 (Solaris 11.3
and 11.4 in each case).

The only (expected) difference between the 11.3 and 11.4 versions is

--- baseline_symbols.txt.s113s	2022-04-28 10:37:11.464068450 +0000
+++ baseline_symbols.txt.s114s	2022-04-27 16:54:31.995636805 +0000
@@ -4070,3 +4070,3 @@
-FUNC:_ZSt10from_charsPKcS0_RdSt12chars_format@@GLIBCXX_3.4.30
-FUNC:_ZSt10from_charsPKcS0_ReSt12chars_format@@GLIBCXX_3.4.30
-FUNC:_ZSt10from_charsPKcS0_RfSt12chars_format@@GLIBCXX_3.4.30
+FUNC:_ZSt10from_charsPKcS0_RdSt12chars_format@@GLIBCXX_3.4.29
+FUNC:_ZSt10from_charsPKcS0_ReSt12chars_format@@GLIBCXX_3.4.29
+FUNC:_ZSt10from_charsPKcS0_RfSt12chars_format@@GLIBCXX_3.4.29

which is handled by the fix for PR libstdc++/103407.  I'm using the 11.4
version here.


2022-04-27  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	libstdc++-v3:
	* config/abi/post/i386-solaris/baseline_symbols.txt: Regenerate.
	* config/abi/post/i386-solaris/amd64/baseline_symbols.txt:
	Likewise.
	* config/abi/post/sparc-solaris/baseline_symbols.txt: Likewise.
	* config/abi/post/sparc-solaris/sparcv9/baseline_symbols.txt:
	Likewise.
2022-04-29 13:56:09 +02:00
Iain Sandoe 7cc5a20ba3 c++, coroutines: Partial reversion of r12-8308-g15a176a833f23e [PR105426].
The changes to fix PR 105287 included a tightening of the constraints on which
variables are promoted to frame copies.  This has exposed that we are failing
to name some variables that should be promoted.

We avoid the use of DECL_UID to build anonymous symbols since that might not
be stable for -fcompare-debug.

The long-term fix is to address the cases where the naming has been missed,
but for the short-term (and for the GCC-12 branch) backing out the additional
constraint is proposed.

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

	PR c++/105426

gcc/cp/ChangeLog:

	* coroutines.cc (register_local_var_uses): Allow promotion of unnamed
	temporaries to coroutine frame copies.

(cherry picked from commit 3d8d093e82)
2022-04-29 09:29:34 +01:00
GCC Administrator ab73f5b0bc Daily bump. 2022-04-29 00:19:02 +00:00
Patrick Palka 38bdf2dccf c++: partial ordering and dependent operator expr [PR105425]
Here ever since r12-6022-gbb2a7f80a98de3 we stopped deeming the partial
specialization #2 to be more specialized than #1 ultimately because
dependent operator expressions now have a DEPENDENT_OPERATOR_TYPE type
instead of an empty type, and this made unify stop deducing T(2) == 1
for K during partial ordering for #1 and #2.

This minimal patch fixes this by making the relevant logic in unify
treat DEPENDENT_OPERATOR_TYPE like an empty type.

	PR c++/105425

gcc/cp/ChangeLog:

	* pt.cc (unify) <case TEMPLATE_PARM_INDEX>: Treat
	DEPENDENT_OPERATOR_TYPE like an empty type.

gcc/testsuite/ChangeLog:

	* g++.dg/template/partial-specialization13.C: New test.

(cherry picked from commit 509fd16da8)
2022-04-28 13:34:58 -04:00
Jonathan Wakely 6fba27af87 libstdc++: Update docs for release branch
libstdc++-v3/ChangeLog:

	* doc/xml/manual/status_cxx1998.xml: Refer to GCC 12 not
	mainline.
	* doc/xml/manual/status_cxx2011.xml: Likewise.
	* doc/xml/manual/status_cxx2014.xml: Likewise.
	* doc/xml/manual/status_cxx2017.xml: Likewise.
	* doc/xml/manual/status_cxx2020.xml: Likewise.
	* doc/xml/manual/status_cxxtr1.xml: Likewise.
	* doc/xml/manual/status_cxxtr24733.xml: Likewise.
	* doc/html/manual/status.html: Regenerate.
2022-04-28 18:24:10 +01:00
Thomas Koenig 8679545004 Document changes to CONVERT for -mabi-ieeelongdouble for POWER.
gcc/fortran/ChangeLog:

	* gfortran.texi: Mention r16_ieee and r16_ibm.
	* invoke.texi: Likewise.

(cherry picked from commit 1a5ae012ff)
2022-04-28 18:44:03 +02:00
Jeff Law af71f96631 [committed] Fix more problems with new linker warnings
gcc/testsuite
	* gcc.dg/lto/pr94157_0.c: Revert last change.
	* lib/prune.exp (prune_gcc_output): Prune new linker warning.
2022-04-28 12:09:00 -04:00
Jakub Jelinek afd8c47fb2 Set DEV-PHASE to prerelease.
2022-04-28  Jakub Jelinek  <jakub@redhat.com>

	* DEV-PHASE: Set to prerelease.
2022-04-28 15:59:21 +02:00
Jakub Jelinek b85e79dce1 cgraph: Don't verify semantic_interposition flag for aliases [PR105399]
The following testcase ICEs, because the ctors during cc1plus all have
!opt_for_fn (decl, flag_semantic_interposition) - they have NULL
DECL_FUNCTION_SPECIFIC_OPTIMIZATION (decl) and optimization_default_node
is for -Ofast and so has flag_semantic_interposition cleared.
During free lang data, we set DECL_FUNCTION_SPECIFIC_OPTIMIZATION (decl)
for the ctor which has body (or for thunks), but don't touch it for
aliases.
During lto1 optimization_default_node reflects the lto1 flags which
are -O2 rather than -Ofast and so has flag_semantic_interposition
set, for the ctor which has body that makes no difference, but as the
alias doesn't still have DECL_FUNCTION_SPECIFIC_OPTIMIZATION (decl) set,
we now trigger this verification check.

The following patch just doesn't verify it for aliases during lto1.
Another possibility would be to set DECL_FUNCTION_SPECIFIC_OPTIMIZATION (decl)
during free lang data even for aliases.

2022-04-28  Jakub Jelinek  <jakub@redhat.com>

	PR lto/105399
	* cgraph.cc (cgraph_node::verify_node): Don't verify
	semantic_interposition flag against
	opt_for_fn (decl, flag_semantic_interposition) for aliases in lto1.

	* g++.dg/lto/pr105399_0.C: New test.
2022-04-28 15:45:33 +02:00
Thomas Schwinge 2a570f11a2 Fix up 'libgomp.oacc-fortran/print-1.f90' GCN offloading compilation [PR104717]
That got broken by recent commit b220243191
"fortran: Fix up gfc_trans_oacc_construct [PR104717]".

	PR fortran/104717
	libgomp/
	* testsuite/libgomp.oacc-fortran/print-1.f90: Add OpenACC
	privatization scanning.  For GCN offloading compilation, raise
	'-mgang-private-size'.
2022-04-28 15:15:29 +02:00
Iain Sandoe 7b96274a34 c++, coroutines: Improve check for throwing final await [PR104051].
We check that the final_suspend () method returns a sane type (i.e. a class
or structure) but, unfortunately, that check has to be later than the one
for a throwing case.  If the use returns some nonsensical type from the
method, we need to handle that in the checking for noexcept.

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

	PR c++/104051

gcc/cp/ChangeLog:

	* coroutines.cc (coro_diagnose_throwing_final_aw_expr): Handle
	non-target expression inputs.

gcc/testsuite/ChangeLog:

	* g++.dg/coroutines/pr104051.C: New test.
2022-04-28 13:55:09 +01:00
Iain Sandoe 6cae3bb65c c++, coroutines: Account for overloaded promise return_value() [PR105301].
Whether it was intended or not, it is possible to define a coroutine promise
with multiple return_value() methods [which need not even have the same type].

We were not accounting for this possibility in the check to see whether both
return_value and return_void are specifier (which is prohibited by the
standard).  Fixed thus and provided an adjusted diagnostic for the case that
multiple return_value() methods are present.

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

	PR c++/105301

gcc/cp/ChangeLog:

	* coroutines.cc (coro_promise_type_found_p): Account for possible
	mutliple overloads of the promise return_value() method.

gcc/testsuite/ChangeLog:

	* g++.dg/coroutines/pr105301.C: New test.
2022-04-28 13:52:23 +01:00
Iain Sandoe 15a176a833 c++, coroutines: Make sure our temporaries are in a bind expr [PR105287]
There are a few cases where we can generate a temporary that does not need
to be added to the coroutine frame (i.e. these are genuinely ephemeral).  The
intent was that unnamed temporaries should not be 'promoted' to coroutine
frame entries.  However there was a thinko and these were not actually ever
added to the bind expressions being generated for the expanded awaits.  This
meant that they were showing in the global namspace, leading to an empty
DECL_CONTEXT and the ICE reported.

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

	PR c++/105287

gcc/cp/ChangeLog:

	* coroutines.cc (maybe_promote_temps): Ensure generated temporaries
	are added to the bind expr.
	(add_var_to_bind): Fix local var naming to use portable punctuation.
	(register_local_var_uses): Do not add synthetic names to unnamed
	temporaries.

gcc/testsuite/ChangeLog:

	* g++.dg/coroutines/pr105287.C: New test.
2022-04-28 13:51:44 +01:00
Nathan Sidwell 9cb1f565a9 c++, coroutines: Avoid expanding within templates [PR103868]
This is a forward-port of a patch by Nathan (against 10.x) which fixes an open
PR.

We are ICEing because we ended up tsubst_copying something that had already
been tsubst, leading to an assert failure (mostly such repeated tsubsting is
harmless).

We had a non-dependent co_await in a non-dependent-type template fn, so we
processed it at definition time, and then reprocessed at instantiation time.
We fix this here by deferring substitution while processing templates.

Additional observations (for a better future fix, in the GCC13 timescale):

Exprs only have dependent type if at least one operand is dependent which was
what the current code was intending to do.  Coroutines have the additional
wrinkle, that the current fn's type is an implicit operand.

So, if the coroutine function's type is not dependent, and the operand is not
dependent, we should determine the type of the co_await expression using the
DEPENDENT_EXPR wrapper machinery.  That allows us to determine the
subexpression type, but leave its operand unchanged and then instantiate it
later.

	PR c++/103868

gcc/cp/ChangeLog:

	* coroutines.cc (finish_co_await_expr): Do not process non-dependent
	coroutine expressions at template definition time.
	(finish_co_yield_expr): Likewise.
	(finish_co_return_stmt): Likewise.

gcc/testsuite/ChangeLog:

	* g++.dg/coroutines/pr103868.C: New test.

Co-Authored-by: Iain Sandoe <iain@sandoe.co.uk>
2022-04-28 13:50:59 +01:00
Iain Sandoe d314907fc4 testsuite,X86: Fix missing USER_LABEL_PREFIX cases.
Yet another set of testcases that do not account for targets that
use __USER_LABEL_PREFIX__.

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

gcc/testsuite/ChangeLog:

	* gcc.target/i386/memcpy-strategy-10.c: Account for
	__USER_LABEL_PREFIX__.
	* gcc.target/i386/memcpy-strategy-5.c: Likewise.
	* gcc.target/i386/memset-strategy-5.c: Likewise.
	* gcc.target/i386/memset-strategy-7.c: Likewise.
2022-04-28 13:48:30 +01:00
Iain Sandoe 350fcc7884 testsuite: Add target requires for ifuncs to mv31.C.
g++.target/i386/mv31.C fails on targets without ifuncs support so add
the necessary target supports guard.

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

gcc/testsuite/ChangeLog:

	* g++.target/i386/mv31.C: Add target supports guard for ifuncs.
2022-04-28 13:45:29 +01:00
Marek Polacek 851031b2fc c++: global-namespace-qualified var after class def [PR90107]
Here we wrongly reject the definition of "::N::a"

  struct A;
  namespace N { extern A a; }
  struct A {} ::N::a;

because our code to diagnose a missing ; after a class definition doesn't
realize that :: can follow a class definition.

	PR c++/90107

gcc/cp/ChangeLog:

	* parser.cc (cp_parser_class_specifier_1): Accept :: after a class
	definition.

gcc/testsuite/ChangeLog:

	* g++.dg/parse/qualified6.C: New test.
2022-04-28 08:37:45 -04:00
Jonathan Wakely 4e117418fb libstdc++: Fix error reporting in filesystem::copy [PR99290]
The recursive calls to filesystem::copy should stop if any of them
reports an error.

libstdc++-v3/ChangeLog:

	PR libstdc++/99290
	* src/c++17/fs_ops.cc (fs::copy): Pass error_code to
	directory_iterator constructor, and check on each iteration.
	* src/filesystem/ops.cc (fs::copy): Likewise.
	* testsuite/27_io/filesystem/operations/copy.cc: Check for
	errors during recursion.
	* testsuite/experimental/filesystem/operations/copy.cc:
	Likewise.
2022-04-28 13:33:48 +01:00
Iain Buclaw d91cb2059f d: Merge upstream dmd 313d28b3d, druntime e361d200.
D front-end changes:

    - Import latest bug fixes from the 2.100 release branch.
    - Fix signatures of extern C++ functions that have size_t
      parameters.

gcc/d/ChangeLog:

	* dmd/MERGE: Merge upstream dmd 313d28b3d.
	* d-port.cc (Port::memicmp): Use d_size_t instead of size_t.
	(Port::valcpy): Likewise.

libphobos/ChangeLog:

	* libdruntime/MERGE: Merge upstream druntime e361d200.
2022-04-28 12:58:12 +02:00
Jakub Jelinek 89dbf9a5f5 i386: Fix up ix86_gimplify_va_arg [PR105331]
On the following testcase we emit a bogus
'va_arg_tmp.5' may be used uninitialized
warning.  The reason is that when gimplifying the addr = &temp;
statement, the va_arg_tmp temporary var for which we emit ADDR_EXPR
is not TREE_ADDRESSABLE, prepare_gimple_addressable emits some extra
code to initialize the newly addressable var from its previous value,
but it is a new variable which hasn't been initialized yet and will
be later, so we end up initializing it with uninitialized SSA_NAME:
  va_arg_tmp.6 = va_arg_tmp.5_14(D);
  addr.2_16 = &va_arg_tmp.6;
  _17 = MEM[(double *)sse_addr.4_13];
  MEM[(double * {ref-all})addr.2_16] = _17;
and with -O1 we actually don't DSE it before the warning is emitted.
If we make the temp TREE_ADDRESSABLE before the gimplification, then
this prepare_gimple_addressable path isn't taken and we effectively
omit the first statement above and so the bogus warning is gone.

I went through other backends and didn't find another instance of this
problem.

2022-04-28  Jakub Jelinek  <jakub@redhat.com>

	PR target/105331
	* config/i386/i386.cc (ix86_gimplify_va_arg): Mark va_arg_tmp
	temporary TREE_ADDRESSABLE before trying to gimplify ADDR_EXPR
	of it.

	* gcc.dg/pr105331.c: New test.
2022-04-28 12:33:59 +02:00
Jonathan Wakely 8094526109 doc: Remove misleading text about multilibs for IEEE long double
The choice of ieee or ibm long double format is orthogonal to multilibs,
as the two sets of symbols co-exist and don't need a separate multilib.

gcc/ChangeLog:

	* doc/install.texi (Configuration): Remove misleading text
	around LE PowerPC Linux multilibs.
2022-04-28 10:41:29 +01:00
François Dumont f39fcafbc0 libstdc++: Remove redundant line in versioned namespace linker script
This doesn't match anything.

libstdc++-v3/ChangeLog:

	* config/abi/pre/gnu-versioned-namespace.ver: Remove
	std::random_device::* pattern.
2022-04-28 10:03:12 +01:00
Rainer Orth 4e4f550a5b doc: Document Solaris D bootstrap requirements [PR 103528]
This patch documents the Solaris-specific D bootstrap requirements.

Tested by building and inspecting gccinstall.{pdf,info}.


2022-03-16  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	gcc:
	PR d/103528
	* doc/install.texi (Tools/packages necessary for building GCC)
	(GDC): Document libphobos requirement.
	(Host/target specific installation notes for GCC, *-*-solaris2*):
	Document libphobos and GDC specifics.
2022-04-28 10:27:32 +02:00
Richard Biener f27848a5dc tree-optimization/105219 - bogus max iters for vectorized epilogue
The following makes sure to take into account prologue peeling
when trying to narrow down the maximum number of iterations
computed for the vectorized epilogue.  A similar issue exists when
peeling for gaps.

2022-04-27  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/105219
	* tree-vect-loop.cc (vect_transform_loop): Disable
	special code narrowing the vectorized epilogue max
	iterations when peeling for alignment or gaps was in effect.

	* gcc.dg/vect/pr105219.c: New testcase.
2022-04-28 08:06:52 +02:00
Kewen Lin 84c1c9b013 testsuite: Add test case for pack/unpack bifs at soft-float [PR105334]
This patch is to add the test coverage for the two recent fixes
r12-8091 and r12-8226 from Segher, aix is skipped since it takes
soft-float and long-double-128 incompatible.

	PR target/105334

gcc/testsuite/ChangeLog:

	* gcc.target/powerpc/pr105334.c: New test.
2022-04-27 22:34:27 -05:00
Jia-Wei Chen d5b66a9053 testsuite: Skip target not support -pthread [PR104676].
The "ftree-parallelize-loops=" imply -pthread option in gcc/gcc.cc,
some target are not support pthread like elf target use newlib,
and will get an error:

"*-*-elf-gcc: error: unrecognized command-line option '-pthread'"

so we add an additional condition "{target pthread}" to make sure the
dg-additional-options runs on support targets.

gcc/testsuite/ChangeLog

	PR target/104676
	* gcc.dg/torture/pr104676.c: Add "{target pthread}" check.
2022-04-28 11:22:39 +08:00
Xi Ruoyao d1ee29fd7f loongarch: ignore zero-size fields in calling convention
gcc/

	* config/loongarch/loongarch.cc
	(loongarch_flatten_aggregate_field): Ignore empty fields for
	RECORD_TYPE.

gcc/testsuite/

	* gcc.target/loongarch/zero-size-field-pass.c: New test.
	* gcc.target/loongarch/zero-size-field-ret.c: New test.
2022-04-28 09:20:40 +08:00
GCC Administrator ba949a6af4 Daily bump. 2022-04-28 00:16:52 +00:00
Jason Merrill e3947ea7f3 c++: add comments
gcc/cp/ChangeLog:

	* tree.cc (strip_typedefs): Add default argument comments.
2022-04-27 19:49:37 -04:00
Thomas Koenig 58e4a744b6 Fix oversight from previous commit to pr70673.
gcc/testsuite/ChangeLog:

	* gfortran.dg/pr70673.f90: Removed second invalid
	line.
2022-04-27 22:42:04 +02:00
Marek Polacek 409edcca33 c++: enum in generic lambda at global scope [PR105398]
We crash compiling this test since r11-7993 which changed
lookup_template_class_1 so that we only call tsubst_enum when

  !uses_template_parms (current_nonlambda_scope ())

But here current_nonlambda_scope () is the global NAMESPACE_DECL ::, which
doesn't have a type, therefore is considered type-dependent.  So we don't
call tsubst_enum, and crash in tsubst_copy/CONST_DECL because we didn't
find the e1 enumerator.

I don't think any namespace can depend on any template parameter, so
this patch tweaks uses_template_parms.

	PR c++/105398

gcc/cp/ChangeLog:

	* pt.cc (uses_template_parms): Return false for any NAMESPACE_DECL.

gcc/testsuite/ChangeLog:

	* g++.dg/cpp1y/lambda-generic-enum2.C: New test.
2022-04-27 13:09:05 -04:00
Jakub Jelinek 948e8e4010 testsuite: Add testcase for dangling pointer equality bogus warning [PR104492]
On Wed, Apr 27, 2022 at 12:02:33PM +0200, Richard Biener wrote:
> I did that but the reduction result did not resemble the same failure
> mode.  I've failed to manually construct a testcase as well.  Possibly
> a testcase using libstdc++ but less Qt internals might be possible.

Here is a testcase that I've managed to reduce, FAILs with:
FAIL: g++.dg/warn/pr104492.C  -std=gnu++14  (test for bogus messages, line 111)
FAIL: g++.dg/warn/pr104492.C  -std=gnu++17  (test for bogus messages, line 111)
FAIL: g++.dg/warn/pr104492.C  -std=gnu++20  (test for bogus messages, line 111)
on both x86_64-linux and i686-linux without your commit and passes with it.

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

	PR middle-end/104492
	* g++.dg/warn/pr104492.C: New test.
2022-04-27 18:47:10 +02:00
Thomas Koenig f654140140 Split test to remove failing run time test and add check for ICE.
gcc/testsuite/ChangeLog:

	PR fortran/70673
	PR fortran/78054
	* gfortran.dg/pr70673.f90: Remove invalid statement.
	* gfortran.dg/pr70673_2.f90: New test to check that
	ICE does not re-appear.
2022-04-27 18:40:18 +02:00
Jakub Jelinek a71b107013 libstdc++: Update {x86_64,i?86,aarch64,s390x,ppc{,64,64le}} baseline_symbols.txt
The following patch updates baseline_symbols.txt on arches where I have
latest libstdc++ builds (my ws + Fedora package builds).
I've manually excluded:
+FUNC:_ZNKSt17__gnu_cxx_ieee1287num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE14_M_extract_intB5cxx11IjEES4_S4_S4_RSt8ios_baseRSt12_Ios_IostateRT_@@GLIBCXX_IEEE128_3.4.29
+FUNC:_ZNKSt17__gnu_cxx_ieee1287num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE14_M_extract_intB5cxx11IlEES4_S4_S4_RSt8ios_baseRSt12_Ios_IostateRT_@@GLIBCXX_IEEE128_3.4.29
+FUNC:_ZNKSt17__gnu_cxx_ieee1287num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE14_M_extract_intB5cxx11ImEES4_S4_S4_RSt8ios_baseRSt12_Ios_IostateRT_@@GLIBCXX_IEEE128_3.4.29
+FUNC:_ZNKSt17__gnu_cxx_ieee1287num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE14_M_extract_intB5cxx11ItEES4_S4_S4_RSt8ios_baseRSt12_Ios_IostateRT_@@GLIBCXX_IEEE128_3.4.29
+FUNC:_ZNKSt17__gnu_cxx_ieee1287num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE14_M_extract_intB5cxx11IxEES4_S4_S4_RSt8ios_baseRSt12_Ios_IostateRT_@@GLIBCXX_IEEE128_3.4.29
+FUNC:_ZNKSt17__gnu_cxx_ieee1287num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE14_M_extract_intB5cxx11IyEES4_S4_S4_RSt8ios_baseRSt12_Ios_IostateRT_@@GLIBCXX_IEEE128_3.4.29
+FUNC:_ZNKSt17__gnu_cxx_ieee1287num_getIwSt19istreambuf_iteratorIwSt11char_traitsIwEEE14_M_extract_intB5cxx11IjEES4_S4_S4_RSt8ios_baseRSt12_Ios_IostateRT_@@GLIBCXX_IEEE128_3.4.29
+FUNC:_ZNKSt17__gnu_cxx_ieee1287num_getIwSt19istreambuf_iteratorIwSt11char_traitsIwEEE14_M_extract_intB5cxx11IlEES4_S4_S4_RSt8ios_baseRSt12_Ios_IostateRT_@@GLIBCXX_IEEE128_3.4.29
+FUNC:_ZNKSt17__gnu_cxx_ieee1287num_getIwSt19istreambuf_iteratorIwSt11char_traitsIwEEE14_M_extract_intB5cxx11ImEES4_S4_S4_RSt8ios_baseRSt12_Ios_IostateRT_@@GLIBCXX_IEEE128_3.4.29
+FUNC:_ZNKSt17__gnu_cxx_ieee1287num_getIwSt19istreambuf_iteratorIwSt11char_traitsIwEEE14_M_extract_intB5cxx11ItEES4_S4_S4_RSt8ios_baseRSt12_Ios_IostateRT_@@GLIBCXX_IEEE128_3.4.29
+FUNC:_ZNKSt17__gnu_cxx_ieee1287num_getIwSt19istreambuf_iteratorIwSt11char_traitsIwEEE14_M_extract_intB5cxx11IxEES4_S4_S4_RSt8ios_baseRSt12_Ios_IostateRT_@@GLIBCXX_IEEE128_3.4.29
+FUNC:_ZNKSt17__gnu_cxx_ieee1287num_getIwSt19istreambuf_iteratorIwSt11char_traitsIwEEE14_M_extract_intB5cxx11IyEES4_S4_S4_RSt8ios_baseRSt12_Ios_IostateRT_@@GLIBCXX_IEEE128_3.4.29
additions on ppc64le as those look unexpected.
Those symbols didn't show up in Fedora 11.3.1 build with recent glibc,
while other GLIBCXX_IEEE128_3.4.29 symbols are in 11.x already.

What this patch includes are only @@GLIBCXX_3.4.30 symbol additions, same
symbols on all files, except that powerpc64 adds also
_ZNSt17__gnu_cxx_ieee12816__convert_from_vERKP15__locale_structPciPKcz@@GLIBCXX_IEEE128_3.4.30
so everything included in the patch looks right to me.

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

	* config/abi/post/x86_64-linux-gnu/baseline_symbols.txt: Update.
	* config/abi/post/x86_64-linux-gnu/32/baseline_symbols.txt: Update.
	* config/abi/post/i486-linux-gnu/baseline_symbols.txt: Update.
	* config/abi/post/aarch64-linux-gnu/baseline_symbols.txt: Update.
	* config/abi/post/s390x-linux-gnu/baseline_symbols.txt: Update.
	* config/abi/post/powerpc-linux-gnu/baseline_symbols.txt: Update.
	* config/abi/post/powerpc64-linux-gnu/baseline_symbols.txt: Update.
	* config/abi/post/powerpc64-linux-gnu/32/baseline_symbols.txt: Update.
2022-04-27 17:30:09 +02:00
Jonathan Wakely a849584587 libstdc++: Add pretty printer for std::atomic
For the atomic specializations for shared_ptr and weak_ptr we can reuse
the existing SharedPointerPrinter, with a small tweak.

libstdc++-v3/ChangeLog:

	* python/libstdcxx/v6/printers.py (SharedPointerPrinter): Add
	support for atomic<shared_ptr<T>> and atomic<weak_ptr<T>>.
	(StdAtomicPrinter): New printer.
	(build_libstdcxx_dictionary): Register new printer.
	* testsuite/libstdc++-prettyprinters/cxx11.cc: Test std::atomic.
	* testsuite/libstdc++-prettyprinters/cxx20.cc: Test atomic smart
	pointers.
2022-04-27 15:48:32 +01:00
Sebastian Huber e07ea03fce ada: Fix build for RTEMS
Commit 621cccba3f broke the Ada build for all
RTEMS targets except aarch64.

gcc/ada/

	* tracebak.c: Add support for ARM RTEMS. Add support for RTEMS to PPC
	ELF.  Add support for RTEMS to SPARC.  Merge aarch64 support of Linux
	and RTEMS.
2022-04-27 15:25:00 +02:00
Lulu Cheng 1b21d79e4e LoongArch: Add fdiv define_expand template.
gcc/ChangeLog:

	* config/loongarch/loongarch.md: Add fdiv define_expand template,
	then generate floating-point division and floating-point reciprocal
	instructions.
2022-04-27 19:55:17 +08:00
Lulu Cheng cec978606a LoongArch: Add '(clobber (mem:BLK (scratch)))' to PLV instruction templates.
gcc/ChangeLog:

	* config/loongarch/loongarch.md: Add '(clobber (mem:BLK (scratch)))'
	to PLV instruction templates.
2022-04-27 19:55:10 +08:00
Richard Biener 9aaaae7edb middle-end/104492 - avoid all equality compare dangling pointer diags
The following extends the equality compare dangling pointer diagnostics
suppression for uses following free or realloc to also cover those
following invalidation of auto variables via CLOBBERs.  That avoids
diagnosing idioms like

  return std::find(std::begin(candidates), std::end(candidates), s)
           != std::end(candidates);

for auto candidates which are prone to forwarding of the final
comparison across the storage invalidation as then seen by the
late run access warning pass.

2022-04-25  Richard Biener  <rguenther@suse.de>

	PR middle-end/104492
	* gimple-ssa-warn-access.cc
	(pass_waccess::warn_invalid_pointer): Exclude equality compare
	diagnostics for all kind of invalidations.
	(pass_waccess::check_dangling_uses): Fix post-dominator query.
	(pass_waccess::check_pointer_uses): Likewise.
2022-04-27 12:03:07 +02:00
Mikael Morin 6a460a2007 fortran: Compare non-constant bound expressions. [PR105379]
Starting with r12-8235-gfa5cd7102da676dcb1757b1288421f5f3439ae0e,
class descriptor types are compared to detect duplicate declarations.

This caused ICEs as the comparison of array spec supported only constant
explicit bounds, but dummy class variable descriptor types can have a
_data field with non-constant array spec bounds.

This change adds support for non-constant bounds.  For that,
gfc_dep_compare_expr is used.  It does probably more than strictly
necessary, but using it avoids rewriting a specific comparison function,
making mistakes and forgetting cases.

	PR fortran/103662
	PR fortran/105379

gcc/fortran/ChangeLog:

	* array.cc (compare_bounds): Use bool as return type.
	Support non-constant expressions.
	(gfc_compare_array_spec): Update call to compare_bounds.

gcc/testsuite/ChangeLog:

	* gfortran.dg/class_dummy_8.f90: New test.
	* gfortran.dg/class_dummy_9.f90: New test.
2022-04-27 11:36:16 +02:00
Mikael Morin 3e0c9fdfd0 fortran: Avoid infinite self-recursion [PR105381]
Dummy array decls are local decls different from the argument decl
accessible through GFC_DECL_SAVED_DESCRIPTOR.  If the argument decl has
a DECL_LANG_SPECIFIC set, it is copied over to the local decl at the
time the latter is created, so that the DECL_LANG_SPECIFIC object is
shared between local dummy decl and argument decl, and thus the
GFC_DECL_SAVED_DESCRIPTOR of the argument decl is the argument decl
itself.

The r12-8230-g7964ab6c364c410c34efe7ca2eba797d36525349 change introduced
the non_negative_strides_array_p predicate which recurses through
GFC_DECL_SAVED_DESCRIPTOR to avoid seeing dummy decls as purely local
decls.  As the GFC_DECL_SAVED_DESCRIPTOR of the argument decl is itself,
this can cause infinite recursion.

This change adds a check to avoid infinite recursion.

	PR fortran/102043
	PR fortran/105381

gcc/fortran/ChangeLog:

	* trans-array.cc (non_negative_strides_array_p): Inline variable
	orig_decl and merge nested if conditions.  Add condition to not
	recurse if the next argument is the same as the current.

gcc/testsuite/ChangeLog:

	* gfortran.dg/character_array_dummy_1.f90: New test.
2022-04-27 11:36:00 +02:00
Christophe Lyon 6c211e70eb testsuite: Add arm testcase for PR105374
As discussed in the PR, here is the testcase with the appropriate dg-*
directives.

Tested on arm-none-eabi with
1 -mcpu=cortex-a7/-mfloat-abi=soft/-march=armv7ve+simd
2 -mcpu=cortex-a7/-mfloat-abi=hard/-march=armv7ve+simd
3 -mthumb/-mcpu=cortex-a7/-mfloat-abi=hard/-march=armv7ve+simd
4 -mthumb/-mfloat-abi=soft/-march=armv6s-m
5 -mthumb/-mfloat-abi=soft/-march=armv7-m
6 -mthumb/-mfloat-abi=hard/-march=armv7e-m+fp
7 -mthumb/-mfloat-abi=hard/-march=armv7e-m+fp.dp
8 -mthumb/-mfloat-abi=hard/-march=armv8-m.main+fp+dsp
9 -mthumb/-mfloat-abi=hard/-march=armv8.1-m.main+mve.fp+fp.dp
10 -mthumb/-mfloat-abi=hard/-march=armv8.1-m.main+mve

The test is UNSUPPORTED with the first three ones (because of
-mcpu=cortex-a7), ignored with armv6s-m, and PASSes with all the other
ones, while it used crash without Jakub's fix (r12-8263), ie. FAIL
with options 5,6,7,8,10. The test passed without Jakub's fix with
option 9 because the problem happens only with an integer-only MVE.

2022-04-26  Christophe Lyon  <christophe.lyon@arm.com>

	gcc/testsuite/

	PR tree-optimization/105374
	* gcc.target/arm/simd/pr105374.C: New.
2022-04-27 09:19:39 +01:00
Pierre-Marie de Rodat b2df4c40c4 [Ada] Revert r12-6599 (Fix up handling of ghost units [PR104027])
gcc/ada/

	PR ada/104027
	* gnat1drv.adb: Remove the goto End_Of_Program.
2022-04-27 08:00:33 +00:00
Andreas Krebbel bc79f0d904 PR102024 - IBM Z: Add psabi diagnostics
For IBM Z in particular there is a problem with structs like:

struct A { float a; int :0; };

Our ABI document allows passing a struct in an FPR only if it has
exactly one member. On the other hand it says that structs of 1,2,4,8
bytes are passed in a GPR. So this struct is expected to be passed in
a GPR. Since we don't return structs in registers (regardless of the
number of members) it is always returned in memory.

Situation is as follows:

All compiler versions tested return it in memory - as expected.

gcc 11, gcc 12, g++ 12, and clang 13 pass it in a GPR - as expected.

g++ 11 as well as clang++ 13 pass in an FPR

For IBM Z we stick to the current GCC 12 behavior, i.e. zero-width
bitfields are NOT ignored.  A struct as above will be passed in a
GPR. Rational behind this is that not affecting the C ABI is more
important here.

A patch for clang is in progress: https://reviews.llvm.org/D122388

In addition to the usual regression test I ran the compat and
struct-layout-1 testsuites comparing the compiler before and after the
patch.

gcc/ChangeLog:
	PR target/102024
	* config/s390/s390-protos.h (s390_function_arg_vector): Remove
	prototype.
	* config/s390/s390.cc (s390_single_field_struct_p): New function.
	(s390_function_arg_vector): Invoke s390_single_field_struct_p.
	(s390_function_arg_float): Likewise.

gcc/testsuite/ChangeLog:
	PR target/102024
	* g++.target/s390/pr102024-1.C: New test.
	* g++.target/s390/pr102024-2.C: New test.
	* g++.target/s390/pr102024-3.C: New test.
	* g++.target/s390/pr102024-4.C: New test.
	* g++.target/s390/pr102024-5.C: New test.
	* g++.target/s390/pr102024-6.C: New test.
2022-04-27 09:22:46 +02:00