]> gcc.gnu.org Git - gcc.git/log
gcc.git
2 years agoFortran: handle explicit-shape specs with constant bounds [PR105954]
Harald Anlauf [Mon, 20 Jun 2022 18:59:55 +0000 (20:59 +0200)]
Fortran: handle explicit-shape specs with constant bounds [PR105954]

gcc/fortran/ChangeLog:

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

gcc/testsuite/ChangeLog:

PR fortran/105954
* gfortran.dg/pr105954.f90: New test.

(cherry picked from commit a312407bd715647f7c11b67e0a52effc94d0f15d)

2 years agoFortran: fix simplification of INDEX(str1,str2) [PR105691]
Harald Anlauf [Tue, 21 Jun 2022 21:20:18 +0000 (23:20 +0200)]
Fortran: fix simplification of INDEX(str1,str2) [PR105691]

gcc/fortran/ChangeLog:

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

gcc/testsuite/ChangeLog:

PR fortran/105691
* gfortran.dg/index_6.f90: New test.

(cherry picked from commit ff35dbc02092fbcd3d814fcd9fe8e871c3f741fd)

2 years agoFortran: fix checking of arguments to UNPACK when MASK is a variable [PR105813]
Harald Anlauf [Fri, 24 Jun 2022 20:21:39 +0000 (22:21 +0200)]
Fortran: fix checking of arguments to UNPACK when MASK is a variable [PR105813]

gcc/fortran/ChangeLog:

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

gcc/testsuite/ChangeLog:

PR fortran/105813
* gfortran.dg/unpack_vector_1.f90: New test.

(cherry picked from commit f21f17f95c0237f4f987a5fa9f1fa9c7e0db3c40)

2 years agoc++: dependent generic lambda template-id [PR106024]
Jason Merrill [Fri, 24 Jun 2022 03:14:35 +0000 (23:14 -0400)]
c++: dependent generic lambda template-id [PR106024]

We were wrongly looking up the generic lambda op() in a dependent scope, and
then trying to look up its instantiation at substitution time, but lambdas
aren't instantiated, so we crashed.  The fix is to not look into dependent
lambda scopes.

PR c++/106024

gcc/cp/ChangeLog:

* parser.c (cp_parser_lookup_name): Don't look in dependent lambda.

gcc/testsuite/ChangeLog:

* g++.dg/cpp2a/lambda-generic10.C: New test.

2 years agoDaily bump.
GCC Administrator [Fri, 1 Jul 2022 00:18:30 +0000 (00:18 +0000)]
Daily bump.

2 years agoDaily bump.
GCC Administrator [Thu, 30 Jun 2022 00:18:25 +0000 (00:18 +0000)]
Daily bump.

2 years agoDaily bump.
GCC Administrator [Wed, 29 Jun 2022 00:18:36 +0000 (00:18 +0000)]
Daily bump.

2 years agoDaily bump.
GCC Administrator [Tue, 28 Jun 2022 00:18:41 +0000 (00:18 +0000)]
Daily bump.

2 years agoDaily bump.
GCC Administrator [Mon, 27 Jun 2022 00:18:17 +0000 (00:18 +0000)]
Daily bump.

2 years agoDaily bump.
GCC Administrator [Sun, 26 Jun 2022 00:18:05 +0000 (00:18 +0000)]
Daily bump.

2 years agoDaily bump.
GCC Administrator [Sat, 25 Jun 2022 00:18:29 +0000 (00:18 +0000)]
Daily bump.

2 years agotilegx: Fix infinite loop in gen-mul-tables generator
Iain Buclaw [Wed, 22 Jun 2022 17:11:20 +0000 (19:11 +0200)]
tilegx: Fix infinite loop in gen-mul-tables generator

Since around GCC 10, the condition `j < (INTMAX_MAX / 10)' will get
optimized into `j != 922337203685477580', which will result in an
infinite loop for certain inputs of `j'.

Copy the condition already used by the -DTILEPRO generator code, which
doesn't fall into this trap.

gcc/ChangeLog:

* config/tilepro/gen-mul-tables.cc (tilegx_emit): Adjust loop
condition to avoid overflow.

(cherry picked from commit c0ad48527c314a1e9354b7c26718b56ed4abc92c)

2 years agoc++: anon union designated init [PR105925]
Jason Merrill [Thu, 23 Jun 2022 20:04:02 +0000 (16:04 -0400)]
c++: anon union designated init [PR105925]

This testcase was failing because CONSTRUCTOR_IS_DESIGNATED_INIT wasn't
getting set on the introduced CONSTRUCTOR for the anonymous union, and
build_aggr_conv uses that flag to decide whether to pay attention to the
indexes of the CONSTRUCTOR.  So set the flag when we see a designator rather
than relying on copying it from another CONSTRUCTOR.

PR c++/105925

gcc/cp/ChangeLog:

* decl.c (reshape_init_array_1): Set
CONSTRUCTOR_IS_DESIGNATED_INIT here.
(reshape_init_class): And here.

gcc/testsuite/ChangeLog:

* g++.dg/cpp2a/desig26.C: New test.

2 years agoDaily bump.
GCC Administrator [Fri, 24 Jun 2022 00:18:13 +0000 (00:18 +0000)]
Daily bump.

2 years agoipa-icf: skip variables with body_removed
Martin Liska [Wed, 18 May 2022 13:07:53 +0000 (15:07 +0200)]
ipa-icf: skip variables with body_removed

Similarly to cgraph_nodes, it may happen that body_removed is set
during merging of symbols.

PR ipa/105600

gcc/ChangeLog:

* ipa-icf.c (sem_item_optimizer::filter_removed_items):
Skip variables with body_removed.

(cherry picked from commit 31ce821a790caec8a2849dd67a9847e78a33d14c)

2 years agoDaily bump.
GCC Administrator [Thu, 23 Jun 2022 00:18:52 +0000 (00:18 +0000)]
Daily bump.

2 years agoDaily bump.
GCC Administrator [Wed, 22 Jun 2022 00:18:23 +0000 (00:18 +0000)]
Daily bump.

2 years agoDaily bump.
GCC Administrator [Tue, 21 Jun 2022 00:18:18 +0000 (00:18 +0000)]
Daily bump.

2 years agoalpha: Introduce target specific store_data_bypass_p function [PR105209]
Uros Bizjak [Fri, 17 Jun 2022 15:19:44 +0000 (17:19 +0200)]
alpha: Introduce target specific store_data_bypass_p function [PR105209]

This patch introduces alpha-specific version of store_data_bypass_p that
ignores TRAP_IF that would result in assertion failure (and internal
compiler error) in the generic store_data_bypass_p function.

While at it, also remove ev4_ist_c reservation, store_data_bypass_p
can handle the patterns with multiple sets since some time ago.

2022-06-17  Uroš Bizjak  <ubizjak@gmail.com>

gcc/ChangeLog:

PR target/105209
* config/alpha/alpha-protos.h (alpha_store_data_bypass_p): New.
* config/alpha/alpha.c (alpha_store_data_bypass_p): New function.
(alpha_store_data_bypass_p_1): Ditto.
* config/alpha/ev4.md: Use alpha_store_data_bypass_p instead
of generic store_data_bypass_p.
(ev4_ist_c): Remove insn reservation.

gcc/testsuite/ChangeLog:

PR target/105209
* gcc.target/alpha/pr105209.c: New test.

(cherry picked from commit cc378e655740e93743e7f43e14faaff707aef6c1)

2 years agors6000: Do not use rs6000_cpu for .machine ppc and ppc64 (PR104829)
Segher Boessenkool [Fri, 11 Mar 2022 21:15:18 +0000 (21:15 +0000)]
rs6000: Do not use rs6000_cpu for .machine ppc and ppc64 (PR104829)

Fixes: 77eccbf39ed5
rs6000.h has
  #define PROCESSOR_POWERPC   PROCESSOR_PPC604
  #define PROCESSOR_POWERPC64 PROCESSOR_RS64A
which means that if you use things like  -mcpu=powerpc -mvsx  it will no
longer work after my latest .machine patch.  This causes GCC build errors
in some cases, not a good idea (even if the errors are actually
pre-existing: using -mvsx with a machine that does not have VSX cannot
work properly).

2022-03-11  Segher Boessenkool  <segher@kernel.crashing.org>

PR target/104829
* config/rs6000/rs6000.c (rs6000_machine_from_flags): Don't output
"ppc" and "ppc64" based on rs6000_cpu.

(cherry picked from commit 80fcc4b6afee72443bef551064826b3b4b6785e6)

2 years agors6000: Improve .machine
Segher Boessenkool [Tue, 1 Mar 2022 17:04:29 +0000 (17:04 +0000)]
rs6000: Improve .machine

This adds more correct .machine for most older CPUs.  It should be
conservative in the sense that everything we handled before we handle at
least as well now.  This does not yet revamp the server CPU handling, it
is too risky at this point in time.

Tested on powerpc64-linux {-m32,-m64}.  Also manually tested with all
-mcpu=, and the output of that passed through the GNU assembler.

2022-03-04  Segher Boessenkool  <segher@kernel.crashing.org>

* config/rs6000/rs6000.c (rs6000_machine_from_flags): Restructure a
bit.  Handle most older CPUs.

(cherry picked from commit 77eccbf39ed55297802bb66dff5f62507a7239e3)

2 years agoi386: Fix assert in ix86_function_arg [PR105970]
Uros Bizjak [Fri, 17 Jun 2022 15:01:31 +0000 (17:01 +0200)]
i386: Fix assert in ix86_function_arg [PR105970]

The mode of pointer argument should equal ptr_mode, not Pmode.

2022-06-17  Uroš Bizjak  <ubizjak@gmail.com>

gcc/ChangeLog:

PR target/105970
* config/i386/i386.c (ix86_function_arg): Assert that
the mode of pointer argumet is equal to ptr_mode, not Pmode.

gcc/testsuite/ChangeLog:

PR target/105970
* gcc.target/i386/pr105970.c: New test.

(cherry picked from commit 1f8278bfcfc7f7157bf2b405471e67dd5097636b)

2 years agovarasm: Fix up ICE in narrowing_initializer_constant_valid_p [PR105998]
Jakub Jelinek [Sat, 18 Jun 2022 09:07:13 +0000 (11:07 +0200)]
varasm: Fix up ICE in narrowing_initializer_constant_valid_p [PR105998]

The following testcase ICEs because there is NON_LVALUE_EXPR (location
wrapper) around a VAR_DECL and has TYPE_MODE V2SImode and
SCALAR_INT_TYPE_MODE on that ICEs.  Or for -m32 -march=i386 TYPE_MODE
is DImode, but SCALAR_INT_TYPE_MODE still uses the raw V2SImode and ICEs
too.

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

PR middle-end/105998
* varasm.c (narrowing_initializer_constant_valid_p): Check
SCALAR_INT_MODE_P instead of INTEGRAL_MODE_P, also break on
! INTEGRAL_TYPE_P and do the same check also on op{0,1}'s type.

* c-c++-common/pr105998.c: New test.

(cherry picked from commit ef662120177d39af5f88ffc622d90bb6ae0ca1d3)

2 years agoFix ipa-cp wrt volatile loads
Jan Hubicka [Tue, 14 Jun 2022 12:05:53 +0000 (14:05 +0200)]
Fix ipa-cp wrt volatile loads

Check for volatile flag to ipa_load_from_parm_agg.

gcc/ChangeLog:

2022-06-10  Jan Hubicka  <hubicka@ucw.cz>

PR ipa/105739
* ipa-prop.c (ipa_load_from_parm_agg): Punt on volatile loads.

gcc/testsuite/ChangeLog:

2022-06-10  Jan Hubicka  <hubicka@ucw.cz>

* gcc.dg/ipa/pr105739.c: New test.

(cherry picked from commit 8f6c317b3a16350698f3c9e0accb43a9b4acb4ae)

2 years agofold-const: Fix up -fsanitize=null in C++ [PR105729]
Jakub Jelinek [Fri, 27 May 2022 09:40:42 +0000 (11:40 +0200)]
fold-const: Fix up -fsanitize=null in C++ [PR105729]

The following testcase triggers a false positive UBSan binding a reference
to null diagnostics.
In the FE we instrument conversions from pointer to reference type
to diagnose at runtime if the operand of such a conversion is 0.
The problem is that a GENERIC folding folds
((const struct Bar *) ((const struct Foo *) this)->data) + (sizetype) range_check (x)
conversion to const struct Bar & by converting to that the first
operand of the POINTER_PLUS_EXPR.  But that changes when the -fsanitize=null
binding to reference runtime check occurs.  Without the optimization,
it is invoked on the result of the POINTER_PLUS_EXPR, and as range_check
call throws, that means it never triggers in the testcase.
With the optimization, it checks whether this->data is NULL and it is.

The following patch avoids that optimization during GENERIC folding when
-fsanitize=null is enabled and it is a cast from non-REFERENCE_TYPE to
REFERENCE_TYPE.

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

PR sanitizer/105729
* fold-const.c (fold_unary_loc): Don't optimize (X &) ((Y *) z + w)
to (X &) z + w if -fsanitize=null during GENERIC folding.

* g++.dg/ubsan/pr105729.C: New test.

(cherry picked from commit e2f014fcefcd2ad56b31995329820bbd99072eae)

2 years agoDaily bump.
GCC Administrator [Mon, 20 Jun 2022 00:18:01 +0000 (00:18 +0000)]
Daily bump.

2 years agoDaily bump.
GCC Administrator [Sun, 19 Jun 2022 00:18:08 +0000 (00:18 +0000)]
Daily bump.

2 years agoDaily bump.
GCC Administrator [Sat, 18 Jun 2022 00:17:59 +0000 (00:17 +0000)]
Daily bump.

2 years agoDaily bump.
GCC Administrator [Fri, 17 Jun 2022 12:17:09 +0000 (12:17 +0000)]
Daily bump.

2 years agoarm: big-endian issue in gen_cpymem_ldrd_strd [PR105981]
Richard Earnshaw [Wed, 15 Jun 2022 15:07:20 +0000 (16:07 +0100)]
arm: big-endian issue in gen_cpymem_ldrd_strd [PR105981]

The code in gen_cpymem_ldrd_strd has been incorrect for big-endian
since r230663.  The problem is that we use gen_lowpart, etc. to split
the 64-bit quantity, but fail to account for the fact that these
routines are really dealing with 64-bit /values/ and in big-endian the
ordering of the sub-registers changes.

To fix this, I've renamed the conceptually misnamed low_reg and hi_reg
as first_reg and second_reg, and then used different logic for
big-endian targets to initialize these values.  This makes the logic
clearer than trying to think about high bits and low bits.

gcc/ChangeLog:

PR target/105981
* config/arm/arm.c (gen_cpymem_ldrd_strd): Rename low_reg and hi_reg
to first_reg and second_reg respectively.  Initialize them correctly
when generating big-endian code.

(cherry picked from commit 8aaa948059a8b5f0a62ad010d0aa6346b7ac9cd3)

2 years agoDaily bump.
GCC Administrator [Thu, 16 Jun 2022 00:18:22 +0000 (00:18 +0000)]
Daily bump.

2 years agolibcpp: Ignore CPP_PADDING tokens in _cpp_parse_expr [PR105732]
Jakub Jelinek [Sun, 29 May 2022 19:57:51 +0000 (21:57 +0200)]
libcpp: Ignore CPP_PADDING tokens in _cpp_parse_expr [PR105732]

The first part of the following testcase (m1-m3 macros and its use)
regressed with my PR89971 fix, but as the m1,m4-m5 and its use part shows,
the problem isn't new, we can emit a CPP_PADDING token to avoid it from
being adjacent to whatever comes after the __VA_OPT__ (in this case there
is nothing afterwards, true).

In most cases these CPP_PADDING tokens don't matter, all other
callers of cpp_get_token_with_location either ignore CPP_PADDING tokens
completely (e.g. c_lex_with_flags) or they just remember them and
take them into account when printing stuff whether there should be
added whitespace or not (scan_translation_unit + token_streamer::stream).
So, I think we should just ignore CPP_PADDING tokens the same way in
_cpp_parse_expr.

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

PR preprocessor/105732
* expr.c (_cpp_parse_expr): Handle CPP_PADDING by just another
token.

* c-c++-common/cpp/va-opt-10.c: New test.

(cherry picked from commit 58a40e76ebadce78639644cd3d56e42b68336927)

2 years agod: Set TYPE_ARTIFICIAL on internal TypeInfo types
Iain Buclaw [Wed, 15 Jun 2022 11:20:15 +0000 (13:20 +0200)]
d: Set TYPE_ARTIFICIAL on internal TypeInfo types

Prevents them from triggering warnings when compiling with `-Wpadded'.

gcc/d/ChangeLog:

* typeinfo.cc (make_internal_typeinfo): Set TYPE_ARTIFICIAL.

gcc/testsuite/ChangeLog:

* gdc.dg/Wpadded.d: New test.

(cherry picked from commit 57b2adae536a6399ed7d2c881b1bc0d4b88e936a)

2 years agodarwin, d: Support outfile substitution for libphobos
Iain Buclaw [Fri, 19 Nov 2021 08:09:54 +0000 (09:09 +0100)]
darwin, d: Support outfile substitution for libphobos

In the gdc driver, this takes the previous fix for the Darwin D
bootstrap, and extends it to the -static-libphobos option as well.
Rather than pushing the -static-libphobos option back onto the command
line, the setting of SKIPOPT is instead conditionally removed.  The same
change has been repeated for -static-libstdc++ so there is now no need
to call generate_option to re-add it.

In the gcc driver, -static-libphobos has been added as a common option,
validated, and a new outfile substition added to config/darwin.h to
correctly replace -lgphobos with libgphobos.a.

gcc/ChangeLog:

* common.opt (static-libphobos): Add option.
* config/darwin.h (LINK_SPEC): Substitute -lgphobos with libgphobos.a
when linking statically.
* gcc.c (driver_handle_option): Set -static-libphobos as always valid.

gcc/d/ChangeLog:

* d-spec.cc (lang_specific_driver): Set SKIPOPT on -static-libstdc++
and -static-libphobos only when target supports LD_STATIC_DYNAMIC.
Remove generate_option to re-add -static-libstdc++.

libphobos/ChangeLog:

* testsuite/testsuite_flags.in: Add libphobos library directory as
search path to --gdcldflags.

(cherry picked from commit 185b307b03db20bfc7105a519ef19e2cafea7196)

2 years agotree-optimization/105726 - adjust array bound heuristic
Richard Biener [Wed, 25 May 2022 09:49:03 +0000 (11:49 +0200)]
tree-optimization/105726 - adjust array bound heuristic

There's heuristic to detect ptr[1].a[...] out of bound accesses
reasoning that if ptr points to an array of aggregates a trailing
incomplete array has to have size zero.  The following more
thoroughly constrains the cases this applies to avoid false
positive diagnostics.

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

PR tree-optimization/105726
* gimple-ssa-warn-restrict.c (builtin_memref::set_base_and_offset):
Constrain array-of-flexarray case more.

* g++.dg/warn/Warray-bounds-27.C: New testcase.

(cherry picked from commit e7c482b08076bb299742883c4ffd65b31e33200c)

2 years agolibstdc++: Use type_identity_t for non-deducible std::atomic_xxx args
Jonathan Wakely [Mon, 13 Jun 2022 15:36:14 +0000 (16:36 +0100)]
libstdc++: Use type_identity_t for non-deducible std::atomic_xxx args

This is LWG 3220 which is about to become Tentatively Ready.

libstdc++-v3/ChangeLog:

* include/std/atomic (__atomic_val_t): Use __type_identity_t
instead of atomic<T>::value_type, as per LWG 3220.
* testsuite/29_atomics/atomic/lwg3220.cc: New test.

(cherry picked from commit 30cc1b65e4efa1a2c57fec5574fcae7a446b822f)

2 years agolibstdc++: Rename __null_terminated to avoid collision with Apple SDK
Mark Mentovai [Mon, 13 Jun 2022 15:40:19 +0000 (16:40 +0100)]
libstdc++: Rename __null_terminated to avoid collision with Apple SDK

The macOS 13 SDK (and equivalent-version iOS and other Apple OS SDKs)
contain this definition in <sys/cdefs.h>:

863  #define __null_terminated

This collides with the use of __null_terminated in libstdc++'s
experimental fs_path.h.

As libstdc++'s use of this token is entirely internal to fs_path.h, the
simplest workaround, renaming it, is most appropriate. Here, it's
renamed to __nul_terminated, referencing the NUL ('\0') value that is
used to terminate the strings in the context in which this tag structure
is used.

libstdc++-v3/ChangeLog:

* include/experimental/bits/fs_path.h (__detail::__null_terminated):
Rename to __nul_terminated to avoid colliding with a macro in
Apple's SDK.

Signed-off-by: Mark Mentovai <mark@mentovai.com>
(cherry picked from commit 254e88b3d7e8abcc236be3451609834371cf4d5d)

2 years agoDaily bump.
GCC Administrator [Wed, 15 Jun 2022 00:18:22 +0000 (00:18 +0000)]
Daily bump.

2 years agotestsuite: Fix up pr104637 testcase [PR104637]
Jakub Jelinek [Wed, 2 Mar 2022 10:04:35 +0000 (11:04 +0100)]
testsuite: Fix up pr104637 testcase [PR104637]

This testcase FAILs everywhere for 3 reasons:
1) the testcase can't work on ia32, where sizeof (long double) == 12
   and as it is not a power of 2, we disallow creating vectors with such
   elements, -mx32 and -m64 are fine
2) the testcase emits a lot of -Wdiv-by-zero warnings, I've just added
   -Wno-div-by-zero to dg-options
3) my fault, when tweaking the testcase I've missed 33 initializers of
   a 32 element vector which didn't change anything on the ICE, but is
   still reported

This patch fixes all of it, tested with
RUNTESTFLAGS='--target_board=unix\{-m32,-m64\} i386.exp=pr104637.c'
both without the LRA fix where it ICEs and with it where it passes
everywhere.

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

PR rtl-optimization/104637
* gcc.target/i386/pr104637.c: Don't run on ia32.  Add -Wno-div-by-zero
to dg-options.
(foo): Remove extraneous initializer.

2 years ago[PR104637] LRA: Split hard regs as many as possible on one subpass
Vladimir N. Makarov [Mon, 28 Feb 2022 21:43:50 +0000 (16:43 -0500)]
[PR104637] LRA: Split hard regs as many as possible on one subpass

LRA hard reg split subpass is a small subpass used as the last
resort for LRA when it can not assign a hard reg to a reload
pseudo by other ways (e.g. by spilling non-reload pseudos).  For
simplicity the subpass works on one split base (as each split
changes pseudo live range info).  In this case it results in
reaching maximal possible number of subpasses.  The patch
implements as many non-overlapping hard reg splits
splits as possible on each subpass.

gcc/ChangeLog:

PR rtl-optimization/104637
* lra-assigns.c (lra_split_hard_reg_for): Split hard regs as many
as possible on one subpass.

gcc/testsuite/ChangeLog:

PR rtl-optimization/104637
* gcc.target/i386/pr104637.c: New.

2 years agox86: Require AVX for F16C and VAES
H.J. Lu [Fri, 10 Jun 2022 18:22:00 +0000 (11:22 -0700)]
x86: Require AVX for F16C and VAES

Since F16C and VAES are only usable with AVX, require AVX for F16C and
VAES.

libgcc/105920
* common/config/i386/cpuinfo.h (get_available_features): Require
AVX for F16C and VAES.

(cherry picked from commit 751f306688508b08842d0ab967dee8e6c3b91351)

2 years agoDaily bump.
GCC Administrator [Tue, 14 Jun 2022 00:18:21 +0000 (00:18 +0000)]
Daily bump.

2 years agoDaily bump.
GCC Administrator [Mon, 13 Jun 2022 00:18:13 +0000 (00:18 +0000)]
Daily bump.

2 years agoDaily bump.
GCC Administrator [Sun, 12 Jun 2022 00:18:15 +0000 (00:18 +0000)]
Daily bump.

2 years agoDaily bump.
GCC Administrator [Sat, 11 Jun 2022 00:18:19 +0000 (00:18 +0000)]
Daily bump.

2 years agolibstdc++: Partially revert r11-9772-g6f8133689f4397 [PR105915]
Jonathan Wakely [Fri, 10 Jun 2022 12:01:16 +0000 (13:01 +0100)]
libstdc++: Partially revert r11-9772-g6f8133689f4397 [PR105915]

The r11-9772-g6f8133689f4397 backport made two changes, but only one was
needed on the gcc-11 branch. The other should not have been backported,
and causes errors with clang. This removes the unwanted part.

libstdc++-v3/ChangeLog:

PR libstdc++/105915
* include/experimental/bits/fs_path.h (path::begin, path::end):
Remove noexcept from declarations.

2 years agoDaily bump.
GCC Administrator [Fri, 10 Jun 2022 00:18:44 +0000 (00:18 +0000)]
Daily bump.

2 years agoDaily bump.
GCC Administrator [Thu, 9 Jun 2022 00:18:19 +0000 (00:18 +0000)]
Daily bump.

2 years agoc++: redeclared hidden friend take 2 [PR105852]
Jason Merrill [Tue, 7 Jun 2022 01:49:06 +0000 (21:49 -0400)]
c++: redeclared hidden friend take 2 [PR105852]

My previous patch for 105761 avoided copying DECL_TEMPLATE_INFO from a
friend to a later definition, but in this testcase we have first a
non-friend declaration and then a definition, and we need to avoid copying
in that case as well.  But we do still want to set new_template_info to
avoid GC trouble.

With this change, the modules dump correctly identifies ::foo as a
non-template function in tpl-friend-2_a.C.

Along the way I noticed that the duplicate_decls handling of
DECL_UNIQUE_FRIEND_P was backwards for templates, where we don't clobber
DECL_LANG_SPECIFIC (olddecl) with DECL_LANG_SPECIFIC (newdecl) like we do
for non-templates.

PR c++/105852
PR c++/105761

gcc/cp/ChangeLog:

* decl.c (duplicate_decls): Avoid copying template info
from non-templated friend even if newdecl isn't a definition.
Correct handling of DECL_UNIQUE_FRIEND_P on templates.
* pt.c (non_templated_friend_p): New.
* cp-tree.h (non_templated_friend_p): Declare it.

gcc/testsuite/ChangeLog:

* g++.dg/modules/tpl-friend-2_a.C: Adjust expected dump.
* g++.dg/template/friend74.C: New test.

2 years agogcc: xtensa: fix PR target/105879
Max Filippov [Wed, 8 Jun 2022 04:01:01 +0000 (21:01 -0700)]
gcc: xtensa: fix PR target/105879

split_double operates with the 'word that comes first in memory in the
target' terminology, while gen_lowpart operates with the 'value
representing some low-order bits of X' terminology. They are not
equivalent and must be dealt with differently on little- and big-endian
targets.

gcc/
PR target/105879
* config/xtensa/xtensa.md (movdi): Rename 'first' and 'second'
to 'lowpart' and 'highpart' so that they match 'gen_lowpart' and
'gen_highpart' bitwise semantics and fix order of highpart and
lowpart depending on target endianness.

(cherry picked from commit e94c6dbfb57a862dd8a8685eabc4886ad1aaea25)

2 years agoFix insn does not satisfy its constraints: sse2_lshrv1ti3
liuhongt [Mon, 6 Jun 2022 05:39:19 +0000 (13:39 +0800)]
Fix insn does not satisfy its constraints: sse2_lshrv1ti3

21114(define_insn_and_split "ssse3_palignrdi"
21115  [(set (match_operand:DI 0 "register_operand" "=y,x,Yv")
21116        (unspec:DI [(match_operand:DI 1 "register_operand" "0,0,Yv")
21117                    (match_operand:DI 2 "register_mmxmem_operand" "ym,x,Yv")
21118                    (match_operand:SI 3 "const_0_to_255_mul_8_operand")]
21119                   UNSPEC_PALIGNR))]
21120  "(TARGET_MMX || TARGET_MMX_WITH_SSE) && TARGET_SSSE3"

Alternative 2 requires Yw instead of Yv since it's splitted to vpsrldq
which requires AVX512VL & AVX512BW for evex version.

gcc/ChangeLog:

PR target/105854
* config/i386/sse.md (ssse3_palignrdi): Change alternative 2
from Yv to Yw.

2 years agoDaily bump.
GCC Administrator [Wed, 8 Jun 2022 00:18:14 +0000 (00:18 +0000)]
Daily bump.

2 years agoDaily bump.
GCC Administrator [Tue, 7 Jun 2022 00:18:20 +0000 (00:18 +0000)]
Daily bump.

2 years agoDaily bump.
GCC Administrator [Mon, 6 Jun 2022 00:18:05 +0000 (00:18 +0000)]
Daily bump.

2 years agoDaily bump.
GCC Administrator [Sun, 5 Jun 2022 00:18:14 +0000 (00:18 +0000)]
Daily bump.

2 years agoDaily bump.
GCC Administrator [Sat, 4 Jun 2022 00:18:07 +0000 (00:18 +0000)]
Daily bump.

2 years agoc++: redeclared hidden friend [PR105761]
Jason Merrill [Fri, 3 Jun 2022 16:35:12 +0000 (12:35 -0400)]
c++: redeclared hidden friend [PR105761]

Here, when we see the second declaration of f we match it with the first
one, copy over DECL_TEMPLATE_INFO, and then try to use it when parsing the
definition, leading to confusion.

PR c++/105761

gcc/cp/ChangeLog:

* decl.c (duplicate_decls): Don't copy DECL_TEMPLATE_INFO
from a hidden friend.

gcc/testsuite/ChangeLog:

* g++.dg/cpp1y/auto-fn64.C: New test.

2 years agoc++: constexpr empty aggr [PR105795]
Jason Merrill [Wed, 1 Jun 2022 20:13:48 +0000 (16:13 -0400)]
c++: constexpr empty aggr [PR105795]

In this testcase, leaving ctx->ctor pointing to the enclosing object meant
that evaluating the initializer for the subobject clobbered previous
initializers for the enclosing object.  So do update ctx->ctor, just don't
add it to the enclosing object ctor.

PR c++/105795

gcc/cp/ChangeLog:

* constexpr.c (cxx_eval_bare_aggregate): Always call
init_subob_ctx.

gcc/testsuite/ChangeLog:

* g++.dg/cpp1z/constexpr-aggr-base1.C: New test.

2 years agotree-optimization/105437 - BB vect with extern defs of throwing stmts
Richard Biener [Mon, 2 May 2022 07:30:27 +0000 (09:30 +0200)]
tree-optimization/105437 - BB vect with extern defs of throwing stmts

We have to watch out for vectorized stmt insert locations if the
def from the last stmt alters control flow.  We constrain region
building so we know the def is outside of the current region
and thus we can insert at the region start point.

2022-05-02  Richard Biener  <rguenther@suse.de>

PR tree-optimization/105437
* tree-vect-slp.c (vect_schedule_slp_node): Handle the
case where last_stmt alters control flow.

* g++.dg/vect/pr105437.cc: New testcase.

(cherry picked from commit 3a3eda000fdf4f8754c9a2535191091f1db0c2a2)

2 years agoDaily bump.
GCC Administrator [Thu, 2 Jun 2022 00:18:10 +0000 (00:18 +0000)]
Daily bump.

2 years agoDaily bump.
GCC Administrator [Wed, 1 Jun 2022 00:18:18 +0000 (00:18 +0000)]
Daily bump.

2 years agoc++: constexpr ref to array of array [PR102307]
Jason Merrill [Tue, 26 Apr 2022 15:15:04 +0000 (11:15 -0400)]
c++: constexpr ref to array of array [PR102307]

The problem here is that first check_initializer calls
build_aggr_init_full_exprs, which does overload resolution, but then in the
case of failed constexpr throws away the result and does it again in
build_functional_cast.  But in the first overload resolution,
reshape_init_array_1 decided to reuse the inner CONSTRUCTORs because
tf_error is set, so we know we're committed.  But the second pass gets
confused by the CONSTRUCTORs with non-init-list types.

Fixed by avoiding a second pass: instead, pass the call from build_aggr_init
to build_cplus_new, which will turn it into a TARGET_EXPR.  I don't bother
to change the object argument because it will be replaced later in
simplify_aggr_init_expr.

PR c++/102307

gcc/cp/ChangeLog:

* decl.c (check_initializer): Use build_cplus_new in case of
constexpr failure.

gcc/testsuite/ChangeLog:

* g++.dg/cpp1z/constexpr-array2.C: New test.

2 years agoDaily bump.
GCC Administrator [Tue, 31 May 2022 00:18:13 +0000 (00:18 +0000)]
Daily bump.

2 years agoDaily bump.
GCC Administrator [Mon, 30 May 2022 00:18:18 +0000 (00:18 +0000)]
Daily bump.

2 years agoDaily bump.
GCC Administrator [Sun, 29 May 2022 00:18:06 +0000 (00:18 +0000)]
Daily bump.

2 years agoDaily bump.
GCC Administrator [Sat, 28 May 2022 00:18:20 +0000 (00:18 +0000)]
Daily bump.

2 years agotestsuite: Skip pr105250.c for powerpc and s390 [PR105266]
Kewen Lin [Mon, 18 Apr 2022 02:34:51 +0000 (21:34 -0500)]
testsuite: Skip pr105250.c for powerpc and s390 [PR105266]

This test case pr105250.c is like its related pr105140.c, which
suffers the error with message like "{AltiVec,vector} argument
passed to unprototyped" on powerpc and s390.  So like commits
r12-8025 and r12-8039, this fix is to add the dg-skip-if for
powerpc*-*-* and s390*-*-*.

gcc/testsuite/ChangeLog:

PR testsuite/105266
* gcc.dg/pr105250.c: Skip for powerpc*-*-* and s390*-*-*.

(cherry picked from commit 021b51814d67bedd8f41ac07edfd05654140c6e5)

2 years agoDaily bump.
GCC Administrator [Fri, 27 May 2022 00:17:55 +0000 (00:17 +0000)]
Daily bump.

2 years agoRISC-V: Don't unconditionally add m,a,f,d in arch-canonicalize
Simon Cook [Wed, 25 May 2022 13:25:43 +0000 (14:25 +0100)]
RISC-V: Don't unconditionally add m,a,f,d in arch-canonicalize

This solves an issue where rv32i, etc. are canonicalized to rv32imafd
since the g->i addition of 'm', 'a', 'f', 'd' is not actually gated by
whether the input was rv32g/rv64g.

gcc/ChangeLog:

* config/riscv/arch-canonicalize: Only add mafd extension if
base was rv32/rv64g.

(cherry picked from commit 63f198553d3940495bfaa49da30b2ce93375c916)

2 years agoRISC-V: Fix wrong expansion for arch-canonicalize
Kito Cheng [Mon, 9 May 2022 03:44:30 +0000 (11:44 +0800)]
RISC-V: Fix wrong expansion for arch-canonicalize

rv64gcv should exapnd into:

rv64imafdcv_zicsr_zifencei_zve32f_zve32x_zve64d_zve64f_zve64x_zvl128b_zvl32b_zvl64b

but we exapnd fd twice for now:

rv64imafdfdcv_zicsr_zifencei_zve32f_zve32x_zve64d_zve64f_zve64x_zvl128b_zvl32b_zvl64b

gcc/ChangeLog:

* config/riscv/arch-canonicalize: Handle g correctly.

(cherry picked from commit 27239e13b1ba383e2706231917062aa6e14150a8)

2 years agoDaily bump.
GCC Administrator [Thu, 26 May 2022 00:18:15 +0000 (00:18 +0000)]
Daily bump.

2 years agoIBM zSystems/testsuite: PR105147: Skip pr105140.c
Andreas Krebbel [Thu, 7 Apr 2022 05:29:13 +0000 (07:29 +0200)]
IBM zSystems/testsuite: PR105147: Skip pr105140.c

pr105140.c fails on IBM zSystems with "vector argument passed to
unprototyped function".  s390_invalid_arg_for_unprototyped_fn in
s390.cc is triggered by that.

gcc/testsuite/ChangeLog:

PR target/105147
* gcc.dg/pr105140.c: Skip for s390*-*-*.

(cherry picked from commit 176df4ccb58689aae29511b99d60a448558ede94)

2 years agors6000/testsuite: Skip pr105140.c
Segher Boessenkool [Wed, 6 Apr 2022 15:22:24 +0000 (15:22 +0000)]
rs6000/testsuite: Skip pr105140.c

This test fails with error "AltiVec argument passed to unprototyped
function", but the code (in rs6000.c:invalid_arg_for_unprototyped_fn,
from 2005) actually tests for any vector type argument.  It also does
not fail on Darwin, not reflected here though.

2022-04-06  Segher Boessenkool  <segher@kernel.crashing.org>

gcc/testsuite/
PR target/105147
* gcc.dg/pr105140.c: Skip for powerpc*-*-*.

(cherry picked from commit c65d15d40738f3691ff1a39907a4b93e9fe5c5ae)

2 years agoDaily bump.
GCC Administrator [Wed, 25 May 2022 00:18:37 +0000 (00:18 +0000)]
Daily bump.

2 years agoi386: Adjust -fzero-call-used-regs to always use XOR [PR101891]
Qing Zhao [Tue, 24 May 2022 15:54:06 +0000 (15:54 +0000)]
i386: Adjust -fzero-call-used-regs to always use XOR [PR101891]

Currently on i386, -fzero-call-used-regs uses a pattern of:

XOR regA,regA
MOV regA,regB
MOV regA,regC
...
RET

However, this introduces both a register ordering dependency (e.g. the CPU
cannot clear regB without clearing regA first), and while greatly reduces
available ROP gadgets, it does technically leave a set of "MOV" ROP gadgets
at the end of functions (e.g. "MOV regA,regC; RET").

This patch will switch to always use XOR on i386:

XOR regA,regA
XOR regB,regB
XOR regC,regC
...
RET

gcc/ChangeLog:

PR target/101891
* config/i386/i386.c (zero_call_used_regno_mode): use V2SImode
as a generic MMX mode instead of V4HImode.
(zero_all_mm_registers): Use SET to zero instead of MOV for
zeroing scratch registers.
(ix86_zero_call_used_regs): Likewise.

gcc/testsuite/ChangeLog:

* gcc.target/i386/zero-scratch-regs-1.c: Add -fno-stack-protector
-fno-PIC.
* gcc.target/i386/zero-scratch-regs-10.c: Adjust mov to xor.
* gcc.target/i386/zero-scratch-regs-13.c: Add -msse.
* gcc.target/i386/zero-scratch-regs-14.c: Adjust mov to xor.
* gcc.target/i386/zero-scratch-regs-15.c: Add -fno-stack-protector
-fno-PIC.
* gcc.target/i386/zero-scratch-regs-16.c: Likewise.
* gcc.target/i386/zero-scratch-regs-17.c: Likewise.
* gcc.target/i386/zero-scratch-regs-18.c: Add -fno-stack-protector
-fno-PIC, adjust mov to xor.
* gcc.target/i386/zero-scratch-regs-19.c: Add -fno-stack-protector
-fno-PIC.
* gcc.target/i386/zero-scratch-regs-2.c: Adjust mov to xor.
* gcc.target/i386/zero-scratch-regs-20.c: Add -msse.
* gcc.target/i386/zero-scratch-regs-21.c: Add -fno-stack-protector
-fno-PIC, Adjust mov to xor.
* gcc.target/i386/zero-scratch-regs-22.c: Adjust mov to xor.
* gcc.target/i386/zero-scratch-regs-23.c: Likewise.
* gcc.target/i386/zero-scratch-regs-26.c: Likewise.
* gcc.target/i386/zero-scratch-regs-27.c: Likewise.
* gcc.target/i386/zero-scratch-regs-28.c: Likewise.
* gcc.target/i386/zero-scratch-regs-3.c: Add -fno-stack-protector.
* gcc.target/i386/zero-scratch-regs-31.c: Adjust mov to xor.
* gcc.target/i386/zero-scratch-regs-4.c: Add -fno-stack-protector
-fno-PIC.
* gcc.target/i386/zero-scratch-regs-5.c: Adjust mov to xor.
* gcc.target/i386/zero-scratch-regs-6.c: Add -fno-stack-protector.
* gcc.target/i386/zero-scratch-regs-7.c: Likewise.
* gcc.target/i386/zero-scratch-regs-8.c: Adjust mov to xor.
* gcc.target/i386/zero-scratch-regs-9.c: Add -fno-stack-protector.

(cherry picked from commit 0b86943aca51175968e40bbb6f2662dfe3fbfe59)

2 years agoDaily bump.
GCC Administrator [Tue, 24 May 2022 00:18:45 +0000 (00:18 +0000)]
Daily bump.

2 years agors6000: __Uglify non-uglified local variables in headers
Paul A. Clarke [Mon, 23 May 2022 16:39:57 +0000 (11:39 -0500)]
rs6000: __Uglify non-uglified local variables in headers

Properly prefix (with "__")  all local variables in shipped headers for x86
compatibility intrinsics implementations.  This avoids possible problems with
usages like:
```
 #define result foo()
 #include <emmintrin.h>
```

2022-05-23  Paul A. Clarke  <pc@us.ibm.com>

gcc
PR target/104257
* config/rs6000/bmi2intrin.h: Uglify local variables.
* config/rs6000/emmintrin.h: Likewise.
* config/rs6000/mm_malloc.h: Likewise.
* config/rs6000/mmintrin.h: Likewise.
* config/rs6000/pmmintrin.h: Likewise.
* config/rs6000/smmintrin.h: Likewise.
* config/rs6000/tmmintrin.h: Likewise.
* config/rs6000/xmmintrin.h: Likewise.

2 years agoDaily bump.
GCC Administrator [Mon, 23 May 2022 00:18:17 +0000 (00:18 +0000)]
Daily bump.

2 years agoDaily bump.
GCC Administrator [Sun, 22 May 2022 00:18:23 +0000 (00:18 +0000)]
Daily bump.

2 years agoDaily bump.
GCC Administrator [Sat, 21 May 2022 00:18:27 +0000 (00:18 +0000)]
Daily bump.

2 years agoDaily bump.
GCC Administrator [Fri, 20 May 2022 00:18:18 +0000 (00:18 +0000)]
Daily bump.

2 years agors6000: Ignore fusion option flags for inlining test [PR102059]
Michael Meissner [Fri, 6 May 2022 16:39:13 +0000 (11:39 -0500)]
rs6000: Ignore fusion option flags for inlining test [PR102059]

The -mpower8-fusion and -mpower10-fusion options do not modify which
instructions we can generate, so ignore them when deciding whether we
can inline callee into caller.

2022-05-06  Michael Meissner  <meissner@linux.ibm.com>
    Segher Boessenkool  <segher@kernel.crashing.org>

gcc/
PR target/102059
* config/rs6000/rs6000.c (rs6000_can_inline_p): Ignore -mpower8-fusion
and -mpower10-fusion options for inlining purposes.

gcc/testsuite/
PR target/102059
* gcc.target/powerpc/pr102059-4.c: New test.

(cherry picked from commit 2fb654f77d5292864ef57040f7bc01d7a975f6d9)

2 years agortl-optimization/105559 - avoid quadratic behavior in delete_insn_and_edges
Richard Biener [Wed, 11 May 2022 11:34:37 +0000 (13:34 +0200)]
rtl-optimization/105559 - avoid quadratic behavior in delete_insn_and_edges

When the insn to delete is a debug insn there's no point in figuring
out whether it might be the last real insn and thus we have to purge
dead edges.

2022-05-11  Richard Biener  <rguenther@suse.de>

PR rtl-optimization/105559
* cfgrtl.c (delete_insn_and_edges): Only perform search to BB_END
for non-debug insns.

(cherry picked from commit 37a8220fa9188470c677abfef50c1b120c0b6c76)

2 years agotree-optimization/105431 - another overflow in powi handling
Richard Biener [Fri, 29 Apr 2022 06:45:48 +0000 (08:45 +0200)]
tree-optimization/105431 - another overflow in powi handling

This avoids undefined signed overflow when calling powi_as_mults_1.

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

PR tree-optimization/105431
* tree-ssa-math-opts.c (powi_as_mults_1): Make n unsigned.
(powi_as_mults): Use absu_hwi.
(gimple_expand_builtin_powi): Remove now pointless n != -n
check.

(cherry picked from commit 44b09adb9bad99dd7e3017c5ecefed7f7c9a1590)

2 years agotree-optimization/105368 - avoid overflow in powi_cost
Richard Biener [Mon, 25 Apr 2022 08:55:21 +0000 (10:55 +0200)]
tree-optimization/105368 - avoid overflow in powi_cost

The following avoids undefined signed overflow when computing
the absolute of the exponent in powi_cost.

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

PR tree-optimization/105368
* tree-ssa-math-opts.c (powi_cost): Use absu_hwi.

(cherry picked from commit f0e170f72f8bfaa2a64e1d09ebdfd48f917420f1)

2 years agotree-optimization/105312 - fix ISEL VCOND expansion
Richard Biener [Wed, 20 Apr 2022 08:17:24 +0000 (10:17 +0200)]
tree-optimization/105312 - fix ISEL VCOND expansion

The following aligns ISEL VEC_COND_EXPR expansion using VCOND
with the optab query done by vector lowering.  Instead of only
allowing the signed optab to provide EQ/NE compares we allow both
here though since there seems to be no documented canonicalization.

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

PR tree-optimization/105312
* gimple-isel.cc (gimple_expand_vec_cond_expr): Query both
VCOND and VCONDU for EQ and NE.

* gcc.target/arm/pr105312.c: New testcase.

(cherry picked from commit 36f1de95a61132f63c0c07ef154abd9f435721ac)

2 years agotree-optimization/105263 - reassoc and DFP
Richard Biener [Wed, 13 Apr 2022 12:53:40 +0000 (14:53 +0200)]
tree-optimization/105263 - reassoc and DFP

reassoc has certain tricks which in the end depend on the ability
to undo them.  For DFP creating a -1. constant is easy but
re-identifying is appearantly not - real_minus_onep rejects those
outright for DFP.  So we have to disable (at least) this one trick.

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

PR tree-optimization/105263
* tree-ssa-reassoc.c (try_special_add_to_ops): Do not consume
negates in multiplication chains with DFP.

* gcc.dg/pr105263.c: New testcase.

(cherry picked from commit ca145c6306f19272ac8756d88c4eba0bfdf01dfb)

2 years agotree-optimization/105173 - fix insertion logic in reassoc
Richard Biener [Wed, 6 Apr 2022 09:43:01 +0000 (11:43 +0200)]
tree-optimization/105173 - fix insertion logic in reassoc

The find_insert_point logic around deciding whether to insert
before or after the found insertion point does not handle
the case of _12 = ..;, _12, 1.0 well.  The following puts the
logic into find_insert_point itself instead.

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

PR tree-optimization/105173
* tree-ssa-reassoc.c (find_insert_point): Get extra
insert_before output argument and compute it.
(insert_stmt_before_use): Adjust.
(rewrite_expr_tree): Likewise.

* gcc.dg/pr105173.c: New testcase.

(cherry picked from commit e1a5e7562d53a8d2256f754714b06595bea72196)

2 years agotree-optimization/105163 - abnormal SSA coalescing and reassoc
Richard Biener [Wed, 6 Apr 2022 07:36:38 +0000 (09:36 +0200)]
tree-optimization/105163 - abnormal SSA coalescing and reassoc

The negate propagation optimizations in reassoc did not look out for
abnormal SSA coalescing issues.  The following fixes that.

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

PR tree-optimization/105163
* tree-ssa-reassoc.c (repropagate_negates): Avoid propagating
negated abnormals.

* gcc.dg/torture/pr105163.c: New testcase.

(cherry picked from commit 44fe49401725055a740ce47e80561b6932b8cd01)

2 years agotree-optimization/105148 - fix IVOPTs recording uses
Richard Biener [Tue, 5 Apr 2022 14:06:10 +0000 (16:06 +0200)]
tree-optimization/105148 - fix IVOPTs recording uses

The following fixes recording uses in ARRAY_REFs with non-constant
element size or low bound.

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

PR tree-optimization/105148
* tree-ssa-loop-ivopts.c (idx_record_use): Walk raw operands
2 and 3 of ARRAY_REFs.

* gcc.dg/torture/pr105148.c: New testcase.

(cherry picked from commit 86242eb1bd03eba82d8e22b01b16925d43bcc539)

2 years agotree-optimization/105250 - adjust fold_convertible_p PR105140 fix
Richard Biener [Wed, 13 Apr 2022 06:52:57 +0000 (08:52 +0200)]
tree-optimization/105250 - adjust fold_convertible_p PR105140 fix

The following reverts the original PR105140 fix and goes for instead
applying the additional fold_convert constraint for VECTOR_TYPE
conversions also to fold_convertible_p.  I did not try sanitizing
all of this at this point.

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

PR tree-optimization/105250
* fold-const.c (fold_convertible_p): Revert
r12-7979-geaaf77dd85c333, instead check for size equality
of the vector types involved.

* gcc.dg/pr105250.c: New testcase.

(cherry picked from commit 4e892de6774f86540d36385701aa7b0a2bba5155)

2 years agomiddle-end/105140 - fix bogus recursion in fold_convertible_p
Richard Biener [Mon, 4 Apr 2022 08:20:05 +0000 (10:20 +0200)]
middle-end/105140 - fix bogus recursion in fold_convertible_p

fold_convertible_p expects an operand and a type to convert to
but recurses with two vector component types.  Fixed by allowing
types instead of an operand as well.

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

PR middle-end/105140
* fold-const.c (fold_convertible_p): Allow a TYPE_P arg.

* gcc.dg/pr105140.c: New testcase.

(cherry picked from commit eaaf77dd85c333b116111bb1ae6c080154a4e411)

2 years agoipa: Release body of clone_of when removing its last clone (PR 100413)
Martin Jambor [Thu, 19 May 2022 12:06:08 +0000 (14:06 +0200)]
ipa: Release body of clone_of when removing its last clone (PR 100413)

In the PR, the verifier complains that we did not manage to remove the
body of a node and it is right.  The node is kept for materialization
of two clones but after one is materialized, the other one is removed
as unneeded (as a part of delete_unreachable_blocks_update_callgraph).
The problem is that the node removal does not check for this situation
and can leave the clone_of node there with a body attached to it even
though there is no use for it any more.  This patch does checks for it
and handles the situation in a simlar way that
cgraph_node::materialize_clone does it, except that it also has to be
careful that the removed node itself does not have any clones, which
would still need the clone_of's body.  Failing to do that results in a
bootstrap failure.

gcc/ChangeLog:

2022-04-27  Martin Jambor  <mjambor@suse.cz>

PR ipa/100413
* cgraph.c (cgraph_node::remove): Release body of the node this
is clone_of if appropriate.

gcc/testsuite/ChangeLog:

2022-04-27  Martin Jambor  <mjambor@suse.cz>

PR ipa/100413
* g++.dg/ipa/pr100413.C: New test.

(cherry picked from commit 27ee75dbe81bb781214c66a9e6a759c08b7deb60)

2 years agoDaily bump.
GCC Administrator [Thu, 19 May 2022 00:18:05 +0000 (00:18 +0000)]
Daily bump.

2 years agoDaily bump.
GCC Administrator [Wed, 18 May 2022 00:18:22 +0000 (00:18 +0000)]
Daily bump.

2 years agoDaily bump.
GCC Administrator [Tue, 17 May 2022 00:18:07 +0000 (00:18 +0000)]
Daily bump.

2 years agoFortran: fix error recovery on invalid array section
Harald Anlauf [Tue, 10 May 2022 21:41:57 +0000 (23:41 +0200)]
Fortran: fix error recovery on invalid array section

gcc/fortran/ChangeLog:

PR fortran/105230
* expr.c (find_array_section): Correct logic to avoid NULL
pointer dereference on invalid array section.

gcc/testsuite/ChangeLog:

PR fortran/105230
* gfortran.dg/pr105230.f90: New test.

Co-authored-by: Steven G. Kargl <kargl@gcc.gnu.org>
(cherry picked from commit 0acdbe29f66017fc5cca40dcbd72a0dd41491d07)

2 years agoFortran: improve error recovery on invalid array section
Harald Anlauf [Wed, 9 Mar 2022 20:58:26 +0000 (21:58 +0100)]
Fortran: improve error recovery on invalid array section

gcc/fortran/ChangeLog:

PR fortran/104849
* expr.c (find_array_section): Avoid NULL pointer dereference on
invalid array section.

gcc/testsuite/ChangeLog:

PR fortran/104849
* gfortran.dg/pr104849.f90: New test.

(cherry picked from commit 22015e77d3e45306077396b9de8a8a28bb67fb20)

2 years ago[AArch64] add barriers to ool __sync builtins
Sebastian Pop [Mon, 18 Apr 2022 15:13:20 +0000 (15:13 +0000)]
[AArch64] add barriers to ool __sync builtins

2022-05-13  Sebastian Pop  <spop@amazon.com>

gcc/
PR target/105162
* config/aarch64/aarch64-protos.h (atomic_ool_names): Increase dimension
of str array.
* config/aarch64/aarch64.c (aarch64_atomic_ool_func): Call
memmodel_from_int and handle MEMMODEL_SYNC_*.
(DEF0): Add __aarch64_*_sync functions.

gcc/testsuite/
PR target/105162
* gcc.target/aarch64/sync-comp-swap-ool.c: New.
* gcc.target/aarch64/sync-op-acquire-ool.c: New.
* gcc.target/aarch64/sync-op-full-ool.c: New.
* gcc.target/aarch64/target_attr_20.c: Update check.
* gcc.target/aarch64/target_attr_21.c: Same.

libgcc/
PR target/105162
* config/aarch64/lse.S: Define BARRIER and handle memory MODEL 5.
* config/aarch64/t-lse: Add a 5th memory model for _sync functions.

2 years agolibstdc++: Document support for constexpr optional (P2231R1)
Jonathan Wakely [Mon, 16 May 2022 14:33:06 +0000 (15:33 +0100)]
libstdc++: Document support for constexpr optional (P2231R1)

The changes for std::variant are not on the gcc-11 branch though.

libstdc++-v3/ChangeLog:

* doc/xml/manual/status_cxx2023.xml: Update status.
* doc/html/manual/status.html: Regenerate.

This page took 0.102765 seconds and 5 git commands to generate.