]> git.ipfire.org Git - thirdparty/gcc.git/log
thirdparty/gcc.git
10 months agoFix small thinko in IPA mod/ref pass
Eric Botcazou [Fri, 20 Sep 2024 10:32:13 +0000 (12:32 +0200)] 
Fix small thinko in IPA mod/ref pass

When a memory copy operation is analyzed by analyze_ssa_name, if both the
load and store are made through the same SSA name, the store is overlooked.

gcc/
* ipa-modref.cc (modref_eaf_analysis::analyze_ssa_name): Always
process both the load and the store of a memory copy operation.

gcc/testsuite/
* gcc.dg/ipa/modref-4.c: New test.

10 months agos390: Fix strict_low_part generation
Stefan Schulze Frielinghaus [Fri, 20 Sep 2024 12:06:42 +0000 (14:06 +0200)] 
s390: Fix strict_low_part generation

In s390_expand_insv(), if generating code for ICM et al. src is a MEM
and gen_lowpart might force src into a register such that we end up with
patterns which do not match anymore.  Use adjust_address() instead in
order to preserve a MEM.

Furthermore, it is not straight forward to enforce a subreg.  For
example, in case of a paradoxical subreg, gen_lowpart() may return a
register.  In order to compensate this, s390_gen_lowpart_subreg() emits
a reference to a pseudo which does not coincide with its definition
which is wrong.  Additionally, if dest is a paradoxical subreg, then do
not try to emit a strict_low_part since it could mean that dest was not
initialized even though this might be fixed up later by init-regs.

Splitter for insn *get_tp_64, *zero_extendhisi2_31,
*zero_extendqisi2_31, *zero_extendqihi2_31 are applied after reload.
Thus, operands[0] is a hard register and gen_lowpart (m, operands[0])
just returns the hard register for mode m which is fine to use as an
argument for strict_low_part, i.e., we do not need to enforce subregs
here since after reload subregs are supposed to be eliminated anyway.

This fixes gcc.dg/torture/pr111821.c.

gcc/ChangeLog:

* config/s390/s390-protos.h (s390_gen_lowpart_subreg): Remove.
* config/s390/s390.cc (s390_gen_lowpart_subreg): Remove.
(s390_expand_insv): Use adjust_address() and emit a
strict_low_part only in case of a natural subreg.
* config/s390/s390.md: Use gen_lowpart() instead of
s390_gen_lowpart_subreg().

(cherry picked from commit 9ebc9fbdddfe1ec85355b068354315a4da8e1ca0)

10 months agoUpdate cpplib zh_CN.po
Joseph Myers [Thu, 19 Sep 2024 21:10:19 +0000 (21:10 +0000)] 
Update cpplib zh_CN.po

* zh_CN.po: Update.

10 months agoUpdate gcc zh_CN.po
Joseph Myers [Thu, 19 Sep 2024 21:07:08 +0000 (21:07 +0000)] 
Update gcc zh_CN.po

* zh_CN.po: Update.

10 months agodoc: Add more alias option and reorder Intel CPU -march documentation
Haochen Jiang [Wed, 18 Sep 2024 03:20:15 +0000 (11:20 +0800)] 
doc: Add more alias option and reorder Intel CPU -march documentation

This patch is backported from GCC15 with some tweaks.

Since r15-3539, there are requests coming in to add other alias option
documentation. This patch will add all ot them, including corei7, corei7-avx,
core-avx-i, core-avx2, atom, slm, gracemont and emerarldrapids.

Also in the patch, I reordered that part of documentation, currently all
the CPUs/products are just all over the place. I regrouped them by
date-to-now products (since the very first CPU to latest Panther Lake), P-core
(since the clients become hybrid cores, starting from Sapphire Rapids) and
E-core (since Bonnell to latest Clearwater Forest). In GCC14 and
eariler GCC, Xeon Phi CPUs are still there, I put them after E-core
CPUs.

And in the patch, I refined the product names in documentation.

gcc/ChangeLog:

* doc/invoke.texi: Add corei7, corei7-avx, core-avx-i,
core-avx2, atom, slm, gracemont and emerarldrapids. Reorder
the -march documentation by splitting them into date-to-now
products, P-core, E-core and Xeon Phi. Refine the product names in
documentation.

10 months agoDaily bump.
GCC Administrator [Thu, 19 Sep 2024 00:23:52 +0000 (00:23 +0000)] 
Daily bump.

10 months agotree-optimization/116460 - ICE with DCE in forwprop
Richard Biener [Mon, 26 Aug 2024 11:50:00 +0000 (13:50 +0200)] 
tree-optimization/116460 - ICE with DCE in forwprop

The following avoids removing stmts with defs that might still have
uses in the IL before calling simple_dce_from_worklist which might
remove those as that will wreck debug stmt generation.  Instead first
perform use-based DCE and then remove stmts which may have uses in
code that CFG cleanup will remove.  This requires tracking stmts
in to_remove by their SSA def so we can check whether it was removed
before without running into the issue that PHIs can be ggc_free()d
upon removal.  So this adds to_remove_defs in addition to to_remove
which has to stay to track GIMPLE_NOPs we want to elide.

PR tree-optimization/116460
* tree-ssa-forwprop.cc (pass_forwprop::execute): First do
simple_dce_from_worklist and then remove stmts in to_remove.
Track defs to be removed in to_remove_defs.

* g++.dg/torture/pr116460.C: New testcase.

(cherry picked from commit 172637cf0d9b7b2798f83b9c5f9598b449675cb0)

10 months agoFix vect/pr115278.cc for targets where uint32_t is distinct from unsigned.
Joern Rennecke [Wed, 7 Aug 2024 01:48:45 +0000 (02:48 +0100)] 
Fix vect/pr115278.cc for targets where uint32_t is distinct from unsigned.

gcc/testsuite/
* g++.dg/vect/pr115278.cc: Make cast's type agree with
assignment destination WRITE.

(cherry picked from commit b844775283a620b8826adf734ecfc97d820c3611)

10 months agomiddle-end/115426 - wrong gimplification of "rm" asm output operand
Richard Biener [Tue, 11 Jun 2024 11:11:08 +0000 (13:11 +0200)] 
middle-end/115426 - wrong gimplification of "rm" asm output operand

When the operand is gimplified to an extract of a register or a
register we have to disallow memory as we otherwise fail to
gimplify it properly.  Instead of

  __asm__("" : "=rm" __imag <r>);

we want

  __asm__("" : "=rm" D.2772);
  _1 = REALPART_EXPR <r>;
  r = COMPLEX_EXPR <_1, D.2772>;

otherwise SSA rewrite will fail and generate wrong code with 'r'
left bare in the asm output.

PR middle-end/115426
* gimplify.cc (gimplify_asm_expr): Handle "rm" output
constraint gimplified to a register (operation).

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

(cherry picked from commit a4bbdec2be1c9f8fb49276b8a54ee86024ceac17)

10 months agotree-optimization/116610 - wrong SLP induction bias for mask peeling
Richard Biener [Thu, 5 Sep 2024 09:18:57 +0000 (11:18 +0200)] 
tree-optimization/116610 - wrong SLP induction bias for mask peeling

The following fixes a mistake when applying the bias for peeling via
masking to the inital value of SLP inductions.

This resolves gcc.target/aarch64/sve/peel_ind_1.c (a scan-assembler
only unfortunately) when forcing single-lane SLP for it.

PR tree-optimization/116610
* tree-vect-loop.cc (vectorizable_induction): Use MINUS_EXPR
to apply a mask peeling adjustment.

(cherry picked from commit 6a1a856ba78589f7f5285b00ecd40ba2bbeef8b0)

10 months agofold: Fix `a * 1j` if a has side effects [PR116454]
Andrew Pinski [Thu, 22 Aug 2024 00:41:38 +0000 (17:41 -0700)] 
fold: Fix `a * 1j` if a has side effects [PR116454]

The problem here was a missing save_expr around arg0 since
it is used twice, once in REALPART_EXPR and once in IMAGPART_EXPR.
Thia adds the save_expr and reformats the code slightly so it is a
little easier to understand.  It excludes the case when arg0 is
a COMPLEX_EXPR since in that case we'll end up with the distinct
real and imaginary parts.  This is important to retain early
optimization in some testcases.

Bootstapped and tested on x86_64-linux-gnu with no regressions.

PR middle-end/116454

gcc/ChangeLog:

* fold-const.cc (fold_binary_loc): Fix `a * +-1i`
by wrapping arg0 with save_expr when it is not COMPLEX_EXPR.

gcc/testsuite/ChangeLog:

* gcc.dg/torture/pr116454-1.c: New test.
* gcc.dg/torture/pr116454-2.c: New test.

Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
Co-Authored-By: Richard Biener <rguenther@suse.de>
(cherry picked from commit b07f8a301158e53717b8688cc8ea430b6f02574c)

10 months agotree-optimization/116380 - bogus SSA update with loop distribution
Richard Biener [Wed, 21 Aug 2024 11:56:40 +0000 (13:56 +0200)] 
tree-optimization/116380 - bogus SSA update with loop distribution

When updating LC PHIs after copying loops we have to handle defs
defined outside of the loop appropriately (by not setting them to
NULL ...).  This mimics how we handle this in the SSA updating
code of the vectorizer.

PR tree-optimization/116380
* tree-loop-distribution.cc (copy_loop_before): Handle
out-of-loop defs appropriately.

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

(cherry picked from commit af0d2d95a5f767d92bd64f959679fb4612247b0b)

10 months agotree-optimization/116274 - overzealous SLP vectorization
Richard Biener [Thu, 8 Aug 2024 09:36:43 +0000 (11:36 +0200)] 
tree-optimization/116274 - overzealous SLP vectorization

The following tries to address that the vectorizer fails to have
precise knowledge of argument and return calling conventions and
views some accesses as loads and stores that are not.
This is mainly important when doing basic-block vectorization as
otherwise loop indexing would force such arguments to memory.

On x86 the reduction in the number of apparent loads and stores
often dominates cost analysis so the following tries to mitigate
this aggressively by adjusting only the scalar load and store
cost, reducing them to the cost of a simple scalar statement,
but not touching the vector access cost which would be much
harder to estimate.  Thereby we error on the side of not performing
basic-block vectorization.

PR tree-optimization/116274
* tree-vect-slp.cc (vect_bb_slp_scalar_cost): Cost scalar loads
and stores as simple scalar stmts when they access a non-global,
not address-taken variable that doesn't have BLKmode assigned.

* gcc.target/i386/pr116274-2.c: New testcase.

(cherry picked from commit b8ea13ebf1211714503fd72f25c04376483bfa53)

10 months agoaarch64/testsuite: Add testcases for recently fixed PRs
Andrew Pinski [Wed, 7 Aug 2024 16:36:38 +0000 (09:36 -0700)] 
aarch64/testsuite: Add testcases for recently fixed PRs

The commit for PR 116258, added a x86_64 specific testcase,
I thought it would be a good idea to add an aarch64 testcase too.
And since it also fixed VLA vectors too so add a SVE testcase.

Pushed as obvious after a test for aarch64-linux-gnu.

PR middle-end/116258
PR middle-end/116259

gcc/testsuite/ChangeLog:

* gcc.target/aarch64/pr116258.c: New test.
* gcc.target/aarch64/sve/pr116259-1.c: New test.

Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
(cherry picked from commit 2c6174402ea315ecf618cfcba741e8cb18bc5282)

10 months agotree-optimization/116258 - fix i386 testcase
Richard Biener [Thu, 8 Aug 2024 07:35:42 +0000 (09:35 +0200)] 
tree-optimization/116258 - fix i386 testcase

With -march=cascadelake we use vpermilps instead of shufps.

PR tree-optimization/116258
* gcc.target/i386/pr116258.c: Also allow vpermilps.

(cherry picked from commit 5aa4cd913e48cfce3ca0ab58cf6f80f55dbb0f58)

10 months agotree-optimization/116258 - do not lower PAREN_EXPR of vectors
Richard Biener [Wed, 7 Aug 2024 11:54:53 +0000 (13:54 +0200)] 
tree-optimization/116258 - do not lower PAREN_EXPR of vectors

The following avoids lowering of PAREN_EXPR of vectors as unsupported
to scalars.  Instead PAREN_EXPR is like a plain move or a VIEW_CONVERT.

PR tree-optimization/116258
* tree-vect-generic.cc (expand_vector_operations_1): Do not
lower PAREN_EXPR.

* gcc.target/i386/pr116258.c: New testcase.

(cherry picked from commit 5b999997d1a2102dca57918947d7e40a6ca68871)

10 months agomiddle-end/115641 - invalid address construction
Richard Biener [Thu, 18 Jul 2024 11:35:33 +0000 (13:35 +0200)] 
middle-end/115641 - invalid address construction

fold_truth_andor_1 via make_bit_field_ref builds an address of
a CALL_EXPR which isn't valid GENERIC and later causes an ICE.
The following simply avoids the folding for f ().a != 1 || f ().b != 2
as it is a premature optimization anyway.  The alternative would
have been to build a TARGET_EXPR around the call.  To get this far
f () has to be const as otherwise the two calls are not semantically
equivalent for the optimization.

PR middle-end/115641
* fold-const.cc (decode_field_reference): If the inner
reference isn't something we can take the address of, fail.

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

(cherry picked from commit 3670c70c561656a19f6bff36dd229f18120af127)

10 months agoDaily bump.
GCC Administrator [Wed, 18 Sep 2024 00:22:28 +0000 (00:22 +0000)] 
Daily bump.

10 months agoc++: crash with anon VAR_DECL [PR116676]
Marek Polacek [Mon, 16 Sep 2024 20:42:38 +0000 (16:42 -0400)] 
c++: crash with anon VAR_DECL [PR116676]

r12-3495 added maybe_warn_about_constant_value which will crash if
it gets a nameless VAR_DECL, which is what happens in this PR.

We created this VAR_DECL in cp_parser_decomposition_declaration.

PR c++/116676

gcc/cp/ChangeLog:

* constexpr.cc (maybe_warn_about_constant_value): Check DECL_NAME.

gcc/testsuite/ChangeLog:

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

Reviewed-by: Jason Merrill <jason@redhat.com>
(cherry picked from commit dfe0d4389a3ce43179563a63046ad3e74d615a08)

10 months agoDaily bump.
GCC Administrator [Tue, 17 Sep 2024 00:21:27 +0000 (00:21 +0000)] 
Daily bump.

10 months agoDaily bump.
GCC Administrator [Mon, 16 Sep 2024 00:21:15 +0000 (00:21 +0000)] 
Daily bump.

10 months agox86-64: Don't use temp for argument in a TImode register
H.J. Lu [Fri, 6 Sep 2024 12:24:07 +0000 (05:24 -0700)] 
x86-64: Don't use temp for argument in a TImode register

Don't use temp for a PARALLEL BLKmode argument of an EXPR_LIST expression
in a TImode register.  Otherwise, the TImode variable will be put in
the GPR save area which guarantees only 8-byte alignment.

gcc/

PR target/116621
* config/i386/i386.cc (ix86_gimplify_va_arg): Don't use temp for
a PARALLEL BLKmode container of an EXPR_LIST expression in a
TImode register.

gcc/testsuite/

PR target/116621
* gcc.target/i386/pr116621.c: New test.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
(cherry picked from commit fa7bbb065c63aa802e0bbb04d605407dad58cf94)

10 months agoDaily bump.
GCC Administrator [Sun, 15 Sep 2024 00:20:29 +0000 (00:20 +0000)] 
Daily bump.

11 months agoDaily bump.
GCC Administrator [Sat, 14 Sep 2024 00:20:48 +0000 (00:20 +0000)] 
Daily bump.

11 months agoDaily bump.
GCC Administrator [Fri, 13 Sep 2024 00:21:45 +0000 (00:21 +0000)] 
Daily bump.

11 months agoc++: ICE with TTP [PR96097]
Marek Polacek [Tue, 3 Sep 2024 21:01:48 +0000 (17:01 -0400)] 
c++: ICE with TTP [PR96097]

We crash when dependent_type_p gets a TEMPLATE_TYPE_PARM outside
a template.  That happens here because in

  template <template <typename T, typename T::type TT> typename X>
  void func() {}
  template <typename U, int I>
  struct Y {};
  void g() { func<Y>(); }

when performing overload resolution for func<Y>() we have to check
if U matches T and I matches TT.  So we wind up in
coerce_template_template_parm/PARM_DECL.  TREE_TYPE (arg) is int
so we try to substitute TT's type, which is T::type.  But we have
nothing to substitute T with.  And we call make_typename_type where
ctx is still T, which checks dependent_scope_p and we trip the assert.

It should work to always perform the substitution in a template context.
If the result still contains template parameters, we cannot say if they
match.

PR c++/96097

gcc/cp/ChangeLog:

* pt.cc (coerce_template_template_parm): Increment
processing_template_decl before calling tsubst.

gcc/testsuite/ChangeLog:

* g++.dg/template/ttp44.C: New test.

(cherry picked from commit 25ac2bb57ae400621050a7e0845994336ca83b99)

11 months agoc++: Disable deprecated/unavailable diagnostics when creating thunks for methods...
Jakub Jelinek [Thu, 12 Sep 2024 16:22:21 +0000 (18:22 +0200)] 
c++: Disable deprecated/unavailable diagnostics when creating thunks for methods with such attributes [PR116636]

On the following testcase, we emit false positive warnings/errors about using
the deprecated or unavailable methods when creating thunks for them, even
when nothing (in the testcase so far) actually used those.

The following patch temporarily disables that diagnostics when creating
the thunks.

2024-09-12  Jakub Jelinek  <jakub@redhat.com>

PR c++/116636
* method.cc: Include decl.h.
(use_thunk): Temporarily change deprecated_state to
UNAVAILABLE_DEPRECATED_SUPPRESS.

* g++.dg/warn/deprecated-19.C: New test.

(cherry picked from commit 4026d89d623e322920b052f7ac0d940ef267dc0f)

11 months agoc++: Fix get_member_function_from_ptrfunc with -fsanitize=bounds [PR116449]
Jakub Jelinek [Tue, 10 Sep 2024 16:32:58 +0000 (18:32 +0200)] 
c++: Fix get_member_function_from_ptrfunc with -fsanitize=bounds [PR116449]

The following testcase is miscompiled, because
get_member_function_from_ptrfunc
emits something like
(((FUNCTION.__pfn & 1) != 0)
 ? ptr + FUNCTION.__delta + FUNCTION.__pfn - 1
 : FUNCTION.__pfn) (ptr + FUNCTION.__delta, ...)
or so, so FUNCTION tree is used there 5 times.  There is
if (TREE_SIDE_EFFECTS (function)) function = save_expr (function);
but in this case function doesn't have side-effects, just nested ARRAY_REFs.
Now, if all the FUNCTION trees would be shared, it would work fine,
FUNCTION is evaluated in the first operand of COND_EXPR; but unfortunately
that isn't the case, both the BIT_AND_EXPR shortening and conversion to
bool done for build_conditional_expr actually unshare_expr that first
expression, but none of the other 4 are unshared.  With -fsanitize=bounds,
.UBSAN_BOUNDS calls are added to the ARRAY_REFs and use save_expr to avoid
evaluating the argument multiple times, but because that FUNCTION tree is
first used in the second argument of COND_EXPR (i.e. conditionally), the
SAVE_EXPR initialization is done just there and then the third argument
of COND_EXPR just uses the uninitialized temporary and so does the first
argument computation as well.

The following patch fixes that by doing save_expr even if !TREE_SIDE_EFFECTS,
but to avoid doing that too often only if !nonvirtual and if the expression
isn't a simple decl.

2024-09-10  Jakub Jelinek  <jakub@redhat.com>

PR c++/116449
* typeck.cc (get_member_function_from_ptrfunc): Use save_expr
on instance_ptr and function even if it doesn't have side-effects,
as long as it isn't a decl.

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

(cherry picked from commit 0008050b9d6046ba4e811a03b406fb5d98707cae)

11 months agolibiberty: Fix up > 64K section handling in simple_object_elf_copy_lto_debug_section...
Jakub Jelinek [Sat, 7 Sep 2024 07:36:53 +0000 (09:36 +0200)] 
libiberty: Fix up > 64K section handling in simple_object_elf_copy_lto_debug_section [PR116614]

cat abc.C
  #define A(n) struct T##n {} t##n;
  #define B(n) A(n##0) A(n##1) A(n##2) A(n##3) A(n##4) A(n##5) A(n##6) A(n##7) A(n##8) A(n##9)
  #define C(n) B(n##0) B(n##1) B(n##2) B(n##3) B(n##4) B(n##5) B(n##6) B(n##7) B(n##8) B(n##9)
  #define D(n) C(n##0) C(n##1) C(n##2) C(n##3) C(n##4) C(n##5) C(n##6) C(n##7) C(n##8) C(n##9)
  #define E(n) D(n##0) D(n##1) D(n##2) D(n##3) D(n##4) D(n##5) D(n##6) D(n##7) D(n##8) D(n##9)
  E(1) E(2) E(3)
  int main () { return 0; }
./xg++ -B ./ -o abc{.o,.C} -flto -flto-partition=1to1 -O2 -g -fdebug-types-section -c
./xgcc -B ./ -o abc{,.o} -flto -flto-partition=1to1 -O2
(not included in testsuite as it takes a while to compile) FAILs with
lto-wrapper: fatal error: Too many copied sections: Operation not supported
compilation terminated.
/usr/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status

The following patch fixes that.  Most of the 64K+ section support for
reading and writing was already there years ago (and especially reading used
quite often already) and a further bug fixed in it in the PR104617 fix.

Yet, the fix isn't solely about removing the
  if (new_i - 1 >= SHN_LORESERVE)
    {
      *err = ENOTSUP;
      return "Too many copied sections";
    }
5 lines, the missing part was that the function only handled reading of
the .symtab_shndx section but not copying/updating of it.
If the result has less than 64K-epsilon sections, that actually wasn't
needed, but e.g. with -fdebug-types-section one can exceed that pretty
easily (reported to us on WebKitGtk build on ppc64le).
Updating the section is slightly more complicated, because it basically
needs to be done in lock step with updating the .symtab section, if one
doesn't need to use SHN_XINDEX in there, the section should (or should be
updated to) contain SHN_UNDEF entry, otherwise needs to have whatever would
be overwise stored but couldn't fit.  But repeating due to that all the
symtab decisions what to discard and how to rewrite it would be ugly.

So, the patch instead emits the .symtab_shndx section (or sections) last
and prepares the content during the .symtab processing and in a second
pass when going just through .symtab_shndx sections just uses the saved
content.

2024-09-07  Jakub Jelinek  <jakub@redhat.com>

PR lto/116614
* simple-object-elf.c (SHN_COMMON): Align comment with neighbouring
comments.
(SHN_HIRESERVE): Use uppercase hex digits instead of lowercase for
consistency.
(simple_object_elf_find_sections): Formatting fixes.
(simple_object_elf_fetch_attributes): Likewise.
(simple_object_elf_attributes_merge): Likewise.
(simple_object_elf_start_write): Likewise.
(simple_object_elf_write_ehdr): Likewise.
(simple_object_elf_write_shdr): Likewise.
(simple_object_elf_write_to_file): Likewise.
(simple_object_elf_copy_lto_debug_section): Likewise.  Don't fail for
new_i - 1 >= SHN_LORESERVE, instead arrange in that case to copy
over .symtab_shndx sections, though emit those last and compute their
section content when processing associated .symtab sections.  Handle
simple_object_internal_read failure even in the .symtab_shndx reading
case.

(cherry picked from commit bb8dd0980b39cfd601f88703fd356055727ef24d)

11 months agoDaily bump.
GCC Administrator [Thu, 12 Sep 2024 00:20:49 +0000 (00:20 +0000)] 
Daily bump.

11 months agolibstdc++: Only use std::ios_base_library_init() for ELF [PR116159]
Jonathan Wakely [Tue, 10 Sep 2024 13:36:26 +0000 (14:36 +0100)] 
libstdc++: Only use std::ios_base_library_init() for ELF [PR116159]

The undefined std::ios_base_library_init() symbol that is referenced by
<iostream> is only supposed to be used for targets where symbol
versioning is supported.

The mingw-w64 target defaults to --enable-symvers=gnu due to using GNU
ld but doesn't actually support symbol versioning. This means it tries
to emit references to the std::ios_base_library_init() symbol, which
isn't really defined in the library. This causes problems when using lld
to link user binaries.

Disable the undefined symbol reference for non-ELF targets.

libstdc++-v3/ChangeLog:

PR libstdc++/116159
* include/std/iostream (ios_base_library_init): Only define for
ELF targets.
* src/c++98/ios_init.cc (ios_base_library_init): Likewise.

(cherry picked from commit fc7a1fb0238e379d466316aa219734ac61f4bc0e)

11 months agolibstdc++: std::string move assignment should not use POCCA trait [PR116641]
Jonathan Wakely [Tue, 10 Sep 2024 13:25:41 +0000 (14:25 +0100)] 
libstdc++: std::string move assignment should not use POCCA trait [PR116641]

The changes to implement LWG 2579 (r10-327-gdb33efde17932f) made
std::string::assign use the propagate_on_container_copy_assignment
(POCCA) trait, for consistency with operator=(const basic_string&).
However, this also unintentionally affected operator=(basic_string&&)
which calls assign(str) to make a deep copy when performing a move is
not possible. The fix is for the move assignment operator to call
_M_assign(str) instead of assign(str), as this just does the deep copy
and doesn't check the POCCA trait first.

The bug only affects the unlikely/useless combination of POCCA==true and
POCMA==false, but we should fix it for correctness anyway. it should
also make move assignment slightly cheaper to compile and execute,
because we skip the extra code in assign(const basic_string&).

libstdc++-v3/ChangeLog:

PR libstdc++/116641
* include/bits/basic_string.h (operator=(basic_string&&)): Call
_M_assign instead of assign.
* testsuite/21_strings/basic_string/allocator/116641.cc: New
test.

(cherry picked from commit c07cf418fdde0c192e370a8d76a991cc7215e9c4)

11 months agoDaily bump.
GCC Administrator [Wed, 11 Sep 2024 00:23:02 +0000 (00:23 +0000)] 
Daily bump.

11 months agolibstdc++: Fix std::chrono::tzdb to work with vanguard format
Jonathan Wakely [Tue, 30 Apr 2024 08:52:13 +0000 (09:52 +0100)] 
libstdc++: Fix std::chrono::tzdb to work with vanguard format

I found some issues in the std::chrono::tzdb parser by testing the
tzdata "vanguard" format, which uses new features that aren't enabled in
the "main" and "rearguard" data formats.

Since 2024a the keyword "minimum" is no longer valid for the FROM and TO
fields in a Rule line, which means that "m" is now a valid abbreviation
for "maximum". Previously we expected either "mi" or "ma". For backwards
compatibility, a FROM field beginning with "mi" is still supported and
is treated as 1900. The "maximum" keyword is only allowed in TO now,
because it makes no sense in FROM. To support these changes the
minmax_year and minmax_year2 classes for parsing FROM and TO are
replaced with a single years_from_to class that reads both fields.

The vanguard format makes use of %z in Zone FORMAT fields, which caused
an exception to be thrown from ZoneInfo::set_abbrev because no % or /
characters were expected when a Zone doesn't use a named Rule. The
ZoneInfo::to(sys_info&) function now uses format_abbrev_str to replace
any %z with the current offset. Although format_abbrev_str also checks
for %s and STD/DST formats, those only make sense when a named Rule is
in effect, so won't occur when ZoneInfo::to(sys_info&) is used.

Since making this change on trunk, the tzdata-2024b release started
using %z in the main format, not just vanguard. This makes a backport to
release branches necessary (see PR 116657).

This change also implements a feature that has always been missing from
time_zone::_M_get_sys_info: finding the Rule that is active before the
specified time point, so that we can correctly handle %s in the FORMAT
for the first new sys_info that gets created. This requires implementing
a poorly documented feature of zic, to get the LETTERS field from a
later transition, as described at
https://mm.icann.org/pipermail/tz/2024-April/058891.html
In order for this to work we need to be able to distinguish an empty
letters field (as used by CE%sT where the variable part is either empty
or "S") from "the letters field is not known for this transition". The
tzdata file uses "-" for an empty letters field, which libstdc++ was
previously replacing with "" when the Rule was parsed. Instead, we now
preserve the "-" in the Rule object, so that "" can be used for the case
where we don't know the letters (and so need to decide it).

libstdc++-v3/ChangeLog:

* src/c++20/tzdb.cc (minmax_year, minmax_year2): Remove.
(years_from_to): New class replacing minmax_year and
minmax_year2.
(format_abbrev_str, select_std_or_dst_abbrev): Move earlier in
the file. Handle "-" for letters.
(ZoneInfo::to): Use format_abbrev_str to expand %z.
(ZoneInfo::set_abbrev): Remove exception. Change parameter from
reference to value.
(operator>>(istream&, Rule&)): Do not clear letters when it
contains "-".
(time_zone::_M_get_sys_info): Add missing logic to find the Rule
in effect before the time point.
* testsuite/std/time/tzdb/1.cc: Adjust for vanguard format using
"GMT" as the Zone name, not as a Link to "Etc/GMT".
* testsuite/std/time/time_zone/sys_info_abbrev.cc: New test.

(cherry picked from commit 0ca8d56f2085715f27ee536c6c344bc47af49cdd)

11 months agoDaily bump.
GCC Administrator [Tue, 10 Sep 2024 00:33:01 +0000 (00:33 +0000)] 
Daily bump.

11 months agodoc: Enhance Intel CPU documentation
Haochen Jiang [Fri, 6 Sep 2024 03:19:26 +0000 (11:19 +0800)] 
doc: Enhance Intel CPU documentation

This patch will add those recent aliased CPU names into documentation
for clearness.

gcc/ChangeLog:

PR target/116617
* doc/invoke.texi: Add meteorlake, raptorlake and lunarlake.

11 months agoDaily bump.
GCC Administrator [Mon, 9 Sep 2024 00:21:22 +0000 (00:21 +0000)] 
Daily bump.

11 months agoc++: c->B::m access resolved through current inst [PR116320]
Patrick Palka [Thu, 15 Aug 2024 14:23:54 +0000 (10:23 -0400)] 
c++: c->B::m access resolved through current inst [PR116320]

Here when checking the access of (the injected-class-name) B in c->B::m
at parse time, we notice its context B (now the type) is a base of the
object type C<T>, so we proceed to use C<T> as the effective qualifying
type.  But this C<T> is the dependent specialization not the primary
template type, so it has empty TYPE_BINFO, which leads to a segfault later
from perform_or_defer_access_check.

The reason the DERIVED_FROM_P (B, C<T>) test guarding this code path works
despite C<T> having empty TYPE_BINFO is because of its currently_open_class
logic (added in r9-713-gd9338471b91bbe) which replaces a dependent
specialization with the primary template type if we're inside it.  So the
safest fix seems to be to call currently_open_class in the caller as well.

PR c++/116320

gcc/cp/ChangeLog:

* semantics.cc (check_accessibility_of_qualified_id): Try
currently_open_class when using the object type as the
effective qualifying type.

gcc/testsuite/ChangeLog:

* g++.dg/template/access42.C: New test.

Reviewed-by: Jason Merrill <jason@redhat.com>
(cherry picked from commit 484f139ccd3b631a777802e810a632678b42ffab)

11 months agoc++: inherited CTAD fixes [PR116276]
Patrick Palka [Sat, 10 Aug 2024 01:15:25 +0000 (21:15 -0400)] 
c++: inherited CTAD fixes [PR116276]

This implements the overlooked inherited vs non-inherited guide
tiebreaker from P2582R1.  This requires tracking inherited-ness of a
guide, for which it seems natural to reuse the lang_decl_fn::context
field which for a constructor tracks its inherited-ness.

This patch also works around CLASSTYPE_CONSTRUCTORS not reliably
returning all inherited constructors (due to some using-decl handling
quirks in in push_class_level_binding) by iterating over TYPE_FIELDS
instead.

This patch also makes us recognize another written form of inherited
constructor, 'using Base<T>::Base::Base' whose USING_DECL_SCOPE is a
TYPENAME_TYPE.

PR c++/116276

gcc/cp/ChangeLog:

* call.cc (joust): Implement P2582R1 inherited vs non-inherited
guide tiebreaker.
* cp-tree.h (lang_decl_fn::context): Document usage in
deduction_guide_p FUNCTION_DECLs.
(inherited_guide_p): Declare.
* pt.cc (inherited_guide_p): Define.
(set_inherited_guide_context): Define.
(alias_ctad_tweaks): Use set_inherited_guide_context.
(inherited_ctad_tweaks): Recognize some inherited constructors
whose scope is a TYPENAME_TYPE.
(ctor_deduction_guides_for): For C++23 inherited CTAD, iterate
over TYPE_FIELDS instead of CLASSTYPE_CONSTRUCTORS to recognize
all inherited constructors.

gcc/testsuite/ChangeLog:

* g++.dg/cpp23/class-deduction-inherited4.C: Remove an xfail.
* g++.dg/cpp23/class-deduction-inherited5.C: New test.
* g++.dg/cpp23/class-deduction-inherited6.C: New test.

Reviewed-by: Jason Merrill <jason@redhat.com>
(cherry picked from commit 8cc67b520968ca9a13fd96896522aa66e39a99e2)

11 months agolibstdc++: use concrete return type for std::forward_like
Patrick Palka [Sat, 3 Aug 2024 13:05:05 +0000 (09:05 -0400)] 
libstdc++: use concrete return type for std::forward_like

Inspired by https://github.com/llvm/llvm-project/issues/101614 this
inverts the relationship between forward_like and __like_t so that
forward_like is defined in terms of __like_t and with a concrete return
type.  __like_t in turn is defined via partial specializations that
pattern match on the const- and reference-ness of T.

This turns out to be more SFINAE friendly and significantly cheaper
to compile than the previous implementation.

libstdc++-v3/ChangeLog:

* include/bits/move.h (__like_impl): New metafunction.
(__like_t): Redefine in terms of __like_impl.
(forward_like): Redefine in terms of __like_t.
* testsuite/20_util/forward_like/2_neg.cc: Don't expect
error outside the immediate context anymore.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
(cherry picked from commit 8256d5c0097dff00f9bdf9ee0c9d53bd7cec2802)

11 months agoDaily bump.
GCC Administrator [Sun, 8 Sep 2024 00:30:07 +0000 (00:30 +0000)] 
Daily bump.

11 months agoc++: template depth of lambda in default targ [PR116567]
Patrick Palka [Sat, 7 Sep 2024 18:10:09 +0000 (14:10 -0400)] 
c++: template depth of lambda in default targ [PR116567]

For GCC 14, let's narrowly fix this bug by just pruning the result of
add_extra_args after the fact to get rid of any unwanted outer levels.

PR c++/116567

gcc/cp/ChangeLog:

* pt.cc (tsubst_lambda_expr): For a deferred-substitution lambda,
trim the augmented template arguments to match the template depth
of the lambda.

gcc/testsuite/ChangeLog:

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

Reviewed-by: Jason Merrill <jason@redhat.com>
11 months agoDaily bump.
GCC Administrator [Sat, 7 Sep 2024 00:21:14 +0000 (00:21 +0000)] 
Daily bump.

11 months agoUpdate gcc uk.po
Joseph Myers [Fri, 6 Sep 2024 16:15:12 +0000 (16:15 +0000)] 
Update gcc uk.po

* uk.po: Update.

11 months agoDaily bump.
GCC Administrator [Fri, 6 Sep 2024 00:22:34 +0000 (00:22 +0000)] 
Daily bump.

11 months agoc++: vtable referring to "unavailable" virtual fn [PR116606]
Marek Polacek [Thu, 5 Sep 2024 17:01:59 +0000 (13:01 -0400)] 
c++: vtable referring to "unavailable" virtual fn [PR116606]

mark_vtable_entries already has

   /* It's OK for the vtable to refer to deprecated virtual functions.  */
   warning_sentinel w(warn_deprecated_decl);

but that doesn't cover __attribute__((unavailable)).  We can use the
following override to cover both.

PR c++/116606

gcc/cp/ChangeLog:

* decl2.cc (mark_vtable_entries): Temporarily override deprecated_state to
UNAVAILABLE_DEPRECATED_SUPPRESS.  Remove a warning_sentinel.

gcc/testsuite/ChangeLog:

* g++.dg/ext/attr-unavailable-13.C: New test.

(cherry picked from commit d9d34f9a91371dea4bab0b54b2d7f762a6cc23e0)

11 months agoipa: Don't disable function parameter analysis for fat LTO
H.J. Lu [Tue, 27 Aug 2024 20:11:39 +0000 (13:11 -0700)] 
ipa: Don't disable function parameter analysis for fat LTO

Update analyze_parms not to disable function parameter analysis for
-ffat-lto-objects.  Tested on x86-64, there are no differences in zstd
with "-O2 -flto=auto" -g "vs -O2 -flto=auto -g -ffat-lto-objects".

PR ipa/116410
* ipa-modref.cc (analyze_parms): Always analyze function parameter
for LTO.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
(cherry picked from commit 2f1689ea8e631ebb4ff3720d56ef0362f5898ff6)

11 months agolibsanitizer: On aarch64 use hint #34 in prologue of libsanitizer functions
Jakub Jelinek [Thu, 5 Sep 2024 10:20:57 +0000 (12:20 +0200)] 
libsanitizer: On aarch64 use hint #34 in prologue of libsanitizer functions

When gcc is built with -mbranch-protection=standard, running sanitized
programs doesn't work properly on bti enabled kernels.

This has been fixed upstream with
https://github.com/llvm/llvm-project/pull/84061

The following patch cherry picks that from upstream.

For trunk we should eventually do a full merge from upstream, but I'm hoping
they will first fix up the _BitInt libubsan support mess.

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

* sanitizer_common/sanitizer_asm.h: Cherry-pick llvm-project revision
1c792d24e0a228ad49cc004a1c26bbd7cd87f030.
* interception/interception.h: Likewise.

(cherry picked from commit 2379cbb94b2668227c237c94c82e3c49fe39fd0f)

11 months agolower-bitint: Fix up __builtin_{add,sub}_overflow{,_p} bitint lowering [PR116501]
Jakub Jelinek [Tue, 3 Sep 2024 08:20:44 +0000 (10:20 +0200)] 
lower-bitint: Fix up __builtin_{add,sub}_overflow{,_p} bitint lowering [PR116501]

The following testcase is miscompiled.  The problem is in the last_ovf step.
The second operand has signed _BitInt(513) type but has the MSB clear,
so range_to_prec returns 512 for it (i.e. it fits into unsigned
_BitInt(512)).  Because of that the last step actually doesn't need to get
the most significant bit from the second operand, but the code was deciding
what to use purely from TYPE_UNSIGNED (type1) - if unsigned, use 0,
otherwise sign-extend the last processed bit; but that in this case was set.
We don't want to treat the positive operand as if it was negative regardless
of the bit below that precision, and precN >= 0 indicates that the operand
is in the [0, inf) range.

2024-09-03  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/116501
* gimple-lower-bitint.cc (bitint_large_huge::lower_addsub_overflow):
In the last_ovf case, use build_zero_cst operand not just when
TYPE_UNSIGNED (typeN), but also when precN >= 0.

* gcc.dg/torture/bitint-73.c: New test.

(cherry picked from commit d4d75a83007e884bfcd632ea3b3269704496f048)

11 months agoDon't call clean_symbol_name in create_tmp_var_name [PR116219]
Jakub Jelinek [Wed, 7 Aug 2024 18:14:31 +0000 (20:14 +0200)] 
Don't call clean_symbol_name in create_tmp_var_name [PR116219]

SRA adds fancy names like offset$D94316$_M_impl$D93629$_M_start
where the numbers in there are DECL_UIDs if there are unnamed
FIELD_DECLs etc.
Because -g0 vs. -g can cause differences between the exact DECL_UID
values (add bigger gaps in between them, corresponding decls should
still be ordered the same based on DECL_UID) we make sure such
decls have DECL_NAMELESS set and depending on exact options either don't
dump such names at all or dump_fancy_name sanitizes the D123456$ parts in
there to Dxxxx$.
Unfortunately in tons of places we then use get_name to grab either user
names or these SRA created names and use that as argument to
create_tmp_var{,_name,_raw} to base other artificial temporary names based
on that.  Those are DECL_NAMELESS too, but unfortunately create_tmp_var_name
starting with
https://gcc.gnu.org/git/?p=gcc.git&a=commit;h=725494f6e4121eace43b7db1202f8ecbf52a8276
calls clean_symbol_name which replaces the $s in there with _s and thus
dump_fancy_name doesn't sanitize it anymore.

I don't see any discussion of that commit (originally to TM branch, later
merged) on the mailing list, but from
   DECL_NAME (new_decl)
     = create_tmp_var_name (IDENTIFIER_POINTER (DECL_NAME (old_decl)));
-  SET_DECL_ASSEMBLER_NAME (new_decl, NULL_TREE);
+  SET_DECL_ASSEMBLER_NAME (new_decl, DECL_NAME (new_decl));
snippet elsewhere in that commit it seems create_tmp_var_name was used at
that point also to determine function names of clones, so presumably the
clean_symbol_name at that point was to ensure the symbol could be emitted
into assembly, maybe in case DECL_NAME is something like C++ operators or
whatever could have there undesirable characters.

Anyway, we don't do that for years anymore, already GCC 4.5 uses for such
purposes clone_function_name which starts of DECL_ASSEMBLER_NAME of the old
function and appends based on supportable symbol suffix separators the
separator and some suffix and/or number, so that part doesn't go through
create_tmp_var_name.

I don't see problems with having the $ and . etc. characters in the names
intended just to make dumps more readable, after all, we already are using
those in the SRA created names.  Those names shouldn't make it into the
assembly in any way, neither debug info nor assembly labels.

There is one theoretical case, where the gimplifier promotes automatic
vars into TREE_STATIC ones and therefore those can then appear in assembly,
just in case it would be on e.g. SRA created names and regimplified later.
Because no cases of promotion of DECL_NAMELESS vars to static was observed in
{x86_64,i686,powerpc64le}-linux bootstraps/regtests, the code simply uses
C.NNN names for DECL_NAMELESS vars like it does for !DECL_NAME vars.

Richi mentioned on IRC that the non-cleaned up names might make things
harder to feed stuff back to the GIMPLE FE, but if so, I think it should be
the dumping for GIMPLE FE purposes that cleans those up (but at that point
it should also verify if some such cleaned up names don't collide with
others and somehow deal with those).

2024-08-07  Jakub Jelinek  <jakub@redhat.com>

PR c++/116219
* gimple-expr.cc (remove_suffix): Formatting fixes.
(create_tmp_var_name): Don't call clean_symbol_name.
* gimplify.cc (gimplify_init_constructor): When promoting automatic
DECL_NAMELESS vars to static, don't preserve their DECL_NAME.

(cherry picked from commit 165e3e7c3ba884345647c0f1c9a3a57a03383651)

11 months agotestsuite: remove -fwrapv from signbit-5.c
Tamar Christina [Thu, 5 Sep 2024 09:36:02 +0000 (10:36 +0100)] 
testsuite: remove -fwrapv from signbit-5.c

The meaning of the testcase was changed by passing it -fwrapv.  The reason for
the test failures on some platform was because the test was testing some
implementation defined behavior wrt INT_MIN in generic code.

Instead of using -fwrapv this just removes the border case from the test so
all the values now have a defined semantic.  It still relies on the handling of
shifting a negative value right, but that wasn't changed with -fwrapv anyway.

The -fwrapv case is being handled already by other testcases.

gcc/testsuite/ChangeLog:

* gcc.dg/signbit-5.c: Remove -fwrapv and change INT_MIN to INT_MIN+1.

(cherry picked from commit 67eaf67360e434dd5969e1c66f043e3c751f9f52)

11 months agoDaily bump.
GCC Administrator [Thu, 5 Sep 2024 00:22:17 +0000 (00:22 +0000)] 
Daily bump.

11 months agolibstdc++: Fix error handling in fs::hard_link_count for Windows
Jonathan Wakely [Mon, 2 Sep 2024 11:16:49 +0000 (12:16 +0100)] 
libstdc++: Fix error handling in fs::hard_link_count for Windows

The recent change to use auto_win_file_handle for
std::filesystem::hard_link_count caused a regression. The
std::error_code argument should be cleared if no error occurs, but this
no longer happens. Add a call to ec.clear() in fs::hard_link_count to
fix this.

Also change the auto_win_file_handle class to take a reference to the
std::error_code and set it if an error occurs, to slightly simplify the
control flow in the fs::equiv_files function.

libstdc++-v3/ChangeLog:

* src/c++17/fs_ops.cc (auto_win_file_handle): Add error_code&
member and set it if CreateFileW or GetFileInformationByHandle
fails.
(fs::equiv_files) [_GLIBCXX_FILESYSTEM_IS_WINDOWS]: Simplify
control flow.
(fs::hard_link_count) [_GLIBCXX_FILESYSTEM_IS_WINDOWS]: Clear ec
on success.
* testsuite/27_io/filesystem/operations/hard_link_count.cc:
Check error handling.

(cherry picked from commit 71b1639c67b91554420cc38eb4c82323e535c816)

11 months agolibstdc++: Fix overwriting files with fs::copy_file on Windows
Jonathan Wakely [Tue, 30 Jul 2024 09:55:55 +0000 (10:55 +0100)] 
libstdc++: Fix overwriting files with fs::copy_file on Windows

There are no inode numbers on Windows filesystems, so stat_type::st_ino
is always zero and the check for equivalent files in do_copy_file was
incorrectly identifying distinct files as equivalent. This caused
copy_file to incorrectly report errors when trying to overwrite existing
files.

The fs::equivalent function already does the right thing on Windows, so
factor that logic out into a new function that can be reused by
fs::copy_file.

The tests for fs::copy_file were quite inadequate, so this also adds
checks for that function's error conditions.

libstdc++-v3/ChangeLog:

* src/c++17/fs_ops.cc (auto_win_file_handle): Change constructor
parameter from const path& to const wchar_t*.
(fs::equiv_files): New function.
(fs::equivalent): Use equiv_files.
* src/filesystem/ops-common.h (fs::equiv_files): Declare.
(do_copy_file): Use equiv_files.
* src/filesystem/ops.cc (fs::equiv_files): Define.
(fs::copy, fs::equivalent): Use equiv_files.
* testsuite/27_io/filesystem/operations/copy.cc: Test
overwriting directory contents recursively.
* testsuite/27_io/filesystem/operations/copy_file.cc: Test
overwriting existing files.

(cherry picked from commit 017e3f89b081e4828a588a3bd27b5feacea042b7)

11 months agolibstdc++: Fix fs::hard_link_count behaviour on MinGW [PR113663]
Lennox Shou Hao Ho [Mon, 29 Jul 2024 20:09:27 +0000 (21:09 +0100)] 
libstdc++: Fix fs::hard_link_count behaviour on MinGW [PR113663]

std::filesystem::hard_link_count() always returns 1 on
mingw-w64ucrt-11.0.1-r3 on Windows 10 19045

hard_link_count() queries _wstat64() on MinGW-w64
The MSFT documentation claims _wstat64() will always return 1 *non*-NTFS volumes
https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2013/14h5k7ff(v=vs.120)

My tests suggest that is not always true -
hard_link_count()/_wstat64() still returns 1 on NTFS.
GetFileInformationByHandle does return the correct result of 2.
Please see the PR for a minimal repro.

This patch changes the Windows implementation to always call
GetFileInformationByHandle.

PR libstdc++/113663

libstdc++-v3/ChangeLog:

* src/c++17/fs_ops.cc (fs::equivalent): Moved helper class
auto_handle to anonymous namespace as auto_win_file_handle.
(fs::hard_link_count): Changed Windows implementation to use
information provided by GetFileInformationByHandle which is more
reliable.
* testsuite/27_io/filesystem/operations/hard_link_count.cc: New
test.

Signed-off-by: "Lennox" Shou Hao Ho <lennoxhoe@gmail.com>
Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
(cherry picked from commit 658193658f05e9a8ebf0bce8bab15555f43bfee1)

11 months agolibstdc++: Specialize std::disable_sized_sentinel_for for std::move_iterator [PR116549]
Jonathan Wakely [Mon, 2 Sep 2024 10:29:13 +0000 (11:29 +0100)] 
libstdc++: Specialize std::disable_sized_sentinel_for for std::move_iterator [PR116549]

LWG 3736 added a partial specialization of this variable template for
two std::move_iterator types. This is needed for the case where the
types satisfy std::sentinel_for and are subtractable, but do not model
the semantics requirements of std::sized_sentinel_for.

libstdc++-v3/ChangeLog:

PR libstdc++/116549
* include/bits/stl_iterator.h (disable_sized_sentinel_for):
Define specialization for two move_iterator types, as per LWG
3736.
* testsuite/24_iterators/move_iterator/lwg3736.cc: New test.

(cherry picked from commit 819deae0a5bee079a7d5582fafaa098c26144ae8)

11 months agolibstdc++: Add missing feature-test macro in various headers
Dhruv Chawla [Mon, 26 Aug 2024 05:39:19 +0000 (11:09 +0530)] 
libstdc++: Add missing feature-test macro in various headers

version.syn#2 requires various headers to define
__cpp_lib_allocator_traits_is_always_equal. Currently, only <memory> was
defining this macro. Implement fixes for the other headers as well.

Signed-off-by: Dhruv Chawla <dhruvc@nvidia.com>
libstdc++-v3/ChangeLog:

* include/std/deque: Define macro
__glibcxx_want_allocator_traits_is_always_equal.
* include/std/forward_list: Likewise.
* include/std/list: Likewise.
* include/std/map: Likewise.
* include/std/scoped_allocator: Likewise.
* include/std/set: Likewise.
* include/std/string: Likewise.
* include/std/unordered_map: Likewise.
* include/std/unordered_set: Likewise.
* include/std/vector: Likewise.
* testsuite/20_util/headers/memory/version.cc: New test.
* testsuite/20_util/scoped_allocator/version.cc: Likewise.
* testsuite/21_strings/headers/string/version.cc: Likewise.
* testsuite/23_containers/deque/version.cc: Likewise.
* testsuite/23_containers/forward_list/version.cc: Likewise.
* testsuite/23_containers/list/version.cc: Likewise.
* testsuite/23_containers/map/version.cc: Likewise.
* testsuite/23_containers/set/version.cc: Likewise.
* testsuite/23_containers/unordered_map/version.cc: Likewise.
* testsuite/23_containers/unordered_set/version.cc: Likewise.
* testsuite/23_containers/vector/version.cc: Likewise.

(cherry picked from commit efe6efb6f315c7f97be8a850e0a84ff7f6651d85)

11 months agolibstdc++: Fix std::variant to reject array types [PR116381]
Jonathan Wakely [Tue, 20 Aug 2024 15:52:22 +0000 (16:52 +0100)] 
libstdc++: Fix std::variant to reject array types [PR116381]

For the backport, rejecting array types is only done in strict modes.

libstdc++-v3/ChangeLog:

PR libstdc++/116381
* include/std/variant (variant): Fix conditions for
static_assert to match the spec.
* testsuite/20_util/variant/types_neg.cc: New test.

(cherry picked from commit 1e10b3b8825ee398f077500af6ae1f5db180983a)

11 months agoaarch64: Fix ls64 intrinsic availability
Andrew Carlotti [Thu, 26 Oct 2023 14:45:15 +0000 (15:45 +0100)] 
aarch64: Fix ls64 intrinsic availability

The availability of ls64 intrinsics and data types were determined
solely by the globally specified architecture features, which did not
reflect any changes specified in target pragmas or attributes.

This patch removes the initialisation-time guards for the intrinsics,
and replaces them with checks at use time. We also get better error
messages when ls64 is not available (matching the existing error
messages for SVE intrinsics).

The data512_t type is made always available; this is consistent with the
present behaviour for Neon fp16/bf16 types.

gcc/ChangeLog:

PR target/112108
* config/aarch64/aarch64-builtins.cc (handle_arm_acle_h): Remove
feature check at initialisation.
(aarch64_general_check_builtin_call): Check ls64 intrinsics.
* config/aarch64/arm_acle.h: (data512_t) Make always available.

gcc/testsuite/ChangeLog:

PR target/112108
* gcc.target/aarch64/acle/ls64_guard-1.c: New test.
* gcc.target/aarch64/acle/ls64_guard-2.c: New test.
* gcc.target/aarch64/acle/ls64_guard-3.c: New test.
* gcc.target/aarch64/acle/ls64_guard-4.c: New test.

11 months agoaarch64: Fix memtag intrinsic availability
Andrew Carlotti [Tue, 18 Jul 2023 19:09:38 +0000 (20:09 +0100)] 
aarch64: Fix memtag intrinsic availability

The availability of memtag intrinsics and data types were determined
solely by the globally specified architecture features, which did not
reflect any changes specified in target pragmas or attributes.

This patch removes the initialisation-time guards for the intrinsics,
and replaces them with checks at use time. It also removes the macro
indirection from the header file - this simplifies the header, and
allows the missing extension error reporting to find the user-facing
intrinsic names.

gcc/ChangeLog:

PR target/112108
* config/aarch64/aarch64-builtins.cc (aarch64_init_memtag_builtins):
Define intrinsic names directly.
(aarch64_general_init_builtins): Move memtag intialisation...
(handle_arm_acle_h): ...to here, and remove feature check.
(aarch64_general_check_builtin_call): Check memtag intrinsics.
* config/aarch64/arm_acle.h (__arm_mte_create_random_tag)
(__arm_mte_exclude_tag, __arm_mte_ptrdiff)
(__arm_mte_increment_tag, __arm_mte_set_tag, __arm_mte_get_tag):
Remove.

gcc/testsuite/ChangeLog:

PR target/112108
* gcc.target/aarch64/acle/memtag_guard-1.c: New test.
* gcc.target/aarch64/acle/memtag_guard-2.c: New test.
* gcc.target/aarch64/acle/memtag_guard-3.c: New test.
* gcc.target/aarch64/acle/memtag_guard-4.c: New test.

11 months agoaarch64: Fix tme intrinsic availability
Andrew Carlotti [Thu, 26 Oct 2023 14:43:44 +0000 (15:43 +0100)] 
aarch64: Fix tme intrinsic availability

The availability of tme intrinsics was previously gated at both
initialisation time (using global target options) and usage time
(accounting for function-specific target options).  This patch removes
the check at initialisation time, and also moves the intrinsics out of
the header file to allow for better error messages (matching the
existing error messages for SVE intrinsics).

gcc/ChangeLog:

PR target/112108
* config/aarch64/aarch64-builtins.cc (aarch64_init_tme_builtins):
Define intrinsic names directly.
(aarch64_general_init_builtins): Move tme initialisation...
(handle_arm_acle_h): ...to here, and remove feature check.
(aarch64_general_check_builtin_call): Check tme intrinsics.
* config/aarch64/arm_acle.h (__tstart, __tcommit, __tcancel)
(__ttest): Remove.
(_TMFAILURE_*): Define unconditionally.

gcc/testsuite/ChangeLog:

PR target/112108
* gcc.target/aarch64/acle/tme_guard-1.c: New test.
* gcc.target/aarch64/acle/tme_guard-2.c: New test.
* gcc.target/aarch64/acle/tme_guard-3.c: New test.
* gcc.target/aarch64/acle/tme_guard-4.c: New test.

11 months agoaarch64: Move check_required_extensions
Andrew Carlotti [Tue, 18 Jul 2023 15:40:58 +0000 (16:40 +0100)] 
aarch64: Move check_required_extensions

Move SVE extension checking functionality to aarch64-builtins.cc, so
that it can be shared by non-SVE intrinsics.

gcc/ChangeLog:

* config/aarch64/aarch64-sve-builtins.cc (check_builtin_call)
(expand_builtin): Update calls to the below.
(report_missing_extension, report_missing_registers)
(check_required_extensions): Move out of aarch64_sve namespace,
rename, and move into...
* config/aarch64/aarch64-builtins.cc (aarch64_report_missing_extension)
(aarch64_report_missing_registers)
(aarch64_check_required_extensions) ...here.
* config/aarch64/aarch64-protos.h (aarch64_check_required_extensions):
Add prototype.

11 months agoaarch64: Refactor check_required_extensions
Andrew Carlotti [Tue, 13 Aug 2024 15:15:11 +0000 (16:15 +0100)] 
aarch64: Refactor check_required_extensions

Replace TARGET_GENERAL_REGS_ONLY check with an explicit check that
aarch64_isa_flags enables all required extensions.  This will be more
flexible when repurposing this function for non-SVE intrinsics.

gcc/ChangeLog:

* config/aarch64/aarch64-sve-builtins.cc
(check_required_registers): Remove target check and rename to...
(report_missing_registers): ...this.
(check_required_extensions): Refactor.

11 months agolto: Don't check obj.found for offload section
H.J. Lu [Fri, 23 Aug 2024 12:36:45 +0000 (05:36 -0700)] 
lto: Don't check obj.found for offload section

obj.found is the number of LTO symbols.  We should include the offload
section when it is used by linker even if there are no LTO symbols.

PR lto/116361
* lto-plugin.c (claim_file_handler_v2): Don't check obj.found
for the offload section.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
(cherry picked from commit cb51e0b236c7d492af2033582230e78d8b55290f)

11 months agoUpdate LDPT_REGISTER_CLAIM_FILE_HOOK_V2 linker plugin hook
H.J. Lu [Wed, 21 Aug 2024 14:25:25 +0000 (07:25 -0700)] 
Update LDPT_REGISTER_CLAIM_FILE_HOOK_V2 linker plugin hook

This hook allows the BFD linker plugin to distinguish calls to
claim_file_handler that know the object is being used by the linker
(from ldmain.c:add_archive_element), from calls that don't know it's
being used by the linker (from elf_link_is_defined_archive_symbol); in
the latter case, the plugin should avoid including the unused LTO archive
members in link output.  To get the proper support for archives with LTO
common symbols, the linker fix

commit a6f8fe0a9e9cbe871652e46ba7c22d5e9fb86208
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Aug 14 20:50:02 2024 -0700

    lto: Don't include unused LTO archive members in output

is required.

PR lto/116361
* lto-plugin.c (claim_file_handler_v2): Rename claimed to
can_be_claimed.  Include the LTO object only if it is known to
be included in link output.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
(cherry picked from commit a98dd536b1017c2b814a3465206c6c01b2890998)

11 months agoDaily bump.
GCC Administrator [Wed, 4 Sep 2024 00:27:51 +0000 (00:27 +0000)] 
Daily bump.

11 months agoi386: Fix vfpclassph non-optimizied intrin
Haochen Jiang [Mon, 2 Sep 2024 07:00:22 +0000 (15:00 +0800)] 
i386: Fix vfpclassph non-optimizied intrin

The intrin for non-optimized got a typo in mask type, which will cause
the high bits of __mmask32 being unexpectedly zeroed.

The test does not fail under O0 with current 1b since the testcase is
wrong. We need to include avx512-mask-type.h after SIZE is defined, or
it will always be __mmask8. I will write a seperate patch to fix that
on trunk ONLY.

gcc/ChangeLog:

* config/i386/avx512fp16intrin.h
(_mm512_mask_fpclass_ph_mask): Correct mask type to __mmask32.
(_mm512_fpclass_ph_mask): Ditto.

gcc/testsuite/ChangeLog:

* gcc.target/i386/avx512fp16-vfpclassph-1c.c: New test.

11 months agoDaily bump.
GCC Administrator [Tue, 3 Sep 2024 00:32:49 +0000 (00:32 +0000)] 
Daily bump.

11 months agoCheck avx upper register for parallel.
liuhongt [Thu, 29 Aug 2024 03:39:20 +0000 (11:39 +0800)] 
Check avx upper register for parallel.

For function arguments/return, when it's BLK mode, it's put in a
parallel with an expr_list, and the expr_list contains the real mode
and registers.
Current ix86_check_avx_upper_register only checked for SSE_REG_P, and
failed to handle that. The patch extend the handle to each subrtx.

gcc/ChangeLog:

PR target/116512
* config/i386/i386.cc (ix86_check_avx_upper_register): Iterate
subrtx to scan for avx upper register.
(ix86_check_avx_upper_stores): Inline old
ix86_check_avx_upper_register.
(ix86_avx_u128_mode_needed): Ditto, and replace
FOR_EACH_SUBRTX with call to new
ix86_check_avx_upper_register.

gcc/testsuite/ChangeLog:

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

(cherry picked from commit ab214ef734bfc3dcffcf79ff9e1dd651c2b40566)

11 months agoDaily bump.
GCC Administrator [Mon, 2 Sep 2024 00:25:48 +0000 (00:25 +0000)] 
Daily bump.

11 months agoDaily bump.
GCC Administrator [Sun, 1 Sep 2024 00:36:10 +0000 (00:36 +0000)] 
Daily bump.

11 months agoDaily bump.
GCC Administrator [Sat, 31 Aug 2024 00:22:43 +0000 (00:22 +0000)] 
Daily bump.

11 months agoFortran: fix ICE with use with rename of namelist member [PR116530]
Harald Anlauf [Thu, 29 Aug 2024 19:21:39 +0000 (21:21 +0200)] 
Fortran: fix ICE with use with rename of namelist member [PR116530]

gcc/fortran/ChangeLog:

PR fortran/116530
* trans-io.cc (transfer_namelist_element): Prevent NULL pointer
dereference.

gcc/testsuite/ChangeLog:

PR fortran/116530
* gfortran.dg/use_rename_12.f90: New test.

(cherry picked from commit 6bfeba12c86b4d0dae27d99b484f64774dd49398)

11 months agoDaily bump.
GCC Administrator [Fri, 30 Aug 2024 00:30:04 +0000 (00:30 +0000)] 
Daily bump.

11 months agoDaily bump.
GCC Administrator [Thu, 29 Aug 2024 00:25:52 +0000 (00:25 +0000)] 
Daily bump.

11 months agoAdd gcc ka.po
Joseph Myers [Wed, 28 Aug 2024 16:32:11 +0000 (16:32 +0000)] 
Add gcc ka.po

* ka.po: New file.

11 months agoi386: testsuite: Adapt fentryname3.c for r14-811 change [PR70150]
Xi Ruoyao [Mon, 6 May 2024 03:39:14 +0000 (11:39 +0800)] 
i386: testsuite: Adapt fentryname3.c for r14-811 change [PR70150]

After r14-811 "call *nop@GOTPCREL(%rip)" is only generated with
-mno-direct-extern-access even if --enable-default-pie.  So the r13-1614
change to this file is not valid anymore.

gcc/testsuite/ChangeLog:

PR testsuite/70150
* gcc.target/i386/fentryname3.c (dg-final): Revert r13-1614
change.

(cherry picked from commit 8035619b7313d9503852e1c7c8c06cfddca4d648)

11 months agoi386: testsuite: Add -no-pie for pr113689-1.c [PR70150]
Xi Ruoyao [Mon, 6 May 2024 03:33:43 +0000 (11:33 +0800)] 
i386: testsuite: Add -no-pie for pr113689-1.c [PR70150]

For a --enable-default-pie build, using -fno-pic (for compiler) but
not -no-pie (for linker) triggers some linker warnings counted as
excess errors:

    /usr/bin/ld: /tmp/cc8MgxiR.o: warning: relocation in read-only
    section `.text.startup'
    /usr/bin/ld: warning: creating DT_TEXTREL in a PIE

gcc/testsuite/ChangeLog:

PR testsuite/70150
* gcc.target/i386/pr113689-1.c (dg-options): Add -no-pie.

(cherry picked from commit 331f7d8a393af99afccdb2729d4ab45797fd7a86)

11 months agoDaily bump.
GCC Administrator [Wed, 28 Aug 2024 00:24:02 +0000 (00:24 +0000)] 
Daily bump.

11 months agoUpdate gcc zh_CN.po
Joseph Myers [Tue, 27 Aug 2024 21:21:58 +0000 (21:21 +0000)] 
Update gcc zh_CN.po

* zh_CN.po: Update.

11 months agoMIPS: Include missing mips16.S in libgcc/lib1funcs.S
YunQiang Su [Fri, 23 Aug 2024 15:46:16 +0000 (23:46 +0800)] 
MIPS: Include missing mips16.S in libgcc/lib1funcs.S

mips16.S was missing since
commit 29b74545531f6afbee9fc38c267524326dbfbedf
Date:   Thu Jun 1 10:14:24 2023 +0800

    MIPS: Add speculation_barrier support

Without mips16.S included, some symbols will miss for mips16, and
so some software will fail to build.

libgcc/ChangeLog:

* config/mips/lib1funcs.S: Includes mips16.S.

(cherry picked from commit 9522fc8bb7812f2ad50eb038e0938bfd958e730f)

11 months agoDaily bump.
GCC Administrator [Mon, 26 Aug 2024 00:23:14 +0000 (00:23 +0000)] 
Daily bump.

11 months agoDaily bump.
GCC Administrator [Sun, 25 Aug 2024 00:23:36 +0000 (00:23 +0000)] 
Daily bump.

11 months agoDaily bump.
GCC Administrator [Sat, 24 Aug 2024 00:22:38 +0000 (00:22 +0000)] 
Daily bump.

11 months agoDaily bump.
GCC Administrator [Fri, 23 Aug 2024 00:21:22 +0000 (00:21 +0000)] 
Daily bump.

11 months agoAlign ix86_{move_max,store_max} with vectorizer.
liuhongt [Thu, 15 Aug 2024 04:54:07 +0000 (12:54 +0800)] 
Align ix86_{move_max,store_max} with vectorizer.

When none of mprefer-vector-width, avx256_optimal/avx128_optimal,
avx256_store_by_pieces/avx512_store_by_pieces is specified, GCC will
set ix86_{move_max,store_max} as max available vector length except
for AVX part.

      if (TARGET_AVX512F_P (opts->x_ix86_isa_flags)
  && TARGET_EVEX512_P (opts->x_ix86_isa_flags2))
opts->x_ix86_move_max = PVW_AVX512;
      else
opts->x_ix86_move_max = PVW_AVX128;

So for -mavx2, vectorizer will choose 256-bit for vectorization, but
128-bit is used for struct copy, there could be a potential STLF issue
due to this "misalign".

The patch fixes that.

gcc/ChangeLog:

* config/i386/i386-options.cc (ix86_option_override_internal):
set ix86_{move_max,store_max} to PVW_AVX256 when TARGET_AVX
instead of PVW_AVX128.

gcc/testsuite/ChangeLog:
* gcc.target/i386/pieces-memcpy-10.c: Add -mprefer-vector-width=128.
* gcc.target/i386/pieces-memcpy-6.c: Ditto.
* gcc.target/i386/pieces-memset-38.c: Ditto.
* gcc.target/i386/pieces-memset-40.c: Ditto.
* gcc.target/i386/pieces-memset-41.c: Ditto.
* gcc.target/i386/pieces-memset-42.c: Ditto.
* gcc.target/i386/pieces-memset-43.c: Ditto.
* gcc.target/i386/pieces-strcpy-2.c: Ditto.
* gcc.target/i386/pieces-memcpy-22.c: New test.
* gcc.target/i386/pieces-memset-51.c: New test.
* gcc.target/i386/pieces-strcpy-3.c: New test.

(cherry picked from commit 6ea25c041964bf63014fcf7bb68fb1f5a0a4e123)

11 months agoDaily bump.
GCC Administrator [Thu, 22 Aug 2024 00:22:57 +0000 (00:22 +0000)] 
Daily bump.

11 months agoDaily bump.
GCC Administrator [Wed, 21 Aug 2024 00:24:10 +0000 (00:24 +0000)] 
Daily bump.

11 months ago[testsuite] [arm] [vect] adjust mve-vshr test [PR113281]
Alexandre Oliva [Wed, 26 Jun 2024 05:08:18 +0000 (02:08 -0300)] 
[testsuite] [arm] [vect] adjust mve-vshr test [PR113281]

The test was too optimistic, alas.  We used to vectorize shifts by
clamping the shift counts below the bit width of the types (e.g. at 15
for 16-bit vector elements), but (uint16_t)32768 >> (uint16_t)16 is
well defined (because of promotion to 32-bit int) and must yield 0,
not 1 (as before the fix).

Unfortunately, in the gimple model of vector units, such large shift
counts wouldn't be well-defined, so we won't vectorize such shifts any
more, unless we can tell they're in range or undefined.

So the test that expected the vectorization we no longer performed
needs to be adjusted.  Instead of nobbling the test, Richard Earnshaw
suggested annotating the test with the expected ranges so as to enable
the optimization, and Christophe Lyon suggested a further
simplification.

Co-Authored-By: Richard Earnshaw <Richard.Earnshaw@arm.com>
for  gcc/testsuite/ChangeLog

PR tree-optimization/113281
* gcc.target/arm/simd/mve-vshr.c: Add expected ranges.

(cherry picked from commit 54d2339c9f87f702e02e571a5460e11c19e1c02f)

11 months agoDaily bump.
GCC Administrator [Tue, 20 Aug 2024 00:23:37 +0000 (00:23 +0000)] 
Daily bump.

11 months agoc++: fix ICE in convert_nontype_argument [PR116384]
Marek Polacek [Thu, 15 Aug 2024 15:53:10 +0000 (11:53 -0400)] 
c++: fix ICE in convert_nontype_argument [PR116384]

Here we ICE since r14-8291 in C++11/C++14 modes.  Fortunately
this is an easy one.

The important bit of r14-8291 is this:

@@ -20056,9 +20071,12 @@ tsubst_expr (tree t, tree args, tsubst_flags_t complain, tree in_decl)
        RETURN (retval);
      }
    if (IMPLICIT_CONV_EXPR_NONTYPE_ARG (t))
-     /* We'll pass this to convert_nontype_argument again, we don't need
-        to actually perform any conversion here.  */
-     RETURN (expr);
+     {
+       tree r = convert_nontype_argument (type, expr, complain);
+       if (r == NULL_TREE)
+         r = error_mark_node;
+       RETURN (r);
+     }

which obviously means that instead of returning right away we go
to convert_nontype_argument.  When type is error_mark_node and we're
in C++17, in convert_nontype_argument we go down this path:

      else if (INTEGRAL_OR_ENUMERATION_TYPE_P (type)
               || cxx_dialect >= cxx17)
        {
          expr = build_converted_constant_expr (type, expr, complain);
          if (expr == error_mark_node)
            return (complain & tf_error) ? NULL_TREE : error_mark_node;
  // ...
}

but pre-C++17, we take a different route and end up crashing on
gcc_unreachable.

It would of course also work to check for error_mark_node early in
build_converted_constant_expr.

PR c++/116384

gcc/cp/ChangeLog:

* pt.cc (tsubst_expr) <case IMPLICIT_CONV_EXPR>: Bail if tsubst
returns error_mark_node.

gcc/testsuite/ChangeLog:

* g++.dg/cpp0x/vt-116384.C: New test.

(cherry picked from commit 8191f15022b0ea44fcb549449b0458d07ae02e0a)

11 months agotestsuite: Prune warning about size of enums
Torbjörn SVENSSON [Mon, 19 Aug 2024 08:44:44 +0000 (10:44 +0200)] 
testsuite: Prune warning about size of enums

This fixes reported regression at
https://linaro.atlassian.net/browse/GNU-1315.

gcc/testsuite/ChangeLog:

* g++.dg/warn/pr33738-2.C: dg-prune arm linker messages about
size of enums.

Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
(cherry picked from commit 6d8b9b772e0b3969e6b3fcf0363d6afcce2e65c9)

11 months agoDaily bump.
GCC Administrator [Mon, 19 Aug 2024 00:21:54 +0000 (00:21 +0000)] 
Daily bump.

11 months agoAVR: ad target/116407 - Fix linker error "relocation truncated to fit".
Georg-Johann Lay [Sun, 18 Aug 2024 15:07:15 +0000 (17:07 +0200)] 
AVR: ad target/116407 - Fix linker error "relocation truncated to fit".

PR target/116407
gcc/
* config/avr/avr.md (*dec-and-branchhi!=-1.l.clobber):
Increase the additional jump offset to 2 words.

(cherry picked from commit 22acd3c4d18dbd4d4d39d7770145fe3ec36073f6)

11 months agoAVR: target/116407 - Fix linker error "relocation truncated to fit".
Georg-Johann Lay [Sun, 18 Aug 2024 13:00:55 +0000 (15:00 +0200)] 
AVR: target/116407 - Fix linker error "relocation truncated to fit".

Some text peepholes output extra instructions prior to a branch
instruction and that increase the jump offset of backward branches.

PR target/116407
gcc/
* config/avr/avr-protos.h (avr_jump_mode): Add an int argument.
* config/avr/avr.cc (avr_jump_mode): Add an int argument to increase
the computed jump offset of backwards branches.
* config/avr/avr.md (*dec-and-branchhi!=-1, *dec-and-branchsi!=-1):
Increase the jump offset used by avr_jump_mode() as needed.
gcc/testsuite/
* gcc.target/avr/torture/pr116407-2.c: New test.
* gcc.target/avr/torture/pr116407-4.c: New test.

(cherry picked from commit dfb2e8caa85d1059a0ab8ed4f19568c04c9f13a4)

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

11 months agoAVR: target/116390 - Fix an avrtiny asm out template.
Georg-Johann Lay [Sat, 17 Aug 2024 10:49:42 +0000 (12:49 +0200)] 
AVR: target/116390 - Fix an avrtiny asm out template.

PR target/116390
gcc/
* config/avr/avr.cc (avr_out_movsi_mr_r_reg_disp_tiny): Fix
output templates for the reg_base == reg_src and
reg_src == reg_base - 2 cases.
gcc/testsuite/
* gcc.target/avr/torture/pr116390.c: New test.

(cherry picked from commit 4065d163151b07b274241377e71dad028576db88)

11 months agoDaily bump.
GCC Administrator [Sat, 17 Aug 2024 00:21:45 +0000 (00:21 +0000)] 
Daily bump.

11 months agoAVR: target/85624 - Use HImode for clrmemqi alignment.
Georg-Johann Lay [Fri, 16 Aug 2024 16:13:34 +0000 (18:13 +0200)] 
AVR: target/85624 - Use HImode for clrmemqi alignment.

gcc/
PR target/85624
* config/avr/avr.md (*clrmemqi*): Use HImode for alignment operand.

gcc/testsuite/
* gcc.target/avr/torture/pr85624.c: New test.

11 months agotestsuite: Verify -fshort-enums and -fno-short-enums in pr33738.C
Torbjörn SVENSSON [Fri, 16 Aug 2024 12:43:41 +0000 (14:43 +0200)] 
testsuite: Verify -fshort-enums and -fno-short-enums in pr33738.C

For some targets, like Cortex-M on arm-none-eabi, the -fshort-enums is
enabled by default. For these targets, the test case fails as
sizeof(Alpha) < sizeof(int).
To make the test case behave identical for targets that does enable
-fshort-enums and those that does not, add -fno-short-enums in the test
case and verify that the warning is not emitted. Then also create a copy
and run the test with -fshort-enums and verify that the warning is
emitted.

Regtested on x86_64-pc-linux-gnu and arm-none-eabi.

gcc/testsuite/ChangeLog:

* g++.dg/warn/pr33738.C: Added -fno-short-enums.
* g++.dg/warn/pr33738-2.C: Duplicate g++.dg/warn/pr33738.C with
-fshort-enums and removed xfail.

Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
(cherry picked from commit 479dab62b828f93d6be48241178dbf654bdd33e7)