]> git.ipfire.org Git - thirdparty/gcc.git/log
thirdparty/gcc.git
9 months agoUpdate ChangeLog and version files for release releases/gcc-10 releases/gcc-10.5.0
Richard Biener [Fri, 7 Jul 2023 07:08:39 +0000 (07:08 +0000)] 
Update ChangeLog and version files for release

9 months agoDaily bump.
GCC Administrator [Fri, 7 Jul 2023 00:18:13 +0000 (00:18 +0000)] 
Daily bump.

9 months agoDaily bump.
GCC Administrator [Thu, 6 Jul 2023 00:19:06 +0000 (00:19 +0000)] 
Daily bump.

9 months agoDaily bump.
GCC Administrator [Wed, 5 Jul 2023 00:18:29 +0000 (00:18 +0000)] 
Daily bump.

9 months agoDaily bump.
GCC Administrator [Tue, 4 Jul 2023 00:19:16 +0000 (00:19 +0000)] 
Daily bump.

9 months agoDaily bump.
GCC Administrator [Mon, 3 Jul 2023 00:19:15 +0000 (00:19 +0000)] 
Daily bump.

9 months agoDaily bump.
GCC Administrator [Sun, 2 Jul 2023 00:17:55 +0000 (00:17 +0000)] 
Daily bump.

9 months agod: Fix ICE in setValue, at d/dmd/dinterpret.c:7013
Iain Buclaw [Sat, 1 Jul 2023 13:04:25 +0000 (15:04 +0200)] 
d: Fix ICE in setValue, at d/dmd/dinterpret.c:7013

Backports ICE fix from upstream.  When casting null to integer or real,
instead of painting the type on the NullExp, we emplace an
IntegerExp/RealExp with the value zero.  Same as when casting from
NullExp to bool.

Reviewed-on: https://github.com/dlang/dmd/pull/13172

PR d/110511

gcc/d/ChangeLog:

* dmd/dinterpret.c (Interpreter::visit (CastExp *)): Handle casting
null to int or float.

gcc/testsuite/ChangeLog:

* gdc.test/compilable/test21794.d: New test.

(cherry picked from commit 066385c918485d4cef5c243d3b0691193df382de)

10 months agoDaily bump.
GCC Administrator [Sat, 1 Jul 2023 00:20:12 +0000 (00:20 +0000)] 
Daily bump.

10 months agoc++: bogus warning with value init of const pmf [PR92752]
Patrick Palka [Fri, 28 Jan 2022 20:41:15 +0000 (15:41 -0500)] 
c++: bogus warning with value init of const pmf [PR92752]

Here we're emitting a -Wignored-qualifiers warning for an intermediate
compiler-generated cast of nullptr to 'method-type* const' as part of
value initialization of a const pmf.  This patch suppresses the warning
by instead casting to the corresponding unqualified type.

PR c++/92752

gcc/cp/ChangeLog:

* typeck.c (build_ptrmemfunc): Cast a nullptr constant to the
unqualified pointer type not the qualified one.

gcc/testsuite/ChangeLog:

* g++.dg/warn/Wignored-qualifiers2.C: New test.

Co-authored-by: Jason Merrill <jason@redhat.com>
(cherry picked from commit e971990cbda091b4caf5e1a5bded5121068934e4)

10 months agoc++: Fix reference NTTP binding to noexcept fn [PR97420]
Patrick Palka [Wed, 26 May 2021 12:35:31 +0000 (08:35 -0400)] 
c++: Fix reference NTTP binding to noexcept fn [PR97420]

Here, in C++17 mode, convert_nontype_argument_function is rejecting
binding a non-noexcept function reference template parameter to a
noexcept function (encoded as the template argument '*(int (&) (int)) &f').

The first roadblock to making this work is that the argument is wrapped
an an implicit INDIRECT_REF, so we need to unwrap it before calling
strip_fnptr_conv.

The second roadblock is that the NOP_EXPR cast converts from a function
pointer type to a reference type while simultaneously removing the
noexcept qualification, and fnptr_conv_p doesn't consider this cast to
be a function pointer conversion.  This patch fixes this by making
fnptr_conv_p treat REFERENCE_TYPEs and POINTER_TYPEs interchangeably.

Finally, in passing, this patch also simplifies noexcept_conv_p by
removing a bunch of redundant checks already performed by its only
caller fnptr_conv_p.

PR c++/97420

gcc/cp/ChangeLog:

* cvt.c (noexcept_conv_p): Remove redundant checks and simplify.
(fnptr_conv_p): Don't call non_reference.  Use INDIRECT_TYPE_P
instead of TYPE_PTR_P.
* pt.c (convert_nontype_argument_function): Look through
implicit INDIRECT_REFs before calling strip_fnptr_conv.

gcc/testsuite/ChangeLog:

* g++.dg/cpp0x/noexcept68.C: New test.

(cherry picked from commit b4329e3dd6fb7c78948fcf9d2f5b9d873deec284)

10 months agoDaily bump.
GCC Administrator [Fri, 30 Jun 2023 00:19:01 +0000 (00:19 +0000)] 
Daily bump.

10 months agogo: Update usage of TARGET_AIX to TARGET_AIX_OS
Paul E. Murphy [Thu, 22 Jun 2023 22:53:46 +0000 (17:53 -0500)] 
go: Update usage of TARGET_AIX to TARGET_AIX_OS

TARGET_AIX is defined to a non-zero value on linux and maybe other
powerpc64le targets.  This leads to unexpected behavior such as
dropping the .go_export section when linking a shared library
on linux/powerpc64le.

Instead, use TARGET_AIX_OS to toggle AIX specific behavior.

Fixes golang/go#60798.

2023-06-22  Paul E. Murphy  <murphyp@linux.ibm.com>

gcc/go/
* go-backend.c [TARGET_AIX]: Rename and update usage to TARGET_AIX_OS.
* go-lang.c: Likewise.

(cherry picked from commit b76cd1ec361712e1ac9ca5e0246da24ea2b78916)

10 months agoDaily bump.
GCC Administrator [Thu, 29 Jun 2023 00:18:54 +0000 (00:18 +0000)] 
Daily bump.

10 months agoMake option mvzeroupper independent of optimization level.
liuhongt [Mon, 26 Jun 2023 01:50:25 +0000 (09:50 +0800)] 
Make option mvzeroupper independent of optimization level.

pass_insert_vzeroupper is under condition

TARGET_AVX && TARGET_VZEROUPPER
&& flag_expensive_optimizations && !optimize_size

But the document of mvzeroupper doesn't mention the insertion
required -O2 and above, it may confuse users when they explicitly
use -Os -mvzeroupper.

------------
mvzeroupper
Target Mask(VZEROUPPER) Save
Generate vzeroupper instruction before a transfer of control flow out of
the function.
------------

The patch moves flag_expensive_optimizations && !optimize_size to
ix86_option_override_internal. It makes -mvzeroupper independent of
optimization level, but still keeps the behavior of architecture
tuning(emit_vzeroupper) unchanged.

gcc/ChangeLog:

* config/i386/i386-features.c (pass_insert_vzeroupper:gate):
Move flag_expensive_optimizations && !optimize_size to ..
* config/i386/i386-options.c (ix86_option_override_internal):
.. this, it makes -mvzeroupper independent of optimization
level, but still keeps the behavior of architecture
tuning(emit_vzeroupper) unchanged.
(rest_of_handle_insert_vzeroupper): Remove
flag_expensive_optimizations && !optimize_size.

gcc/testsuite/ChangeLog:

* gcc.target/i386/avx-vzeroupper-29.c: New testcase.

10 months agoDaily bump.
GCC Administrator [Wed, 28 Jun 2023 00:19:38 +0000 (00:19 +0000)] 
Daily bump.

10 months agoDaily bump.
GCC Administrator [Tue, 27 Jun 2023 00:19:53 +0000 (00:19 +0000)] 
Daily bump.

10 months agod: Suboptimal codegen for __builtin_expect(cond, false)
Iain Buclaw [Mon, 26 Jun 2023 01:24:27 +0000 (03:24 +0200)] 
d: Suboptimal codegen for __builtin_expect(cond, false)

Since PR96435, both boolean objects and expressions have been evaluated
in the following way.

    (*(ubyte*)&obj_or_expr) & 1

It has been noted that sometimes this can cause the back-end to optimize
in non-obvious ways - in particular with __builtin_expect.

This @safe feature is now restricted to just when reading the value of a
bool field that comes from a union.

PR d/110359

gcc/d/ChangeLog:

* d-convert.cc (convert_for_rvalue): Only apply the @safe boolean
conversion to boolean fields of a union.
(convert_for_condition): Call convert_for_rvalue in the default case.

gcc/testsuite/ChangeLog:

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

(cherry picked from commit ab98db1e8c1b997414539f41b7fb814019497d8d)

10 months agoDaily bump.
GCC Administrator [Mon, 26 Jun 2023 00:18:28 +0000 (00:18 +0000)] 
Daily bump.

10 months agoDaily bump.
GCC Administrator [Sun, 25 Jun 2023 00:17:58 +0000 (00:17 +0000)] 
Daily bump.

10 months agoDaily bump.
GCC Administrator [Sat, 24 Jun 2023 00:18:21 +0000 (00:18 +0000)] 
Daily bump.

10 months agolibstdc++: Fix std::numeric_limits::lowest() test for strict modes
Jonathan Wakely [Mon, 11 Oct 2021 12:28:32 +0000 (13:28 +0100)] 
libstdc++: Fix std::numeric_limits::lowest() test for strict modes

This test uses std::is_integral to decide whether we are testing an
integral or floating-point type. But that fails for __int128 because
is_integral<__int128> is false in strict modes. By using
numeric_limits::is_integer instead we get the right answer for all types
that have a numeric_limits specialization.

We can also simplify the test by removing the unnecessary tag
dispatching.

libstdc++-v3/ChangeLog:

* testsuite/18_support/numeric_limits/lowest.cc: Use
numeric_limits<T>::is_integer instead of is_integral<T>::value.

(cherry picked from commit 45ba5426c129993704a73e6ace4016eaa950d7ee)

10 months agolibstdc++: Document removal of implicit allocator rebinding extensions
Jonathan Wakely [Mon, 15 May 2023 20:41:56 +0000 (21:41 +0100)] 
libstdc++: Document removal of implicit allocator rebinding extensions

Traditionally libstdc++ allowed containers to be
instantiated with allocator's that have the wrong value type, implicitly
rebinding the allocator to the container's value type. Since C++20 that
has been explicitly ill-formed, so the extension is no longer supported
in strict modes (e.g. -std=c++17) and in C++20 and later.

libstdc++-v3/ChangeLog:

* doc/xml/manual/evolution.xml: Document removal of implicit
allocator rebinding extensions in strict mode and for C++20.
* doc/html/*: Regenerate.

(cherry picked from commit 8cbaf679a3c1875c5475bd1cb0fb86fb9d03b2d4)

10 months agolibstdc++: Fix self-move for std::weak_ptr [PR108118]
Jonathan Wakely [Thu, 15 Dec 2022 09:52:48 +0000 (09:52 +0000)] 
libstdc++: Fix self-move for std::weak_ptr [PR108118]

I think an alternative fix would be something like:

  _M_ptr = std::exchange(rhs._M_ptr, nullptr);
  _M_refcount = std::move(rhs._M_refcount);

The standard's move-and-swap implementation generates smaller code at
all levels except -O0 and -Og, so it seems simplest to just do what the
standard says.

libstdc++-v3/ChangeLog:

PR libstdc++/108118
* include/bits/shared_ptr_base.h (weak_ptr::operator=):
Implement as move-and-swap exactly as specified in the standard.
* testsuite/20_util/weak_ptr/cons/self_move.cc: New test.

(cherry picked from commit 92eb0adc14a5f84acce7e5bc780b81b1544b24aa)

10 months agolibstdc++: Avoid stack overflow in std::vector (PR 94540)
Jonathan Wakely [Wed, 17 Jun 2020 21:49:06 +0000 (22:49 +0100)] 
libstdc++: Avoid stack overflow in std::vector (PR 94540)

The std::__uninitialized_default_n algorithm used by std::vector creates
an initial object as a local variable then copies that into the
destination range. If the object is too large for the stack this
crashes. We should create the first object directly into the
destination and then copy it from there.

This doesn't fix the bug for C++98, because in that case the initial
value is created as a default argument of the vector constructor i.e. in
the user's code, not inside libstdc++. We can't prevent that.

PR libstdc++/94540
* include/bits/stl_uninitialized.h (__uninitialized_default_1<true>):
Construct the first value at *__first instead of on the stack.
(__uninitialized_default_n_1<true>): Likewise.
Improve comments on several of the non-standard algorithms.
* testsuite/20_util/specialized_algorithms/uninitialized_default/94540.cc:
New test.
* testsuite/20_util/specialized_algorithms/uninitialized_default_n/94540.cc:
New test.
* testsuite/20_util/specialized_algorithms/uninitialized_value_construct/94540.cc:
New test.
* testsuite/20_util/specialized_algorithms/uninitialized_value_construct_n/94540.cc:
New test.
* testsuite/23_containers/vector/cons/94540.cc: New test.

(cherry picked from commit 632183ddcc8f3aead8b4fc63c4ab59a42ef9ad00)

10 months agolibstdc++: Check for overflow in regex back-reference [PR106607]
Jonathan Wakely [Mon, 22 Aug 2022 14:16:16 +0000 (15:16 +0100)] 
libstdc++: Check for overflow in regex back-reference [PR106607]

Currently we fail to notice integer overflow when parsing a
back-reference expression, or when converting the parsed result from
long to int. This changes the result to be int, so no conversion is
needed, and uses the overflow-checking built-ins to detect an
out-of-range back-reference.

libstdc++-v3/ChangeLog:

PR libstdc++/106607
* include/bits/regex_compiler.tcc (_Compiler::_M_cur_int_value):
Use built-ins to check for integer overflow in back-reference
number.
* testsuite/28_regex/basic_regex/106607.cc: New test.

(cherry picked from commit 1b09eea33f2bf9d1eae73b25cc25efb05ea1dc3f)

10 months agolibstdc++: Add noexcept to functions in <regex>
Jonathan Wakely [Mon, 27 Sep 2021 19:42:17 +0000 (20:42 +0100)] 
libstdc++: Add noexcept to functions in <regex>

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/ChangeLog:

* include/bits/regex.h (basic_regex, swap): Add noexcept to
non-throwing functions.
* include/bits/regex_automaton.h (_State_base, _State)
(_NFA_base): Likewise.
* include/bits/regex_compiler.h (_Compiler): Likewise.
* include/bits/regex_error.h (regex_error::code()): Likewise.
* include/bits/regex_scanner.h (_Scanner): Likewise.

(cherry picked from commit df0dd04b78cfc0f723387b703978600caac93cbb)

10 months agolibstdc++: Fix handling of invalid ranges in std::regex [PR102447]
Jonathan Wakely [Tue, 14 Dec 2021 14:32:35 +0000 (14:32 +0000)] 
libstdc++: Fix handling of invalid ranges in std::regex [PR102447]

std::regex currently allows invalid bracket ranges such as [\w-a] which
are only allowed by ECMAScript when in web browser compatibility mode.
It should be an error, because the start of the range is a character
class, not a single character. The current implementation of
_Compiler::_M_expression_term does not provide a way to reject this,
because we only remember a previous character, not whether we just
processed a character class (or collating symbol etc.)

This patch replaces the pair<bool, CharT> used to emulate
optional<CharT> with a custom class closer to pair<tribool,CharT>. That
allows us to track three states, so that we can tell when we've just
seen a character class.

With this additional state the code in _M_expression_term for processing
the _S_token_bracket_dash can be improved to correctly reject the [\w-a]
case, without regressing for valid cases such as [\w-] and [----].

libstdc++-v3/ChangeLog:

PR libstdc++/102447
* include/bits/regex_compiler.h (_Compiler::_BracketState): New
class.
(_Compiler::_BrackeyMatcher): New alias template.
(_Compiler::_M_expression_term): Change pair<bool, CharT>
parameter to _BracketState. Process first character for
ECMAScript syntax as well as POSIX.
* include/bits/regex_compiler.tcc
(_Compiler::_M_insert_bracket_matcher): Pass _BracketState.
(_Compiler::_M_expression_term): Use _BracketState to store
state between calls. Improve handling of dashes in ranges.
* testsuite/28_regex/algorithms/regex_match/cstring_bracket_01.cc:
Add more tests for ranges containing dashes. Check invalid
ranges with character class at the beginning.

(cherry picked from commit 7ce3c230edf6e498e125c805a6dd313bf87dc439)

10 months agolibstdc++: Check for invalid syntax_option_type values in <regex>
Jonathan Wakely [Wed, 29 Sep 2021 12:48:15 +0000 (13:48 +0100)] 
libstdc++: Check for invalid syntax_option_type values in <regex>

The standard says that it is invalid for more than one grammar element
to be set in a value of type regex_constants::syntax_option_type. This
adds a check in the regex compiler andthrows an exception if an invalid
value is used.

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/ChangeLog:

* include/bits/regex_compiler.h (_Compiler::_S_validate): New
function.
* include/bits/regex_compiler.tcc (_Compiler::_Compiler): Use
_S_validate to check flags.
* include/bits/regex_error.h (_S_grammar): New error code for
internal use.
* testsuite/28_regex/basic_regex/ctors/grammar.cc: New test.

(cherry picked from commit 9ca4c42a3b756e54a92ff8e1ac6c396b680b7839)

10 months agolibstdc++: Tweaks to <regex> to avoid warnings
Jonathan Wakely [Mon, 27 Sep 2021 19:44:24 +0000 (20:44 +0100)] 
libstdc++: Tweaks to <regex> to avoid warnings

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/ChangeLog:

* include/bits/regex_compiler.tcc: Add line break in empty while
statement.
* include/bits/regex_executor.tcc: Avoid unused parameter
warning.

(cherry picked from commit b5f276b8c76d892f7fed229153cfbadc13f4696e)

10 months agolibstdc++: Fix std::regex_replace for strings with embedded null [PR103664]
Jonathan Wakely [Sun, 12 Dec 2021 21:15:17 +0000 (21:15 +0000)] 
libstdc++: Fix std::regex_replace for strings with embedded null [PR103664]

The overload of std::regex_replace that takes a std::basic_string as the
fmt argument (for the replacement string) is implemented in terms of the
one taking a const C*, which uses std::char_traits to find the length.
That means it stops at a null character, even though the basic_string
might have additional characters beyond that.

Rather than duplicate the implementation of the const C* one for the
std::basic_string case, this moves that implementation to a new
__regex_replace function which takes a const C* and a length. Then both
the std::basic_string and const C* overloads can call that (with the
latter using char_traits to find the length to pass to the new
function).

libstdc++-v3/ChangeLog:

PR libstdc++/103664
* include/bits/regex.h (__regex_replace): Declare.
(regex_replace): Use it.
* include/bits/regex.tcc (__regex_replace): Replace regex_replace
definition with __regex_replace.
* testsuite/28_regex/algorithms/regex_replace/char/103664.cc: New test.

(cherry picked from commit ef5d671cd80a4afa4f74c3dfe2904c63f51fcfde)

10 months agolibstdc++: std::basic_regex should treat '\0' as an ordinary char [PR84110]
Jonathan Wakely [Wed, 29 Sep 2021 12:48:11 +0000 (13:48 +0100)] 
libstdc++: std::basic_regex should treat '\0' as an ordinary char [PR84110]

When the input sequence contains a _CharT(0) character, the strchr call
in _Scanner<_CharT>::_M_scan_normal() will search for '\0' and so return
a pointer to the terminating null at the end of the string. This makes
the scanner think it's found a special character. Because it doesn't
match any of the actual special characters, we fall off the end of the
function (or assert in debug mode).

We should check for a null character explicitly and either treat it as
an ordinary character (for the ECMAScript grammar) or an error (for all
others). I'm not 100% sure that's right, but it seems consistent with
the POSIX RE rules where a '\0' means the end of the regex pattern or
the end of the sequence being matched.

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/ChangeLog:

PR libstdc++/84110
* include/bits/regex_error.h (regex_constants::_S_null): New
error code for internal use.
* include/bits/regex_scanner.tcc (_Scanner::_M_scan_normal()):
Check for null character.
* testsuite/28_regex/basic_regex/84110.cc: New test.

(cherry picked from commit b701e1f8f6870c0f8cb4050674da489101dd05a5)

10 months agolibstdc++: Fix build error in <bits/regex_error.h>
Jonathan Wakely [Fri, 11 Sep 2020 13:51:36 +0000 (14:51 +0100)] 
libstdc++: Fix build error in <bits/regex_error.h>

libstdc++-v3/ChangeLog:

* include/bits/regex_error.h (__throw_regex_error): Fix
parameter declaration and use reserved attribute names.

(cherry picked from commit 29216f56d002982f10c33056f4b3d7f07e164122)

10 months agolibstdc++: include/bits/regex_error.h: Avoid warning with -fno-exceptions.
Christophe Lyon [Fri, 11 Sep 2020 11:53:15 +0000 (11:53 +0000)] 
libstdc++: include/bits/regex_error.h: Avoid warning with -fno-exceptions.

When building with -fno-exceptions, __GLIBCXX_THROW_OR_ABORT expands to
abort(), causing warnings:
unused parameter '__ecode'
unused parameter '__what'

This patch adds __attribute__((unused)) to avoid them.

2020-09-11  Torbjörn SVENSSON <torbjorn.svensson@st.com>
    Christophe Lyon  <christophe.lyon@linaro.org>

libstdc++-v3/
* include/bits/regex_error.h: Avoid warning with -fno-exceptions.

(cherry picked from commit b32d2ea8c29203519fbd9c5e90b06941e7cd75f3)

10 months agoDaily bump.
GCC Administrator [Fri, 23 Jun 2023 00:18:33 +0000 (00:18 +0000)] 
Daily bump.

10 months agoDaily bump.
GCC Administrator [Thu, 22 Jun 2023 00:18:13 +0000 (00:18 +0000)] 
Daily bump.

10 months agoDaily bump.
GCC Administrator [Wed, 21 Jun 2023 00:18:36 +0000 (00:18 +0000)] 
Daily bump.

10 months agors6000: Guard __builtin_{un,}pack_vector_int128 with vsx [PR109932]
Kewen Lin [Tue, 20 Jun 2023 06:40:52 +0000 (01:40 -0500)] 
rs6000: Guard __builtin_{un,}pack_vector_int128 with vsx [PR109932]

As PR109932 shows, builtins __builtin_{un,}pack_vector_int128
should be guarded under vsx rather than power7, as their
corresponding bif patterns have the conditions TARGET_VSX
and VECTOR_MEM_ALTIVEC_OR_VSX_P (V1TImode).  This patch is to
ensure __builtin_{un,}pack_vector_int128 only available under
vsx.

PR target/109932

gcc/ChangeLog:

* config/rs6000/rs6000-builtin.def (BU_VSX_MISC_2): New macro.
({un,}pack_vector_int128): Use BU_VSX_MISC_2 instead of
BU_P7_MISC_2.

gcc/testsuite/ChangeLog:

* gcc.target/powerpc/pr109932-1.c: New test.
* gcc.target/powerpc/pr109932-2.c: New test.

(cherry picked from commit db291447877aae67979ce3655fcc6fc877f57c6a)

10 months agoDaily bump.
GCC Administrator [Tue, 20 Jun 2023 00:19:12 +0000 (00:19 +0000)] 
Daily bump.

10 months agors6000: Don't use TFmode for 128 bits fp constant in toc [PR110011]
Kewen Lin [Mon, 12 Jun 2023 06:07:52 +0000 (01:07 -0500)] 
rs6000: Don't use TFmode for 128 bits fp constant in toc [PR110011]

As PR110011 shows, when encoding 128 bits fp constant into
toc, we adopts REAL_VALUE_TO_TARGET_LONG_DOUBLE which is
to find the first float mode with LONG_DOUBLE_TYPE_SIZE
bits of precision, it would be TFmode here.  But the 128
bits fp constant can be with mode IFmode or KFmode, which
doesn't necessarily have the same underlying float format
as the one of TFmode, like this PR exposes, with option
-mabi=ibmlongdouble TFmode has ibm_extended_format while
KFmode has ieee_quad_format, mixing up the formats (the
encoding/decoding ways) would cause unexpected results.

This patch is to make it use constant's own mode instead
of TFmode for real_to_target call.

PR target/110011

gcc/ChangeLog:

* config/rs6000/rs6000.c (output_toc): Use the mode of the 128-bit
floating constant itself for real_to_target call.

gcc/testsuite/ChangeLog:

* gcc.target/powerpc/pr110011.c: New test.

(cherry picked from commit 388809f2afde874180da0669c669e241037eeba0)

10 months agoDaily bump.
GCC Administrator [Mon, 19 Jun 2023 00:18:39 +0000 (00:18 +0000)] 
Daily bump.

10 months agoDaily bump.
GCC Administrator [Sun, 18 Jun 2023 00:18:30 +0000 (00:18 +0000)] 
Daily bump.

10 months agoDaily bump.
GCC Administrator [Sat, 17 Jun 2023 00:18:49 +0000 (00:18 +0000)] 
Daily bump.

10 months agoDaily bump.
GCC Administrator [Fri, 16 Jun 2023 00:18:50 +0000 (00:18 +0000)] 
Daily bump.

10 months agoDaily bump.
GCC Administrator [Thu, 15 Jun 2023 00:18:34 +0000 (00:18 +0000)] 
Daily bump.

10 months agoDaily bump.
GCC Administrator [Wed, 14 Jun 2023 00:18:55 +0000 (00:18 +0000)] 
Daily bump.

10 months agoDaily bump.
GCC Administrator [Tue, 13 Jun 2023 00:19:21 +0000 (00:19 +0000)] 
Daily bump.

10 months agoDaily bump.
GCC Administrator [Mon, 12 Jun 2023 00:18:44 +0000 (00:18 +0000)] 
Daily bump.

10 months agoDaily bump.
GCC Administrator [Sun, 11 Jun 2023 00:19:02 +0000 (00:19 +0000)] 
Daily bump.

10 months agoDaily bump.
GCC Administrator [Sat, 10 Jun 2023 00:19:06 +0000 (00:19 +0000)] 
Daily bump.

10 months agoDarwin, PPC: Fix struct layout with pragma pack [PR110044].
Iain Sandoe [Thu, 1 Jun 2023 12:43:35 +0000 (13:43 +0100)] 
Darwin, PPC: Fix struct layout with pragma pack [PR110044].

This bug was essentially that darwin_rs6000_special_round_type_align()
was ignoring externally-imposed capping of field alignment.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
PR target/110044

gcc/ChangeLog:

* config/rs6000/rs6000.c (darwin_rs6000_special_round_type_align):
Make sure that we do not have a cap on field alignment before altering
the struct layout based on the type alignment of the first entry.

gcc/testsuite/ChangeLog:

* gcc.target/powerpc/darwin-abi-13-0.c: New test.
* gcc.target/powerpc/darwin-abi-13-1.c: New test.
* gcc.target/powerpc/darwin-abi-13-2.c: New test.
* gcc.target/powerpc/darwin-structs-0.h: New test.

(cherry picked from commit 84d080a29a780973bef47171ba708ae2f7b4ee47)

10 months agofortran: Fix ICE on pr96024.f90 on big-endian hosts [PR96024]
Jakub Jelinek [Fri, 9 Jun 2023 07:10:29 +0000 (09:10 +0200)] 
fortran: Fix ICE on pr96024.f90 on big-endian hosts [PR96024]

The pr96024.f90 testcase ICEs on big-endian hosts.  The problem is
that length->val.integer is accessed after checking
length->expr_type == EXPR_CONSTANT, but it is a CHARACTER constant
which uses length->val.character union member instead and on big-endian
we end up reading constant 0x100000000 rather than some small number
on little-endian and if target doesn't have enough memory for 4 times
that (i.e. 16GB allocation), it ICEs.

2023-06-09  Jakub Jelinek  <jakub@redhat.com>

PR fortran/96024
* primary.c (gfc_convert_to_structure_constructor): Only do
constant string ctor length verification and truncation/padding
if constant length has INTEGER type.

(cherry picked from commit 4cf6e322adc19f927859e0a5edfa93cec4b8c844)

10 months agoDaily bump.
GCC Administrator [Fri, 9 Jun 2023 00:18:24 +0000 (00:18 +0000)] 
Daily bump.

10 months agoDaily bump.
GCC Administrator [Thu, 8 Jun 2023 00:19:06 +0000 (00:19 +0000)] 
Daily bump.

10 months agoDaily bump.
GCC Administrator [Wed, 7 Jun 2023 00:19:31 +0000 (00:19 +0000)] 
Daily bump.

10 months agoDaily bump.
GCC Administrator [Tue, 6 Jun 2023 00:19:22 +0000 (00:19 +0000)] 
Daily bump.

10 months agoDaily bump.
GCC Administrator [Mon, 5 Jun 2023 00:18:20 +0000 (00:18 +0000)] 
Daily bump.

10 months agoDaily bump.
GCC Administrator [Sun, 4 Jun 2023 00:18:17 +0000 (00:18 +0000)] 
Daily bump.

10 months agoDaily bump.
GCC Administrator [Sat, 3 Jun 2023 00:18:46 +0000 (00:18 +0000)] 
Daily bump.

10 months agoDaily bump.
GCC Administrator [Fri, 2 Jun 2023 00:19:11 +0000 (00:19 +0000)] 
Daily bump.

10 months agodoc: Fix description of x86 -m32 option [PR109954]
Jonathan Wakely [Thu, 1 Jun 2023 10:30:10 +0000 (11:30 +0100)] 
doc: Fix description of x86 -m32 option [PR109954]

This option does not imply -march=i386 so it's incorrect to say it
generates code that will run on "any i386 system".

gcc/ChangeLog:

PR target/109954
* doc/invoke.texi (x86 Options): Fix description of -m32 option.

(cherry picked from commit eeb92704967875411416b0b9508aa6f49e8192fd)

10 months agoDaily bump.
GCC Administrator [Thu, 1 Jun 2023 00:18:28 +0000 (00:18 +0000)] 
Daily bump.

11 months agoDaily bump.
GCC Administrator [Wed, 31 May 2023 00:18:39 +0000 (00:18 +0000)] 
Daily bump.

11 months agoDaily bump.
GCC Administrator [Tue, 30 May 2023 00:17:56 +0000 (00:17 +0000)] 
Daily bump.

11 months agoDaily bump.
GCC Administrator [Mon, 29 May 2023 11:16:15 +0000 (11:16 +0000)] 
Daily bump.

11 months agoDaily bump.
GCC Administrator [Sun, 28 May 2023 00:17:54 +0000 (00:17 +0000)] 
Daily bump.

11 months agoDaily bump.
GCC Administrator [Sat, 27 May 2023 00:17:51 +0000 (00:17 +0000)] 
Daily bump.

11 months agoDaily bump.
GCC Administrator [Fri, 26 May 2023 00:18:23 +0000 (00:18 +0000)] 
Daily bump.

11 months agoDaily bump.
GCC Administrator [Thu, 25 May 2023 00:18:35 +0000 (00:18 +0000)] 
Daily bump.

11 months agoDaily bump.
GCC Administrator [Wed, 24 May 2023 00:19:12 +0000 (00:19 +0000)] 
Daily bump.

11 months agoDaily bump.
GCC Administrator [Tue, 23 May 2023 00:18:12 +0000 (00:18 +0000)] 
Daily bump.

11 months agoDo not generate vmaddfp and vnmsubfp
Michael Meissner [Mon, 22 May 2023 15:26:08 +0000 (11:26 -0400)] 
Do not generate vmaddfp and vnmsubfp

This is version 3 of the patch.  This is essentially version 1 with the removal
of changes to altivec.md, and cleanup of the comments.

Version 2 generated the vmaddfp and vnmsubfp instructions if -Ofast was used,
and those changes are deleted in this patch.

The Altivec instructions vmaddfp and vnmsubfp have different rounding behaviors
than the VSX xvmaddsp and xvnmsubsp instructions.  In particular, generating
these instructions seems to break Eigen on big endian systems.

I have done bootstrap builds on power9 little endian (with both IEEE long
double and IBM long double).  I have also done the builds and test on a power8
big endian system (testing both 32-bit and 64-bit code generation).  Chip has
verified that it fixes the problem that Eigen encountered.  Can I check this
into the master GCC branch?  After a burn-in period, can I check this patch
into the active GCC branches?

Thanks in advance.

2023-05-22   Michael Meissner  <meissner@linux.ibm.com>

gcc/

PR target/70243
* config/rs6000/vsx.md (vsx_fmav4sf4): Do not generate vmaddfp.  Back
port from master 04/10/2023.
(vsx_nfmsv4sf4): Do not generate vnmsubfp.

gcc/testsuite/

PR target/70243
* gcc.target/powerpc/pr70243.c: New test.  Back port from master
04/10/2023.

11 months agoDaily bump.
GCC Administrator [Mon, 22 May 2023 00:18:45 +0000 (00:18 +0000)] 
Daily bump.

11 months agolibstdc++: Rename __null_terminated to avoid a collision with system headers.
Iain Sandoe [Sun, 21 May 2023 09:45:25 +0000 (10:45 +0100)] 
libstdc++: Rename __null_terminated to avoid a collision with system headers.

r13-1073-g254e88b3d7e8ab made this change for experimental/bits/fs-path.h.
The change is needed on the 10.x branch for bits/fs-path.h (it is not required
on later branches since this header was reworked).

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
libstdc++-v3/ChangeLog:

* include/bits/fs_path.h: Rename __null_terminated to __nul_terminated
to avoid colliding with a macro in Darwin system headers.

11 months agolibsanitizer, darwin: Unsupport Darwin >= 22 for now.
Iain Sandoe [Mon, 17 Apr 2023 09:23:16 +0000 (10:23 +0100)] 
libsanitizer, darwin: Unsupport Darwin >= 22 for now.

The mechanism for location dyld has altered from Darwin22 since dyld is now
in the shared cache.  The implemented mechanism for walking the cache uses
Apple Blocks which GCC does not yet support, and the fallback to the original
mechanism does not work there.

Until a suitable work-around can be found, unsupport Darwin22+.

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

* configure.tgt: Unsupport Darwin22+ until a mechanism can be found
to locate dyld in the shared cache.

(cherry picked from commit e722a1f42b28092c9f709a3f758fc4fe57db32b0)

11 months agoDarwin, libgcc : Adjust min version supported for the OS.
Iain Sandoe [Thu, 11 May 2023 22:24:02 +0000 (23:24 +0100)] 
Darwin, libgcc : Adjust min version supported for the OS.

Tools from later versions of the OS deprecate or fail to support
earlier OS revisions.

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

* config.host: Arrange to set min Darwin OS versions from
the configured host version.
* config/darwin10-unwind-find-enc-func.c: Do not use current
headers, but declare the nexessary structures locally to the
versions in use for Mac OSX 10.6.
* config/t-darwin: Amend to handle configured min OS
versions.
* config/t-darwin-min-1: New.
* config/t-darwin-min-5: New.
* config/t-darwin-min-8: New.

(cherry picked from commit 20b8779ea9bd82b26eeb195b30f695168cd7ae1d)

11 months agoDarwin, crts: Fix a build warning.
Iain Sandoe [Mon, 1 Nov 2021 16:58:20 +0000 (16:58 +0000)] 
Darwin, crts: Fix a build warning.

We have a shim crt for Darwin10 that implements functionality
missing in libSystem. Provide this with a prototype to silence the
warning about this.

libgcc/ChangeLog:

* config/darwin10-unwind-find-enc-func.c: Include libgcc_tm.h.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
(cherry picked from commit 7a300b413a62e1989bd89064fd5594aabe371d3a)

11 months agoDarwin, fixincludes: Handle Apple Blocks in objc/runtime.h.
Iain Sandoe [Wed, 18 Jan 2023 23:25:36 +0000 (23:25 +0000)] 
Darwin, fixincludes: Handle Apple Blocks in objc/runtime.h.

The macOS 13 SDK has unguarded Apple Blocks use in objc/runtime.h which
causes most of the objective-c tests to fail.

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

* fixincl.x: Regenerate.
* inclhack.def (darwin_objc_runtime_1): New hack.
* tests/base/objc/runtime.h: New file.

(cherry picked from commit 046dc9d0d4683bab99d28983d8841ba3c56ef744)

11 months agoDarwin, fixincludes: Handle MacOS13 SDK Apple-specific deprecations [PR107568].
Iain Sandoe [Wed, 18 Jan 2023 19:58:33 +0000 (19:58 +0000)] 
Darwin, fixincludes: Handle MacOS13 SDK Apple-specific deprecations [PR107568].

The SDK for MacOS13 includes Apple-specific deprecations of some functions that
are not deprecated in Posix, C or C++ and widely used in GCC.

The fix makes the deprecation conditional on __APPLE_LOCAL_DEPRECATIONS so that
end users may still observe them but they are hidden from normal compilations.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
PR target/107568

fixincludes/ChangeLog:

* fixincl.x: Regenerate.
* inclhack.def: Add a fix for MacOS13 SDK function deprecations
in stdio.h.
* tests/base/stdio.h (__deprecated_msg): New test.

(cherry picked from commit 442d2bdc1d2a98aba0b18aeaa3e87fa946ac8031)

11 months agolibgcc, Darwin: No early install for the compatibility libgcc_s.1.dylib.
Iain Sandoe [Thu, 22 Dec 2022 17:32:06 +0000 (17:32 +0000)] 
libgcc, Darwin: No early install for the compatibility libgcc_s.1.dylib.

On Darwin, GCC now uses a libgcc_s.1.1 for builtins and forwards the system
unwinder.  We do, however, build a backwards compatibility libgcc_s.1.dylib.
However, this is not needed by GCC and can cause incorrect operation when
DYLD_LIBRARY_PATH is in use.

Since we do not need or use it during the build, the solution is to skip the
installation into the $build/gcc directory.

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

* config/t-slibgcc-darwin (install-darwin-libgcc-stubs): Skip the
install of libgcc_s.1.dylib when the installation is into the build
gcc directory.

(cherry picked from commit 163f0f2267370575a9950e7e30a2c9cd72f559f0)

11 months agoDarwin: Update rules for handling alignment of globals.
Iain Sandoe [Mon, 20 Dec 2021 15:19:50 +0000 (15:19 +0000)] 
Darwin: Update rules for handling alignment of globals.

The current rule was too strict and has not been required since Darwin11.

This relaxes the constraint to allow up to 2^28 alignment for non-common
entities.  Common is still restricted to a maximum aligment of 2^15.

When the host is an older version of Darwin ( earlier that 11 ) then the
existing constraint is still applied.  Note that this is a host constraint
not a target one (so that a compilation on 10.7 targeting 10.6 is allowed
to use a greater alignment than the tools on 10.6 support).  This matches
the behaviour of clang.

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

* config.gcc: Emit L2_MAX_OFILE_ALIGNMENT with suitable
values for the host.
* config/darwin.c (darwin_emit_common): Error for alignment
values > 32768.
* config/darwin.h (MAX_OFILE_ALIGNMENT): Rework to use the
configured L2_MAX_OFILE_ALIGNMENT.

gcc/testsuite/ChangeLog:

* gcc.dg/darwin-aligned-globals.c: New test.
* gcc.dg/darwin-comm-1.c: New test.
* gcc.dg/attr-aligned.c: Amend for new alignment values on
Darwin.
* gcc.target/i386/pr89261.c: Likewise.

(cherry picked from commit 19bf83a9a068f2d5293b63c9300f99172b2d278d)

11 months agoDaily bump.
GCC Administrator [Sun, 21 May 2023 00:18:18 +0000 (00:18 +0000)] 
Daily bump.

11 months agoDaily bump.
GCC Administrator [Sat, 20 May 2023 00:18:17 +0000 (00:18 +0000)] 
Daily bump.

11 months agoDaily bump.
GCC Administrator [Fri, 19 May 2023 00:19:17 +0000 (00:19 +0000)] 
Daily bump.

11 months agoDaily bump.
GCC Administrator [Thu, 18 May 2023 00:18:13 +0000 (00:18 +0000)] 
Daily bump.

11 months agoDaily bump.
GCC Administrator [Wed, 17 May 2023 00:18:39 +0000 (00:18 +0000)] 
Daily bump.

11 months agoDaily bump.
GCC Administrator [Tue, 16 May 2023 00:19:08 +0000 (00:19 +0000)] 
Daily bump.

11 months agoDaily bump.
GCC Administrator [Mon, 15 May 2023 00:19:04 +0000 (00:19 +0000)] 
Daily bump.

11 months agoDaily bump.
GCC Administrator [Sun, 14 May 2023 00:18:17 +0000 (00:18 +0000)] 
Daily bump.

11 months agoDaily bump.
GCC Administrator [Sat, 13 May 2023 00:18:37 +0000 (00:18 +0000)] 
Daily bump.

11 months agoDaily bump.
GCC Administrator [Fri, 12 May 2023 00:20:04 +0000 (00:20 +0000)] 
Daily bump.

11 months agoDaily bump.
GCC Administrator [Thu, 11 May 2023 00:18:07 +0000 (00:18 +0000)] 
Daily bump.

11 months agoDaily bump.
GCC Administrator [Wed, 10 May 2023 00:19:30 +0000 (00:19 +0000)] 
Daily bump.

11 months agotestsuite: Add further testcase for already fixed PR [PR109778]
Jakub Jelinek [Tue, 9 May 2023 10:14:18 +0000 (12:14 +0200)] 
testsuite: Add further testcase for already fixed PR [PR109778]

I came up with a testcase which reproduces all the way to r10-7469.
LTO to avoid early inlining it, so that ccp handles rotates and not
shifts before they are turned into rotates.

2023-05-09  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/109778
* gcc.dg/lto/pr109778_0.c: New test.
* gcc.dg/lto/pr109778_1.c: New file.

(cherry picked from commit c2cf2dc988eb93551fa1c01d3f8d73ef21f39dc5)

11 months agotree-ssa-ccp, wide-int: Fix up handling of [LR]ROTATE_EXPR in bitwise ccp [PR109778]
Jakub Jelinek [Tue, 9 May 2023 10:10:07 +0000 (12:10 +0200)] 
tree-ssa-ccp, wide-int: Fix up handling of [LR]ROTATE_EXPR in bitwise ccp [PR109778]

The following testcase is miscompiled, because bitwise ccp2 handles
a rotate with a signed type incorrectly.
Seems tree-ssa-ccp.cc has the only callers of wi::[lr]rotate with 3
arguments, all other callers just rotate in the right precision and
I think work correctly.  ccp works with widest_ints and so rotations
by the excessive precision certainly don't match what it wants
when it sees a rotate in some specific bitsize.  Still, if it is
unsigned rotate and the widest_int is zero extended from width,
the functions perform left shift and logical right shift on the value
and then at the end zero extend the result of left shift and uselessly
also the result of logical right shift and return | of that.
On the testcase we the signed char rrotate by 4 argument is
CONSTANT -75 i.e. 0xffffffff....fffffb5 with mask 2.
The mask is correctly rotated to 0x20, but because the 8-bit constant
is sign extended to 192-bit one, the logical right shift by 4 doesn't
yield expected 0xb, but gives 0xfffffffffff....ffffb, and then
return wi::zext (left, width) | wi::zext (right, width); where left is
0xfffffff....fb50, so we return 0xfb instead of the expected
0x5b.

The following patch fixes that by doing the zero extension in case of
the right variable before doing wi::lrshift rather than after it.

Also, wi::[lr]rotate widht width < precision always zero extends
the result.  I'm afraid it can't do better because it doesn't know
if it is done for an unsigned or signed type, but the caller in this
case knows that very well, so I've done the extension based on sgn
in the caller.  E.g. 0x5b rotated right (or left) by 4 with width 8
previously gave 0xb5, but sgn == SIGNED in widest_int it should be
0xffffffff....fffb5 instead.

2023-05-09  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/109778
* wide-int.h (wi::lrotate, wi::rrotate): Call wi::lrshift on
wi::zext (x, width) rather than x if width != precision, rather
than using wi::zext (right, width) after the shift.
* tree-ssa-ccp.c (bit_value_binop): Call wi::ext on the results
of wi::lrotate or wi::rrotate.

* gcc.c-torture/execute/pr109778.c: New test.

(cherry picked from commit a8302d2a4669984c7c287d12ef5b37cde6699c80)

11 months agoDaily bump.
GCC Administrator [Tue, 9 May 2023 00:18:11 +0000 (00:18 +0000)] 
Daily bump.

11 months agoDaily bump.
GCC Administrator [Mon, 8 May 2023 00:18:48 +0000 (00:18 +0000)] 
Daily bump.

11 months agoDaily bump.
GCC Administrator [Sun, 7 May 2023 00:18:36 +0000 (00:18 +0000)] 
Daily bump.

11 months agoDaily bump.
GCC Administrator [Sat, 6 May 2023 00:18:00 +0000 (00:18 +0000)] 
Daily bump.

11 months agoDaily bump.
GCC Administrator [Fri, 5 May 2023 00:18:26 +0000 (00:18 +0000)] 
Daily bump.