]> git.ipfire.org Git - thirdparty/gcc.git/log
thirdparty/gcc.git
19 months agolibstdc++: Fix tr1/8_c_compatibility/cstdio/functions.cc regression with recent glibc
Jakub Jelinek [Fri, 13 Oct 2023 07:09:32 +0000 (09:09 +0200)] 
libstdc++: Fix tr1/8_c_compatibility/cstdio/functions.cc regression with recent glibc

The following testcase started FAILing recently after the
https://sourceware.org/git/?p=glibc.git;a=commit;h=64b1a44183a3094672ed304532bedb9acc707554
glibc change which marked vfscanf with nonnull (1) attribute.
While vfwscanf hasn't been marked similarly (strangely), the patch changes
that too.  By using va_arg one hides the value of it from the compiler
(volatile keyword would do too, or making the FILE* stream a function
argument, but then it might need to be guarded by #if or something).

2023-10-13  Jakub Jelinek  <jakub@redhat.com>

* testsuite/tr1/8_c_compatibility/cstdio/functions.cc (test01):
Initialize stream to va_arg(ap, FILE*) rather than 0.
* testsuite/tr1/8_c_compatibility/cwchar/functions.cc (test01):
Likewise.

(cherry picked from commit badb798f5e96a995bb9fa8c4ea48071aa4f2b4b3)

19 months agowide-int: Fix up wi::divmod_internal [PR110731]
Jakub Jelinek [Wed, 19 Jul 2023 11:48:53 +0000 (13:48 +0200)] 
wide-int: Fix up wi::divmod_internal [PR110731]

As the following testcase shows, wi::divmod_internal doesn't handle
correctly signed division with precision > 64 when the dividend (and likely
divisor as well) is the type's minimum and the precision isn't divisible
by 64.

A few lines above what the patch hunk changes is:
  /* Make the divisor and dividend positive and remember what we
     did.  */
  if (sgn == SIGNED)
    {
      if (wi::neg_p (dividend))
        {
          neg_dividend = -dividend;
          dividend = neg_dividend;
          dividend_neg = true;
        }
      if (wi::neg_p (divisor))
        {
          neg_divisor = -divisor;
          divisor = neg_divisor;
          divisor_neg = true;
        }
    }
i.e. we negate negative dividend or divisor and remember those.
But, after we do that, when unpacking those values into b_dividend and
b_divisor we need to always treat the wide_ints as UNSIGNED,
because divmod_internal_2 performs an unsigned division only.
Now, if precision <= 64, we don't reach here at all, earlier code
handles it.  If dividend or divisor aren't the most negative values,
the negation clears their most significant bit, so it doesn't really
matter if we unpack SIGNED or UNSIGNED.  And if precision is multiple
of HOST_BITS_PER_WIDE_INT, there is no difference in behavior, while
-0x80000000000000000000000000000000 negates to
-0x80000000000000000000000000000000 the unpacking of it as SIGNED
or UNSIGNED works the same.
In the testcase, we have signed precision 119 and the dividend is
val = { 0, 0xffc0000000000000 }, len = 2, precision = 119
both before and after negation.
Divisor is
val = { 2 }, len = 1, precision = 119
But we really want to divide 0x400000000000000000000000000000 by 2
unsigned and then negate at the end.
If it is unsigned precision 119 division
0x400000000000000000000000000000 by 2
dividend is
val = { 0, 0xffc0000000000000 }, len = 2, precision = 119
but as we unpack it UNSIGNED, it is unpacked into
0, 0, 0, 0x00400000

The following patch fixes it by always using UNSIGNED unpacking
because we've already negated negative values at that point if
sgn == SIGNED and so most negative constants should be treated as
positive.

2023-07-19  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/110731
* wide-int.cc (wi::divmod_internal): Always unpack dividend and
divisor as UNSIGNED regardless of sgn.

* gcc.dg/pr110731.c: New test.

(cherry picked from commit ece799607c841676f4e00c2fea98bbec6976da3f)

19 months agoDaily bump.
GCC Administrator [Sun, 17 Dec 2023 00:19:00 +0000 (00:19 +0000)] 
Daily bump.

19 months agoDaily bump.
GCC Administrator [Sat, 16 Dec 2023 00:19:09 +0000 (00:19 +0000)] 
Daily bump.

19 months agotree-optimization/111917 - bougs IL after guard hoisting
Richard Biener [Mon, 23 Oct 2023 09:25:17 +0000 (11:25 +0200)] 
tree-optimization/111917 - bougs IL after guard hoisting

The unswitching code to hoist guards inserts conditions in wrong
places.  The following fixes this, simplifying code.

PR tree-optimization/111917
* tree-ssa-loop-unswitch.c (hoist_guard): Always insert
new conditional after last stmt.

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

(cherry picked from commit d96bd4aade170fcd86f5f09b68b770dde798e631)

19 months agotree-optimization/111614 - missing convert in undistribute_bitref_for_vector
Richard Biener [Thu, 28 Sep 2023 07:41:30 +0000 (09:41 +0200)] 
tree-optimization/111614 - missing convert in undistribute_bitref_for_vector

The following adjusts a flawed guard for converting the first vector
of the sum we create in undistribute_bitref_for_vector.

PR tree-optimization/111614
* tree-ssa-reassoc.c (undistribute_bitref_for_vector): Properly
convert the first vector when required.

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

(cherry picked from commit 88d79b9b03eccf39921d13c2cbd1acc50aeda126)

19 months agotree-optimization/111764 - wrong reduction vectorization
Richard Biener [Thu, 12 Oct 2023 07:09:46 +0000 (09:09 +0200)] 
tree-optimization/111764 - wrong reduction vectorization

The following removes a misguided attempt to allow x + x in a reduction
path, also allowing x * x which isn't valid.  x + x actually never
arrives this way but instead is canonicalized to 2 * x.  This makes
reduction path handling consistent with how we handle the single-stmt
reduction case.

PR tree-optimization/111764
* tree-vect-loop.c (check_reduction_path): Remove the attempt
to allow x + x via special-casing of assigns.

* gcc.dg/vect/pr111764.c: New testcase.

(cherry picked from commit 05f98310b54da95e468d799f4a910174320cccbb)

19 months agomiddle-end/111818 - failed DECL_NOT_GIMPLE_REG_P setting of volatile
Richard Biener [Mon, 16 Oct 2023 10:50:46 +0000 (12:50 +0200)] 
middle-end/111818 - failed DECL_NOT_GIMPLE_REG_P setting of volatile

The following addresses a missed DECL_NOT_GIMPLE_REG_P setting of
a volatile declared parameter which causes inlining to substitute
a constant parameter into a context where its address is required.

The main issue is in update_address_taken which clears
DECL_NOT_GIMPLE_REG_P from the parameter but fails to rewrite it
because is_gimple_reg returns false for volatiles.  The following
changes maybe_optimize_var to make the 1:1 correspondence between
clearing DECL_NOT_GIMPLE_REG_P of a register typed decl and
actually rewriting it to SSA.

PR middle-end/111818
* tree-ssa.c (maybe_optimize_var): When clearing
DECL_NOT_GIMPLE_REG_P always rewrite into SSA.

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

(cherry picked from commit ce55521bcd149fdc431f1d78e706b66d470210ae)

19 months agotree-optimization/110298 - CFG cleanup and stale nb_iterations
Richard Biener [Mon, 19 Jun 2023 07:52:45 +0000 (09:52 +0200)] 
tree-optimization/110298 - CFG cleanup and stale nb_iterations

When unrolling we eventually kill nb_iterations info since it may
refer to removed SSA names.  But we do this only after cleaning
up the CFG which in turn can end up accessing it.  Fixed by
swapping the two.

PR tree-optimization/110298
* tree-ssa-loop-ivcanon.c (tree_unroll_loops_completely):
Clear number of iterations info before cleaning up the CFG.

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

(cherry picked from commit 916add3bf6e46467e4391e358b11ecfbc4daa275)

19 months agodebug/110295 - mixed up early/late debug for member DIEs
Richard Biener [Mon, 19 Jun 2023 07:23:16 +0000 (09:23 +0200)] 
debug/110295 - mixed up early/late debug for member DIEs

When we process a scope typedef during early debug creation and
we have already created a DIE for the type when the decl is
TYPE_DECL_IS_STUB and this DIE is still in limbo we end up
just re-parenting that type DIE instead of properly creating
a DIE for the decl, eventually picking up the now completed
type and creating DIEs for the members.  Instead this is currently
defered to the second time we come here, when we annotate the
DIEs with locations late where now the type DIE is no longer
in limbo and we fall through doing the job for the decl.

The following makes sure we perform the necessary early tasks
for this by continuing with the decl DIE creation after setting
a parent for the limbo type DIE.

PR debug/110295
* dwarf2out.c (process_scope_var): Continue processing
the decl after setting a parent in case the existing DIE
was in limbo.

* g++.dg/debug/pr110295.C: New testcase.

(cherry picked from commit 963f87f8a65ec82f503ac4334a3da83b0a8a43b2)

19 months agomiddle-end/110182 - TYPE_PRECISION on VECTOR_TYPE causes wrong-code
Richard Biener [Fri, 9 Jun 2023 07:29:09 +0000 (09:29 +0200)] 
middle-end/110182 - TYPE_PRECISION on VECTOR_TYPE causes wrong-code

When folding two conversions in a row we use TYPE_PRECISION but
that's invalid for VECTOR_TYPE.  The following fixes this by
using element_precision instead.

* match.pd (two conversions in a row): Use element_precision
to DTRT for VECTOR_TYPE.

(cherry picked from commit 3e12669a0eb968cfcbe9242b382fd8020935edf8)

19 months agoDaily bump.
GCC Administrator [Fri, 15 Dec 2023 00:18:38 +0000 (00:18 +0000)] 
Daily bump.

19 months agoDaily bump.
GCC Administrator [Thu, 14 Dec 2023 00:19:20 +0000 (00:19 +0000)] 
Daily bump.

19 months agoDaily bump.
GCC Administrator [Wed, 13 Dec 2023 00:19:48 +0000 (00:19 +0000)] 
Daily bump.

19 months agoDon't assume it's AVX_U128_CLEAN after call_insn whose abi.mode_clobber(V4DImode...
liuhongt [Thu, 7 Dec 2023 01:17:27 +0000 (09:17 +0800)] 
Don't assume it's AVX_U128_CLEAN after call_insn whose abi.mode_clobber(V4DImode) deosn't contains all SSE_REGS.

If the function desn't clobber any sse registers or only clobber
128-bit part, then vzeroupper isn't issued before the function exit.
the status not CLEAN but ANY after the function.

Also for sibling_call, it's safe to issue an vzeroupper. Also there
could be missing vzeroupper since there's no mode_exit for
sibling_call_p.

gcc/ChangeLog:

PR target/112891
* config/i386/i386.c (ix86_avx_u128_mode_after): Return
AVX_U128_ANY if callee_abi doesn't clobber all_sse_regs to
align with ix86_avx_u128_mode_needed.
(ix86_avx_u128_mode_needed): Return AVX_U128_ClEAN for
sibling_call.

gcc/testsuite/ChangeLog:

* gcc.target/i386/pr112891.c: New test.
* gcc.target/i386/pr112891-2.c: New test.

(cherry picked from commit fc189a08f5b7ad5889bd4c6b320c1dd99dd5d642)

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

19 months agoDaily bump.
GCC Administrator [Mon, 11 Dec 2023 00:18:55 +0000 (00:18 +0000)] 
Daily bump.

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

20 months agoDaily bump.
GCC Administrator [Sat, 9 Dec 2023 00:18:48 +0000 (00:18 +0000)] 
Daily bump.

20 months agoDaily bump.
GCC Administrator [Fri, 8 Dec 2023 00:18:54 +0000 (00:18 +0000)] 
Daily bump.

20 months agoDaily bump.
GCC Administrator [Thu, 7 Dec 2023 00:18:26 +0000 (00:18 +0000)] 
Daily bump.

20 months agolibstdc++: Missing constexpr for __gnu_debug::__valid_range etc
Jonathan Wakely [Mon, 1 Nov 2021 12:27:43 +0000 (12:27 +0000)] 
libstdc++: Missing constexpr for __gnu_debug::__valid_range etc

The new 25_algorithms/move/constexpr.cc test fails in debug mode,
because the debug assertions use the non-constexpr overloads in
<debug/stl_iterator.h>.

libstdc++-v3/ChangeLog:

* include/debug/stl_iterator.h (__valid_range): Add constexpr
for C++20. Qualify call to avoid ADL.
(__get_distance, __can_advance, __unsafe, __base): Likewise.
* testsuite/25_algorithms/move/constexpr.cc: Also check with
std::reverse_iterator arguments.

(cherry picked from commit 6f34b9e4f1eb7aa3398aaf135cbb24680eaad1b1)

20 months agolibstdc++: Add assertion to std::string_view::remove_suffix [PR112314]
Jonathan Wakely [Wed, 1 Nov 2023 15:01:22 +0000 (15:01 +0000)] 
libstdc++: Add assertion to std::string_view::remove_suffix [PR112314]

libstdc++-v3/ChangeLog:

PR libstdc++/112314
* include/std/string_view (string_view::remove_suffix): Add
debug assertion.
* testsuite/21_strings/basic_string_view/modifiers/remove_prefix/debug.cc:
New test.
* testsuite/21_strings/basic_string_view/modifiers/remove_suffix/debug.cc:
New test.

(cherry picked from commit 6afa984f47e16e8bd958646d7407b74e61041f5d)

20 months agolibstdc++: Adjust std::in_range template parameter name
Jonathan Wakely [Fri, 17 Nov 2023 12:18:17 +0000 (12:18 +0000)] 
libstdc++: Adjust std::in_range template parameter name

This is more consistent with the specification in the standard.

libstdc++-v3/ChangeLog:

* include/std/utility (in_range): Rename _Up parameter to _Res.

(cherry picked from commit 97fc8851f60fda381ac3bf6213a1cc93d9fda4f0)

20 months agoDaily bump.
GCC Administrator [Wed, 6 Dec 2023 00:18:59 +0000 (00:18 +0000)] 
Daily bump.

20 months agoDaily bump.
GCC Administrator [Tue, 5 Dec 2023 00:18:24 +0000 (00:18 +0000)] 
Daily bump.

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

20 months agoDaily bump.
GCC Administrator [Sun, 3 Dec 2023 00:18:08 +0000 (00:18 +0000)] 
Daily bump.

20 months agolibiberty, Darwin: Fix a build warning.
Iain Sandoe [Mon, 23 Aug 2021 16:34:43 +0000 (17:34 +0100)] 
libiberty, Darwin: Fix a build warning.

r12-3005-g220c410162ebece4f missed a cast for the set_32 call.
Fixed thus.

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

* simple-object-mach-o.c (simple_object_mach_o_write_segment):
Cast the first argument to set_32 as needed.

(cherry picked from commit 38757aa88735ab2e511bc428e2407a5a5e9fa0be)

20 months agoDaily bump.
GCC Administrator [Sat, 2 Dec 2023 00:18:41 +0000 (00:18 +0000)] 
Daily bump.

20 months agoFortran: avoid obsolescence warning for COMMON with submodule [PR111880]
Harald Anlauf [Thu, 23 Nov 2023 21:48:38 +0000 (22:48 +0100)] 
Fortran: avoid obsolescence warning for COMMON with submodule [PR111880]

gcc/fortran/ChangeLog:

PR fortran/111880
* resolve.c (resolve_common_vars): Do not call gfc_add_in_common
for symbols that are USE associated or used in a submodule.

gcc/testsuite/ChangeLog:

PR fortran/111880
* gfortran.dg/pr111880.f90: New test.

(cherry picked from commit c9d029ba2ceb435e31492c1f3f0fd3edf0e386be)

20 months agoDaily bump.
GCC Administrator [Fri, 1 Dec 2023 00:18:56 +0000 (00:18 +0000)] 
Daily bump.

20 months agoDaily bump.
GCC Administrator [Thu, 30 Nov 2023 00:18:42 +0000 (00:18 +0000)] 
Daily bump.

20 months agoDaily bump.
GCC Administrator [Wed, 29 Nov 2023 00:18:34 +0000 (00:18 +0000)] 
Daily bump.

20 months agoDaily bump.
GCC Administrator [Tue, 28 Nov 2023 00:18:26 +0000 (00:18 +0000)] 
Daily bump.

20 months agoDaily bump.
GCC Administrator [Mon, 27 Nov 2023 00:19:17 +0000 (00:19 +0000)] 
Daily bump.

20 months agoDaily bump.
GCC Administrator [Sun, 26 Nov 2023 00:19:32 +0000 (00:19 +0000)] 
Daily bump.

20 months agoDaily bump.
GCC Administrator [Sat, 25 Nov 2023 00:19:15 +0000 (00:19 +0000)] 
Daily bump.

20 months agoi386: Wrong code with __builtin_parityl [PR112672]
Uros Bizjak [Thu, 23 Nov 2023 15:17:57 +0000 (16:17 +0100)] 
i386: Wrong code with __builtin_parityl [PR112672]

gen_parityhi2_cmp instruction clobbers its input operand, so use
a temporary register in the call to gen_parityhi2_cmp.

PR target/112672

gcc/ChangeLog:

* config/i386/i386.md (parityhi2):
Use temporary register in the call to gen_parityhi2_cmp.

gcc/testsuite/ChangeLog:

* gcc.target/i386/pr112672.c: New test.

(cherry picked from commit b2d17bdd45b582b93e89c00b04763a45f97d7a34)

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

20 months agoDaily bump.
GCC Administrator [Thu, 23 Nov 2023 00:20:01 +0000 (00:20 +0000)] 
Daily bump.

20 months agoPR target/111815: VAX: Only accept the index scaler as the RHS operand to ASHIFT
Maciej W. Rozycki [Wed, 22 Nov 2023 01:27:02 +0000 (01:27 +0000)] 
PR target/111815: VAX: Only accept the index scaler as the RHS operand to ASHIFT

As from commit 9df1ba9a35b8 ("libbacktrace: support zstd decompression")
GCC for the `vax-netbsdelf' target fails to complete building, with an
ICE:

during RTL pass: final
.../libbacktrace/elf.c: In function 'elf_zstd_decompress':
.../libbacktrace/elf.c:5006:1: internal compiler error: in print_operand_address, at config/vax/vax.cc:514
 5006 | }
      | ^
0x1113df97 print_operand_address(_IO_FILE*, rtx_def*)
.../gcc/config/vax/vax.cc:514
0x10c2489b default_print_operand_address(_IO_FILE*, machine_mode, rtx_def*)
.../gcc/targhooks.cc:373
0x106ddd0b output_address(machine_mode, rtx_def*)
.../gcc/final.cc:3648
0x106ddd0b output_asm_insn(char const*, rtx_def**)
.../gcc/final.cc:3505
0x106e2143 output_asm_insn(char const*, rtx_def**)
.../gcc/final.cc:3421
0x106e2143 final_scan_insn_1
.../gcc/final.cc:2841
0x106e28e3 final_scan_insn(rtx_insn*, _IO_FILE*, int, int, int*)
.../gcc/final.cc:2887
0x106e2bf7 final_1
.../gcc/final.cc:1979
0x106e3c67 rest_of_handle_final
.../gcc/final.cc:4240
0x106e3c67 execute
.../gcc/final.cc:4318
Please submit a full bug report, with preprocessed source (by using -freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

This is due to combine producing an invalid address RTX:

(plus:SI (ashift:SI (const_int 1 [0x1])
        (reg:QI 3 %r3 [1232]))
    (reg/v:SI 10 %r10 [orig:736 weight_mask ] [736]))

where the expression is ((1 << R3) + R10), which does not match a valid
machine addressing mode.  Consequently `print_operand_address' chokes.

This can be reduced to the testcase included, where it triggers the same
ICE in `p'.  Preincrements are required so that their results land in
registers and consequently an indexed addressing mode is tried or
otherwise doing operations piecemeal on stack-based function arguments
as direct input operands turns out more profitable in terms of RTX costs
and the ICE is avoided.

The ultimate cause has been commit c605a8bf9270 ("VAX: Accept ASHIFT in
address expressions"), where a shift of an immediate value by a register
has been mistakenly allowed as an index expression as if the shift
operation was commutative such as multiplication is.  So with ASHIFT the
scaler in an index expression has to be the right-hand operand, and the
backend has to enforce that, whereas with MULT the scaler can be either
operand.

Fix this by only accepting the index scaler as the RHS operand to
ASHIFT.

gcc/
PR target/111815
* config/vax/vax.c (index_term_p): Only accept the index scaler
as the RHS operand to ASHIFT.

gcc/testsuite/
PR target/111815
* gcc.dg/torture/pr111815.c: New test.

(cherry picked from commit 56ff988e6be3fdba70cad86d73ec0038bc3b6b5a)

20 months agoDaily bump.
GCC Administrator [Wed, 22 Nov 2023 00:19:27 +0000 (00:19 +0000)] 
Daily bump.

20 months agoDaily bump.
GCC Administrator [Tue, 21 Nov 2023 00:20:01 +0000 (00:20 +0000)] 
Daily bump.

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

20 months agoDaily bump.
GCC Administrator [Sun, 19 Nov 2023 00:19:07 +0000 (00:19 +0000)] 
Daily bump.

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

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

20 months agoDaily bump.
GCC Administrator [Thu, 16 Nov 2023 00:19:02 +0000 (00:19 +0000)] 
Daily bump.

20 months agolibstdc++: Fix std::deque::operator[] Xmethod [PR112491]
Jonathan Wakely [Tue, 14 Nov 2023 15:08:13 +0000 (15:08 +0000)] 
libstdc++: Fix std::deque::operator[] Xmethod [PR112491]

The Xmethod for std::deque::operator[] has the same bug that I recently
fixed for the std::deque::size() Xmethod. The first node might have
unused capacity at the start, which needs to be accounted for when
indexing into the deque.

libstdc++-v3/ChangeLog:

PR libstdc++/112491
* python/libstdcxx/v6/xmethods.py (DequeWorkerBase.index):
Correctly handle unused capacity at the start of the first node.
* testsuite/libstdc++-xmethods/deque.cc: Check index operator
when elements have been removed from the front.

(cherry picked from commit 452476db0c705caeac8712d560fc16ced0ca5226)

20 months agoDaily bump.
GCC Administrator [Wed, 15 Nov 2023 00:18:12 +0000 (00:18 +0000)] 
Daily bump.

20 months agolibstdc++: Fix std::deque::size() Xmethod [PR112491]
Jonathan Wakely [Tue, 14 Nov 2023 15:08:13 +0000 (15:08 +0000)] 
libstdc++: Fix std::deque::size() Xmethod [PR112491]

The Xmethod for std::deque::size() assumed that the first element would
be at the start of the first node. That's only true if elements are only
added at the back. If an element is inserted at the front, or removed
from the front (or anywhere before the middle) then the first node will
not be completely populated, and the Xmethod will give the wrong result.

libstdc++-v3/ChangeLog:

PR libstdc++/112491
* python/libstdcxx/v6/xmethods.py (DequeWorkerBase.size): Fix
calculation to use _M_start._M_cur.
* testsuite/libstdc++-xmethods/deque.cc: Check failing cases.

(cherry picked from commit 4db820928065eccbeb725406450d826186582b9f)

20 months agoDaily bump.
GCC Administrator [Tue, 14 Nov 2023 12:24:57 +0000 (12:24 +0000)] 
Daily bump.

20 months agolibstdc++: Reformat Python code
Jonathan Wakely [Thu, 28 Sep 2023 13:54:59 +0000 (14:54 +0100)] 
libstdc++: Reformat Python code

Some of these changes were suggested by autopep8's --aggressive
option, others are for readability.

Break long lines by splitting strings across multiple lines, or
introducing local variables to hold results.

Use raw strings for regular expressions, so that backslashes don't need
to be escaped.

libstdc++-v3/ChangeLog:

* python/libstdcxx/v6/printers.py: Break long lines. Use raw
strings for regular expressions. Add whitespace around
operators.
(is_member_of_namespace): Use isinstance to check type.
(is_specialization_of): Likewise. Adjust template_name
for versioned namespace instead of duplicating the re.match
call.
(StdExpAnyPrinter._string_types): New static method.
(StdExpAnyPrinter.to_string): Use _string_types.

(cherry picked from commit 6b5c3f9b8139d9eee358b354b35da0b757a0270d)

20 months agoDaily bump.
GCC Administrator [Fri, 10 Nov 2023 00:18:49 +0000 (00:18 +0000)] 
Daily bump.

21 months agoDaily bump.
GCC Administrator [Thu, 9 Nov 2023 00:18:44 +0000 (00:18 +0000)] 
Daily bump.

21 months agoDaily bump.
GCC Administrator [Wed, 8 Nov 2023 00:18:56 +0000 (00:18 +0000)] 
Daily bump.

21 months agolibphobos: Fix regression d21 loops in getCpuInfo0B in Solaris/x86 kernel zone
Iain Buclaw [Tue, 7 Nov 2023 13:04:07 +0000 (14:04 +0100)] 
libphobos: Fix regression d21 loops in getCpuInfo0B in Solaris/x86 kernel zone

This function assumes that cpuid would return "invalid domain" when a
sub-leaf index greater than what's supported is requested.  This turned
out not to always be the case when running on some virtual machines.

As the loop only does anything for levels 0 and 1, make that a hard
limit for number of times the loop is ran.

    PR d/112408

libphobos/ChangeLog:

* libdruntime/core/cpuid.d (getCpuInfo0B): Limit number of times loop
runs.

(cherry picked from commit 0b25c1295d4e84af681f4b1f4af2ad37cd270da3)

21 months agoDaily bump.
GCC Administrator [Tue, 7 Nov 2023 00:18:43 +0000 (00:18 +0000)] 
Daily bump.

21 months agohppa: Fix typo in PA 2.0 trampoline template
John David Anglin [Mon, 6 Nov 2023 20:45:13 +0000 (20:45 +0000)] 
hppa: Fix typo in PA 2.0 trampoline template

2023-11-06  John David Anglin  <danglin@gcc.gnu.org>

* config/pa/pa.c (pa_asm_trampoline_template): Fix typo.

21 months agoDaily bump.
GCC Administrator [Mon, 6 Nov 2023 00:20:19 +0000 (00:20 +0000)] 
Daily bump.

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

21 months agoDaily bump.
GCC Administrator [Sat, 4 Nov 2023 00:18:09 +0000 (00:18 +0000)] 
Daily bump.

21 months agoDaily bump.
GCC Administrator [Fri, 3 Nov 2023 00:19:03 +0000 (00:19 +0000)] 
Daily bump.

21 months agoDaily bump.
GCC Administrator [Thu, 2 Nov 2023 00:19:06 +0000 (00:19 +0000)] 
Daily bump.

21 months agoDaily bump.
GCC Administrator [Wed, 1 Nov 2023 00:19:58 +0000 (00:19 +0000)] 
Daily bump.

21 months agoDaily bump.
GCC Administrator [Tue, 31 Oct 2023 00:18:55 +0000 (00:18 +0000)] 
Daily bump.

21 months agoDaily bump.
GCC Administrator [Mon, 30 Oct 2023 00:19:10 +0000 (00:19 +0000)] 
Daily bump.

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

21 months agoDaily bump.
GCC Administrator [Sat, 28 Oct 2023 00:18:31 +0000 (00:18 +0000)] 
Daily bump.

21 months agoDaily bump.
GCC Administrator [Fri, 27 Oct 2023 00:18:54 +0000 (00:18 +0000)] 
Daily bump.

21 months agoDaily bump.
GCC Administrator [Thu, 26 Oct 2023 00:18:19 +0000 (00:18 +0000)] 
Daily bump.

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

21 months agoDaily bump.
GCC Administrator [Tue, 24 Oct 2023 00:19:02 +0000 (00:19 +0000)] 
Daily bump.

21 months agoSH: Fix PR 111001
Oleg Endo [Mon, 23 Oct 2023 13:08:37 +0000 (22:08 +0900)] 
SH: Fix PR 111001

gcc/ChangeLog:

PR target/111001
* config/sh/sh_treg_combine.cc (sh_treg_combine::record_set_of_reg):
Skip over nop move insns.

21 months agors6000: Make 32 bit stack_protect support prefixed insn [PR111367]
Kewen Lin [Thu, 12 Oct 2023 05:05:03 +0000 (00:05 -0500)] 
rs6000: Make 32 bit stack_protect support prefixed insn [PR111367]

As PR111367 shows, with prefixed insn supported, some of
checkings consider it's able to leverage prefixed insn
for stack protect related load/store, but since we don't
actually change the emitted assembly for 32 bit, it can
cause the assembler error as exposed.

Mike's commit r10-4547-gce6a6c007e5a98 has already handled
the 64 bit case (DImode), this patch is to treat the 32
bit case (SImode) by making use of mode iterator P and
ptrload attribute iterator, also fixes the constraints
to match the emitted operand formats.

PR target/111367

gcc/ChangeLog:

* config/rs6000/rs6000.md (stack_protect_setsi): Support prefixed
instruction emission and incorporate to stack_protect_set<mode>.
(stack_protect_setdi): Rename to ...
(stack_protect_set<mode>): ... this, adjust constraint.
(stack_protect_testsi): Support prefixed instruction emission and
incorporate to stack_protect_test<mode>.
(stack_protect_testdi): Rename to ...
(stack_protect_test<mode>): ... this, adjust constraint.

gcc/testsuite/ChangeLog:

* g++.target/powerpc/pr111367.C: New test.

(cherry picked from commit 530babc2058be5f2b06b1541384e7b730c368b93)

21 months agoDaily bump.
GCC Administrator [Mon, 23 Oct 2023 00:19:16 +0000 (00:19 +0000)] 
Daily bump.

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

21 months agoFortran: out of bounds access with nested implied-do IO [PR111837]
Harald Anlauf [Mon, 16 Oct 2023 19:02:20 +0000 (21:02 +0200)] 
Fortran: out of bounds access with nested implied-do IO [PR111837]

gcc/fortran/ChangeLog:

PR fortran/111837
* frontend-passes.c (traverse_io_block): Dependency check of loop
nest shall be triangular, not banded.

gcc/testsuite/ChangeLog:

PR fortran/111837
* gfortran.dg/implied_do_io_8.f90: New test.

(cherry picked from commit 5ac63ec5da2e93226457bea4dbb3a4f78d5d82c2)

21 months agoDaily bump.
GCC Administrator [Sat, 21 Oct 2023 00:19:15 +0000 (00:19 +0000)] 
Daily bump.

21 months agoSH: Fix PR 101177
Oleg Endo [Fri, 20 Oct 2023 09:48:34 +0000 (18:48 +0900)] 
SH: Fix PR 101177

Fix accidentally inverted comparison.

gcc/ChangeLog:

PR target/101177
* config/sh/sh.md (unnamed split pattern): Fix comparison of
find_regno_note result.

21 months agoDaily bump.
GCC Administrator [Fri, 20 Oct 2023 00:18:33 +0000 (00:18 +0000)] 
Daily bump.

21 months agoDaily bump.
GCC Administrator [Thu, 19 Oct 2023 00:19:37 +0000 (00:19 +0000)] 
Daily bump.

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

21 months agoDisparage slightly for the alternative which move DFmode between SSE_REGS and GENERAL...
liuhongt [Wed, 5 Jul 2023 05:45:11 +0000 (13:45 +0800)] 
Disparage slightly for the alternative which move DFmode between SSE_REGS and GENERAL_REGS.

For testcase

void __cond_swap(double* __x, double* __y) {
  bool __r = (*__x < *__y);
  auto __tmp = __r ? *__x : *__y;
  *__y = __r ? *__y : *__x;
  *__x = __tmp;
}

GCC-14 with -O2 and -march=x86-64 options generates the following code:

__cond_swap(double*, double*):
        movsd   xmm1, QWORD PTR [rdi]
        movsd   xmm0, QWORD PTR [rsi]
        comisd  xmm0, xmm1
        jbe     .L2
        movq    rax, xmm1
        movapd  xmm1, xmm0
        movq    xmm0, rax
.L2:
        movsd   QWORD PTR [rsi], xmm1
        movsd   QWORD PTR [rdi], xmm0
        ret

rax is used to save and restore DFmode value. In RA both GENERAL_REGS
and SSE_REGS cost zero since we didn't disparage the
alternative in movdf_internal pattern, according to register
allocation order, GENERAL_REGS is allocated. The patch add ? for
alternative (r,v) and (v,r) just like we did for movsf/hf/bf_internal
pattern, after that we get optimal RA.

__cond_swap:
.LFB0:
.cfi_startproc
movsd (%rdi), %xmm1
movsd (%rsi), %xmm0
comisd %xmm1, %xmm0
jbe .L2
movapd %xmm1, %xmm2
movapd %xmm0, %xmm1
movapd %xmm2, %xmm0
.L2:
movsd %xmm1, (%rsi)
movsd %xmm0, (%rdi)
ret

gcc/ChangeLog:

PR target/110170
* config/i386/i386.md (movdf_internal): Disparage slightly for
2 alternatives (r,v) and (v,r) by adding constraint modifier
'?'.

gcc/testsuite/ChangeLog:

* gcc.target/i386/pr110170-3.c: New test.

(cherry picked from commit 37a231cc7594d12ba0822077018aad751a6fb94e)

21 months agoDaily bump.
GCC Administrator [Tue, 17 Oct 2023 00:18:34 +0000 (00:18 +0000)] 
Daily bump.

21 months agoDaily bump.
GCC Administrator [Mon, 16 Oct 2023 00:18:50 +0000 (00:18 +0000)] 
Daily bump.

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

21 months agoDaily bump.
GCC Administrator [Sat, 14 Oct 2023 00:17:34 +0000 (00:17 +0000)] 
Daily bump.

21 months agoDaily bump.
GCC Administrator [Fri, 13 Oct 2023 00:19:20 +0000 (00:19 +0000)] 
Daily bump.

21 months agoDaily bump.
GCC Administrator [Thu, 12 Oct 2023 00:19:13 +0000 (00:19 +0000)] 
Daily bump.

21 months agoDaily bump.
GCC Administrator [Wed, 11 Oct 2023 00:19:05 +0000 (00:19 +0000)] 
Daily bump.

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

22 months agoDaily bump.
GCC Administrator [Mon, 9 Oct 2023 00:18:58 +0000 (00:18 +0000)] 
Daily bump.

22 months agoDaily bump.
GCC Administrator [Sun, 8 Oct 2023 00:19:14 +0000 (00:19 +0000)] 
Daily bump.

22 months agoMATCH: Fix infinite loop between `vec_cond(vec_cond(a,b,0), c, d)` and `a & b`
Andrew Pinski [Thu, 5 Oct 2023 19:21:19 +0000 (12:21 -0700)] 
MATCH: Fix infinite loop between `vec_cond(vec_cond(a,b,0), c, d)` and `a & b`

Match has a pattern which converts `vec_cond(vec_cond(a,b,0), c, d)`
into `vec_cond(a & b, c, d)` but since in this case a is a comparison
fold will change `a & b` back into `vec_cond(a,b,0)` which causes an
infinite loop.
The best way to fix this is to enable the patterns for vec_cond(*,vec_cond,*)
only for GIMPLE so we don't get an infinite loop for fold any more.

Note this is a latent bug since these patterns were added in r11-2577-g229752afe3156a
and was exposed by r14-3350-g47b833a9abe1 where now able to remove a VIEW_CONVERT_EXPR.

OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions.

PR middle-end/111699

gcc/ChangeLog:

* match.pd ((c ? a : b) op d, (c ? a : b) op (c ? d : e),
(v ? w : 0) ? a : b, c1 ? c2 ? a : b : b): Enable only for GIMPLE.

gcc/testsuite/ChangeLog:

* gcc.c-torture/compile/pr111699-1.c: New test.

(cherry picked from commit e77428a9a336f57e3efe3eff95f2b491d7e9be14)

22 months agoDaily bump.
GCC Administrator [Sat, 7 Oct 2023 00:19:01 +0000 (00:19 +0000)] 
Daily bump.

22 months agoDaily bump.
GCC Administrator [Fri, 6 Oct 2023 00:19:02 +0000 (00:19 +0000)] 
Daily bump.

22 months agoDaily bump.
GCC Administrator [Thu, 5 Oct 2023 00:20:16 +0000 (00:20 +0000)] 
Daily bump.

22 months agolibstdc++: Fix testsuite failures with -O0
Jonathan Wakely [Wed, 4 Oct 2023 11:07:11 +0000 (12:07 +0100)] 
libstdc++: Fix testsuite failures with -O0

Backport the prune.exp change from r12-4425-g1595fe44e11a96 to fix two
testsuite failures when testing with -O0:
FAIL: 20_util/uses_allocator/69293_neg.cc (test for excess errors)
FAIL: 20_util/uses_allocator/cons_neg.cc (test for excess errors)

Also force some 20_util/integer_comparisons/ xfail tests to use -O2 so
that the errors match the dg-error directives.

libstdc++-v3/ChangeLog:

* testsuite/20_util/integer_comparisons/greater_equal_neg.cc:
Add -O2 to dg-options.
* testsuite/20_util/integer_comparisons/greater_neg.cc:
Likewise.
* testsuite/20_util/integer_comparisons/less_equal_neg.cc:
Likewise.
* testsuite/lib/prune.exp: Prune 'in constexpr expansion'.