Commit Graph

179015 Commits

Author SHA1 Message Date
GCC Administrator e026b23a14 Daily bump. 2022-07-11 00:17:42 +00:00
GCC Administrator cfacfd452c Daily bump. 2022-07-10 00:17:34 +00:00
GCC Administrator 558c3a96e0 Daily bump. 2022-07-09 00:17:48 +00:00
GCC Administrator 1d6edb7865 Daily bump. 2022-07-08 00:17:24 +00:00
GCC Administrator 86a2cc7b71 Daily bump. 2022-07-07 00:17:32 +00:00
GCC Administrator 0c4298386c Daily bump. 2022-07-06 00:17:32 +00:00
Iain Buclaw 0b909ae026 d: Fix error: aggregate value used where floating point was expected
Casting from vector to static array is permitted, and the frontend
generates a reinterpret cast, but casting back the other way resulted in
an error.  This has been fixed to be properly handled in the code
generation pass of VectorExp, and the conversion for lvalue and rvalue
handling done in convert_expr and convert_for_rvalue respectively.

	PR d/106139

gcc/d/ChangeLog:

	* d-convert.cc (convert_expr): Handle casting from array to vector.
	(convert_for_rvalue): Rewrite vector to array casts of the same
	element type into a constructor.
	(convert_for_assignment): Return calling convert_for_rvalue.
	* dmd/expressionsem.c (ExpressionSemanticVisitor::visit): Run semantic
	on vector expression after lowering.
	* expr.cc (ExprVisitor::visit (VectorExp *)): Handle generating a
	vector expression from a static array.

gcc/testsuite/ChangeLog:

	* gdc.dg/pr106139a.d: New test.
	* gdc.dg/pr106139b.d: New test.
	* gdc.dg/pr106139c.d: New test.
	* gdc.dg/pr106139d.d: New test.
	* gdc.test/fail_compilation/ice20264.d: New test.

(cherry picked from commit 488759b7ea)
2022-07-05 11:40:30 +02:00
GCC Administrator ea15c0f193 Daily bump. 2022-07-05 00:17:43 +00:00
GCC Administrator 395fc5b23d Daily bump. 2022-07-04 00:17:14 +00:00
Harald Anlauf 290147c4c8 Fortran: error recovery on invalid CLASS(), PARAMETER declarations [PR105243]
gcc/fortran/ChangeLog:

	PR fortran/103137
	PR fortran/103138
	PR fortran/103693
	PR fortran/105243
	* decl.c (gfc_match_data_decl): Reject CLASS entity declaration
	when it is given the PARAMETER attribute.

gcc/testsuite/ChangeLog:

	PR fortran/103137
	PR fortran/103138
	PR fortran/103693
	PR fortran/105243
	* gfortran.dg/class_58.f90: Fix test.
	* gfortran.dg/class_73.f90: New test.

Co-authored-by: Steven G. Kargl <kargl@gcc.gnu.org>
(cherry picked from commit 4c233cabbe)
2022-07-03 22:14:24 +02:00
Harald Anlauf 8bb7567f5a Fortran: improve error recovery for EXTENDS_TYPE_OF() [PR106121]
gcc/fortran/ChangeLog:

	PR fortran/106121
	* simplify.c (gfc_simplify_extends_type_of): Do not attempt to
	simplify when one of the arguments is a CLASS variable that was
	not properly declared.

gcc/testsuite/ChangeLog:

	PR fortran/106121
	* gfortran.dg/extends_type_of_4.f90: New test.

Co-authored-by: Steven G. Kargl <kargl@gcc.gnu.org>
(cherry picked from commit b8f284d367)
2022-07-03 22:14:18 +02:00
GCC Administrator 061f6d2ef7 Daily bump. 2022-07-03 00:17:28 +00:00
GCC Administrator 69b1e3e7dd Daily bump. 2022-07-02 00:17:34 +00:00
Harald Anlauf bac4227334 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 a312407bd7)
2022-07-01 20:13:17 +02:00
Harald Anlauf e6db08d918 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 ff35dbc020)
2022-07-01 19:54:39 +02:00
Harald Anlauf 1214ebb39c 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 f21f17f95c)
2022-07-01 19:10:47 +02:00
GCC Administrator bedcdedfad Daily bump. 2022-07-01 00:17:35 +00:00
GCC Administrator 7471cc92b7 Daily bump. 2022-06-30 00:17:37 +00:00
GCC Administrator 652e52ef1f Daily bump. 2022-06-29 00:17:49 +00:00
Jakub Jelinek a94e627488 Bump BASE-VER.
2022-06-28  Jakub Jelinek  <jakub@redhat.com>

	* BASE-VER: Set to 10.4.1.
2022-06-28 12:12:21 +02:00
Jakub Jelinek 7ff47281ce Update ChangeLog and version files for release 2022-06-28 08:37:18 +00:00
GCC Administrator f450e21133 Daily bump. 2022-06-28 00:17:46 +00:00
GCC Administrator 4a236ed1ea Daily bump. 2022-06-27 00:17:25 +00:00
GCC Administrator 7a02bfd592 Daily bump. 2022-06-26 00:17:19 +00:00
GCC Administrator 61b200dbeb Daily bump. 2022-06-25 00:17:36 +00:00
Iain Buclaw a99706355c 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 c0ad48527c)
2022-06-24 21:01:15 +02:00
GCC Administrator 6dd4d54561 Daily bump. 2022-06-24 00:17:27 +00:00
GCC Administrator 94dd514748 Daily bump. 2022-06-23 00:17:56 +00:00
GCC Administrator a5bc895f1f Daily bump. 2022-06-22 00:17:32 +00:00
GCC Administrator 3c390f4ad2 Daily bump. 2022-06-21 00:17:29 +00:00
Uros Bizjak 94cf9bfb4d 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 cc378e6557)
2022-06-20 22:50:47 +02:00
Uros Bizjak 570a6067ff 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 1f8278bfcf)
2022-06-20 22:32:35 +02:00
Segher Boessenkool 58465d673b rs6000: Do not use rs6000_cpu for .machine ppc and ppc64 (PR104829)
Fixes: 77eccbf39e

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 80fcc4b6af)
2022-06-20 22:25:04 +02:00
Segher Boessenkool 6142d65f4f 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 77eccbf39e)
2022-06-20 22:24:55 +02:00
Jakub Jelinek 20bb976fb6 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 ef66212017)
2022-06-20 08:37:57 +02:00
Jan Hubicka 62148f13c6 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 8f6c317b3a)
2022-06-20 08:37:57 +02:00
Jakub Jelinek 7656213865 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 e2f014fcef)
2022-06-20 08:37:56 +02:00
GCC Administrator 71d0e689e8 Daily bump. 2022-06-20 00:17:10 +00:00
GCC Administrator 84dfcd3640 Daily bump. 2022-06-19 00:17:15 +00:00
GCC Administrator 714844c77a Daily bump. 2022-06-18 00:17:05 +00:00
GCC Administrator 747e4aa141 Daily bump. 2022-06-17 00:17:32 +00:00
Richard Earnshaw 20ece449e0 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 8aaa948059)
2022-06-16 09:26:43 +01:00
GCC Administrator 4af4bb6baf Daily bump. 2022-06-16 00:17:33 +00:00
Simon Wright 82b771fd6c Darwin: Truncate kernel-provided version to OS major for Darwin >= 20.
In common with system tools, GCC uses a version obtained from the kernel as
the prevailing macOS target, when that is not overridden by command line or
environment versions (i.e. mmacosx-version-min=, MACOSX_DEPLOYMENT_TARGET).

Presently, GCC assumes that if the OS version is >= 20, the value used should
include both major and minium version identifiers.  However the system tools
(for those versions) truncate the value to the major version - this leads to
link errors when combining objects built with clang and GCC for example:

ld: warning: object file (null.o) was built for newer macOS version (12.2)
than being linked (12.0)

The change here truncates the values GCC uses to the major version.

gcc/ChangeLog:

	PR target/104871
	* config/darwin-driver.c (darwin_find_version_from_kernel): If the OS
	version is darwin20 (macOS 11) or greater, truncate the version to the
	major number.

(cherry picked from commit add1adaa17)
2022-06-15 20:17:28 +01:00
Mark Mentovai f335ab5b77 Darwin: Future-proof -mmacosx-version-min
f18cbc1ee1 (2021-12-18) updated various parts of gcc to not impose a
Darwin or macOS version maximum of the current known release. Different
parts of gcc accept, variously, Darwin version numbers matching
darwin2*, and macOS major version numbers up to 99. The current released
version is Darwin 21 and macOS 12, with Darwin 22 and macOS 13 expected
for public release later this year. With one major OS release per year,
this strategy is expected to provide another 8 years of headroom.

However, f18cbc1ee1 missed config/darwin-c.c (now .cc), which
continued to impose a maximum of macOS 12 on the -mmacosx-version-min
compiler driver argument. This was last updated from 11 to 12 in
11b9675774 (2021-10-27), but kicking the can down the road one year at
a time is not a viable strategy, and is not in line with the more recent
technique from f18cbc1ee1.

Prior to 556ab51259 (2020-11-06), config/darwin-c.c did not impose a
maximum that needed annual maintenance, as at that point, all macOS
releases had used a major version of 10. The stricter approach imposed
since then was valuable for a time until the particulars of the new
versioning scheme were established and understood, but now that they
are, it's prudent to restore a more permissive approach.

gcc/ChangeLog:

	* config/darwin-c.c: Make -mmacosx-version-min more future-proof.

Signed-off-by: Mark Mentovai <mark@mentovai.com>
(cherry picked from commit 6725f186cb)
2022-06-15 20:16:30 +01:00
Jakub Jelinek b2f5dc8240 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 58a40e76eb)
2022-06-15 14:03:37 +02:00
Iain Buclaw b524caf886 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 57b2adae53)
2022-06-15 13:56:03 +02:00
Richard Biener 55ea766008 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 e7c482b080)
2022-06-15 11:49:27 +02:00
Jonathan Wakely 67bd68bb09 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 30cc1b65e4)
2022-06-15 09:14:28 +01:00
Mark Mentovai 7137ae4051 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 254e88b3d7)
2022-06-15 09:14:28 +01:00