[gcc/redhat/heads/gcc-14-branch] (292 commits) Merge commit 'r14-9499-g53fb2cf75965e4dbcf145a12d8ae41f4667

2024-03-16 Thread Jakub Jelinek via Gcc-cvs
The branch 'redhat/heads/gcc-14-branch' was updated to point to:

 6b39b05bec8... Merge commit 'r14-9499-g53fb2cf75965e4dbcf145a12d8ae41f4667

It previously pointed to:

 cfee1bffd9e... Merge commit 'r14-9208-g92f07eb406612fa341dc33d9d6e4f3781dc

Diff:

Summary of changes (added commits):
---

  6b39b05... Merge commit 'r14-9499-g53fb2cf75965e4dbcf145a12d8ae41f4667
  53fb2cf... Daily bump. (*)
  a6dab19... libgcc: Fix quotient and/or remainder negation in __divmodb (*)
  ffd47fb... testsuite: Fix pr113431.c FAIL on sparc* [PR113431] (*)
  b5e1f06... Regenerate opt.urls (*)
  30e1c3d... lower-subreg, edit-context: Fix comment typos (*)
  ab2da8f... i386: Fix a pasto in ix86_expand_int_sse_cmp [PR114339] (*)
  7dd3b2b... match.pd: Only merge truncation with conversion for -fno-si (*)
  0319f26... expand: EXTEND_BITINT CALL_EXPR results [PR114332] (*)
  8ae7062... testsuite: Fix up pr104601.C for recent libstdc++ changes (*)
  90b9872... bitint: Fix up adjustment of large/huge _BitInt arguments o (*)
  3fd46d8... Fortran: Fix class/derived/complex function associate selec (*)
  acc38ff... MIPS: Add -m(no-)strict-align option (*)
  81f3d96... vect: Call vect_convert_output with the right vecitype [PR1 (*)
  d7d0582... LoongArch: Remove masking process for operand 3 of xvpermi. (*)
  c1f6690... Daily bump. (*)
  efab888... tree-core: clarify clobber comments (*)
  6dbf0d2... PR modula2/114294 expression causes ICE (*)
  53fd0f5... hppa: Fix REG+D address support before reload (*)
  6cf4286... bpf: define INT8_TYPE as signed char (*)
  bc5a9da... gcc: xtensa: reorder movsi_internal patterns for better cod (*)
  f89cfdb... libstdc++: Fix std::format("{}", negative_integer) [PR11432 (*)
  df483eb... libstdc++: Add nodiscard in  (*)
  fd71043... gcn: Fix a comment typo (*)
  7580e39... icf: Reset SSA_NAME_{PTR,RANGE}_INFO in successfully merged (*)
  7aeedff... PR modula2/114333 set type comparison against cardinal shou (*)
  f98b85b... LoongArch: Remove unused and incorrect "sge_ stores in callees rather than cal (*)
  39737cd... strlen: Fix another spot that can create invalid ranges [PR (*)
  cdf0c66... RISC-V: Fix some code style issue(s) in riscv-c.cc [NFC] (*)
  c0c5724... tree-optimization/114297 - SLP reduction with early break f (*)
  c4e5789... Reject -fno-multiflags [PR114314] (*)
  0628916... Daily bump. (*)
  0c17965... libgfortran: [PR114304] Revert portion of PR105347 change. (*)
  9b32438... Update gcc sv.po (*)
  c27b305... gomp: testsuite: improve compatibility of bad-array-section (*)
  8410402... PR modula2/114295 Incorrect location if compiling implement (*)
  4e1fcf4... testsuite: vect: Require vect_hw_misalign in gcc.dg/vect/ve (*)
  96b63fa... testsuite: vect: Require vect_perm in several tests [PR1140 (*)
  1bf70e6... aarch64,arm: Move branch-protection data to targets (*)
  119f5ae... middle-end/114299 - missing error recovery from gimplify fa (*)
  dbe5ccd... bitint: Avoid rewriting large/huge _BitInt vars into SSA af (*)
  0c4df2c... Fix placement of recently implemented DIE (*)
  31ce2e9... Fold: Fix up merge_truthop_with_opposite_arm for NaNs [PR95 (*)
  1a4553b... Daily bump. (*)
  a84b98c... d: Fix -fpreview=in ICEs with forward referenced parameter  (*)
  8fe27ed... [committed] [PR tree-optimization/110199] Simplify MIN/MAX  (*)
  993c6de... VECT: Fix ICE for vectorizable LD/ST when both len and stor (*)
  6f7d000... Revert "[committed] Adjust expectations for pr59533-1.c" (*)
  7c8f0a7... [committed] [target/102250] Document python requirement for (*)
  50531b6... [committed] [PR target/111362] Fix compare-debug issue with (*)
  3e05eb9... Daily bump. (*)
  f5a805d... AVR: Fix typos in comment, indentation glitches in avr.md. (*)
  3e3e415... fwprop: Restore previous behavior for forward propagation o (*)
  42cd49a... LoongArch: Emit R_LARCH_RELAX for TLS IE with non-extreme c (*)
  e8cc1f9... AVR: Add cost computation for some insn combine patterns. (*)
  e9753f4... i386: Regenerate i386.opt.urls (*)
  6fe6301... LoongArch: testsuite: Add compilation options to the regnam (*)
  3a3fbec... LoongArch: Fixed an issue with the implementation of the te (*)
  3e8ee03... libstdc++: Do not require a time-of-day when parsing sys_da (*)
  f4a52c1... libstdc++: Fix parsing of leap seconds as chrono::utc_time  (*)
  c775a03... Daily bump. (*)
  54e505d... ipa: Avoid excessive removing of SSAs (PR 113757) (*)
  5825bd0... libbacktrace: don't assume compressed section is aligned (*)
  cebbaa2... [PR113790][LRA]: Fixing LRA ICE on riscv64 (*)
  0e850ef... bpf: add size threshold for inlining mem builtins (*)
  ac829a8... arm: testsuite: tweak bics_3.c [PR113542] (*)
  10c6091... bpf: testsuite: fix unresolved test in memset-1.c (*)
  84fc8f4... GCN: The original meaning of 'GCN_SUPPRESS_HOST_FALLBACK' i (*)
  37078f2... nvptx: 'cuDeviceGetCount' failure is fatal (*)
  ab70add... GCN, nvptx: Fatal error for missing symbols in 'libhsa-runt (*)
  5119c79... ARM: Fix 

[gcc(refs/vendors/redhat/heads/gcc-14-branch)] Merge commit 'r14-9499-g53fb2cf75965e4dbcf145a12d8ae41f4667a8498' into redhat/gcc-14-branch

2024-03-16 Thread Jakub Jelinek via Gcc-cvs
https://gcc.gnu.org/g:6b39b05bec8ee5bdda84c676c8f6458bb754fe79

commit 6b39b05bec8ee5bdda84c676c8f6458bb754fe79
Merge: cfee1bffd9e 53fb2cf7596
Author: Jakub Jelinek 
Date:   Sat Mar 16 09:11:08 2024 +0100

Merge commit 'r14-9499-g53fb2cf75965e4dbcf145a12d8ae41f4667a8498' into 
redhat/gcc-14-branch

Diff:

 ChangeLog  |   12 +
 MAINTAINERS|3 +
 contrib/ChangeLog  |   18 +
 contrib/dg-extract-results.sh  |   17 +-
 contrib/gcc-changelog/git_commit.py|1 +
 contrib/mklog.py   |2 +-
 contrib/test_mklog.py  |2 +-
 gcc/ChangeLog  | 1378 
 gcc/DATESTAMP  |2 +-
 gcc/ada/ChangeLog  |6 +
 gcc/ada/exp_ch4.adb|6 +-
 gcc/analyzer/ChangeLog |   96 +
 gcc/analyzer/access-diagram.cc |1 +
 gcc/analyzer/analyzer.cc   |9 +
 gcc/analyzer/analyzer.h|3 +
 gcc/analyzer/call-info.cc  |8 +
 gcc/analyzer/call-info.h   |1 +
 gcc/analyzer/call-summary.cc   |7 +-
 gcc/analyzer/call-summary.h|2 +-
 gcc/analyzer/checker-event.h   |2 +-
 gcc/analyzer/diagnostic-manager.cc |2 +-
 gcc/analyzer/engine.cc |   83 +-
 gcc/analyzer/exploded-graph.h  |8 +-
 gcc/analyzer/program-point.cc  |4 +-
 gcc/analyzer/program-point.h   |4 +-
 gcc/analyzer/program-state.cc  |4 +-
 gcc/analyzer/program-state.h   |4 +-
 gcc/analyzer/record-layout.cc  |1 +
 gcc/analyzer/region-model-manager.cc   |2 +-
 gcc/analyzer/region-model-manager.h|2 +-
 gcc/analyzer/region-model.cc   |   42 +-
 gcc/analyzer/region-model.h|4 +-
 gcc/analyzer/region.cc |   10 +-
 gcc/analyzer/region.h  |   18 +-
 gcc/analyzer/sm-malloc.cc  |1 +
 gcc/analyzer/sm-signal.cc  |   13 +-
 gcc/analyzer/state-purge.cc|   29 +-
 gcc/analyzer/state-purge.h |   15 +-
 gcc/analyzer/supergraph.cc |5 +-
 gcc/analyzer/supergraph.h  |8 +-
 gcc/asan.cc|   36 +-
 gcc/bb-reorder.cc  |6 +-
 gcc/btfout.cc  |   28 +-
 gcc/c-family/ChangeLog |   19 +
 gcc/c-family/c-common.cc   |   22 +-
 gcc/c-family/c.opt |4 +
 gcc/c-family/c.opt.urls|  352 +--
 gcc/c/ChangeLog|   17 +
 gcc/c/c-objc-common.cc |   23 +
 gcc/c/c-objc-common.h  |3 +
 gcc/c/c-parser.cc  |   68 +-
 gcc/c/c-tree.h |1 +
 gcc/calls.cc   |7 +-
 gcc/combine.cc |   17 +-
 gcc/common.opt |2 +-
 gcc/common.opt.urls|4 +-
 gcc/common/config/avr/avr-common.cc|2 +
 gcc/config.gcc |7 +-
 gcc/config/aarch64/aarch64-builtins.cc |2 +-
 gcc/config/aarch64/aarch64-c.cc|4 +-
 gcc/config/aarch64/aarch64-early-ra.cc |   20 +-
 gcc/config/aarch64/aarch64-feature-deps.h  |3 +
 gcc/config/aarch64/aarch64-sme.md  |   70 -
 gcc/config/aarch64/aarch64.cc  |  145 +-
 gcc/config/aarch64/aarch64.md  |5 +-
 gcc/config/aarch64/aarch64.opt |2 +-
 gcc/config/alpha/alpha.md  |   37 +-
 gcc/config/arm/aarch-common-protos.h   |   19 +-
 gcc/config/arm/aarch-common.cc |   71 +-
 gcc/config/arm/aarch-common.h  |   20 -
 gcc/config/arm/arm-c.cc|2 -
 gcc/config/arm/arm.cc  |   60 +-
 gcc/config/arm/arm.h   |   15 +
 gcc/config/arm/arm.md  |   18 +
 gcc/config/arm/arm.opt |3 -
 gcc/config/arm/iterators.md| 

[gcc/redhat/heads/gcc-13-branch] (335 commits) Merge commit 'r13-8456-g5acf62723967605ad9037d83c3dc0fb2c8c

2024-03-16 Thread Jakub Jelinek via Gcc-cvs
The branch 'redhat/heads/gcc-13-branch' was updated to point to:

 6facfa150db... Merge commit 'r13-8456-g5acf62723967605ad9037d83c3dc0fb2c8c

It previously pointed to:

 f783814ad6a... Merge commit 'r13-8122-g0dd097f6a0951c386233fc0b96584ebe414

Diff:

Summary of changes (added commits):
---

  6facfa1... Merge commit 'r13-8456-g5acf62723967605ad9037d83c3dc0fb2c8c
  5acf627... Daily bump. (*)
  73898ce... gimple-iterator: Some gsi_safe_insert_*before fixes (*)
  8473919... asan: Fix ICE during instrumentation of returns_twice calls (*)
  3d231fa... gimple-iterator, ubsan: Fix ICE during instrumentation of r (*)
  ec5cb2a... i386: Fix a pasto in ix86_expand_int_sse_cmp [PR114339] (*)
  9f255e4... icf: Reset SSA_NAME_{PTR,RANGE}_INFO in successfully merged (*)
  1c907ce... aarch64: Fix TImode __sync_*_compare_and_exchange expansion (*)
  8c4785e... contrib: Improve dg-extract-results.sh's Python detection [ (*)
  6b69cbe... bb-reorder: Fix -freorder-blocks-and-partition ICEs on aarc (*)
  df3994a... lower-subreg: Fix ROTATE handling [PR114211] (*)
  128860a... i386: Fix ICEs with SUBREGs from vector etc. constants to X (*)
  4e9f475... Fortran: handle procedure pointer component in DT array [PR (*)
  337dc58... Fortran: allow RESTRICT qualifier also for optional argumen (*)
  90442fb... Fortran: improve checks of NULL without MOLD as actual argu (*)
  ba4b4b3... testsuite: fortran: fix invalid testcases (missing MOLD arg (*)
  d92942e... libstdc++: Fix typo in C++20 status table (*)
  c471d29... testsuite: Added missing } in the dg-bogus comment [PR11434 (*)
  7d2d6e1... Daily bump. (*)
  bdbcfbf... i386[stv]: Handle REG_EH_REGION note (*)
  f3d49b9... Daily bump. (*)
  618db8d... ada: Fix error message for Aggregate aspect (*)
  6c8e7aa... ada: Fix (again) incorrect handling of Aggregate aspect (*)
  bc97504... ada: Fix incorrect handling of Aggregate aspect (*)
  1277f69... testsuite: xfail test for short_enums (*)
  a875cf8... Daily bump. (*)
  1870ee4... libstdc++: Update expiry times for leap seconds lists (*)
  826f7e5... libstdc++: Fix std::basic_format_arg::handle for BasicForma (*)
  3c8faea... libstdc++: Implement P2905R2 "Runtime format strings" for C (*)
  2d3cc68... libstdc++: Remove UB from month and weekday additions and s (*)
  e3e5bde... libstdc++: Improve operator-(weekday x, weekday y) (*)
  3cbaada... libstdc++: Simplify year::is_leap() (*)
  29dc5fb... libstdc++: Remove unnecessary "& 1" from year_month_day_las (*)
  d147271... libstdc++: Fix UB in weekday::weekday(sys_days) and add tes (*)
  779563c... libstdc++: Add [[nodiscard]] to std::span members (*)
  66c55e4... libstdc++: Fix a -Wsign-compare warning in std::list (*)
  4c6bb36... libstdc++: Optimize std::to_array for trivial types [PR1101 (*)
  ac96973... Fold: Fix up merge_truthop_with_opposite_arm for NaNs [PR95 (*)
  4bd9d09... Reject -fno-multiflags [PR114314] (*)
  8f81688... Daily bump. (*)
  824a71f... libgfortran: [PR114304] Revert portion of PR105347 change. (*)
  6d70807... Daily bump. (*)
  025ff57... d: Fix -fpreview=in ICEs with forward referenced parameter  (*)
  9de9ff3... Daily bump. (*)
  bf78493... LoongArch: Fixed an issue with the implementation of the te (*)
  abe32a9... Daily bump. (*)
  7ecea49... libgfortran: [PR105473] Fix checks for decimal='comma'. (*)
  4554506... Daily bump. (*)
  0e591e6... Fix bogus error on allocator for array type with Dynamic_Pr (*)
  58cbab9... Daily bump. (*)
  1f5787e... Fortran: do not evaluate polymorphic functions twice in ass (*)
  77cf842... Fortran: ALLOCATE statement, SOURCE/MOLD expressions with s (*)
  7b34983... Daily bump. (*)
  8891ac6... Daily bump. (*)
  902e1fc... Daily bump. (*)
  a38b3df... SH: Fix 101737 (*)
  cdcbc56... d: Fix gdc -O2 -mavx generates misaligned vmovdqa instructi (*)
  8b264f9... Daily bump. (*)
  e64fbf3... d: Fix callee destructor call invalidates the live object [ (*)
  341fa4d... d: Fix internal compiler error: in make_import, at d/import (*)
  96e6576... calls: Further fixes for TYPE_NO_NAMED_ARGS_STDARG_P handli (*)
  5de9163... function: Fix another TYPE_NO_NAMED_ARGS_STDARG_P spot (*)
  ed35889... graphite: Fix non-INTEGER_TYPE integral comparison handling (*)
  84017b7... testsuite: Add c23-stdarg-4.c test variant where all functi (*)
  6b8d8a8... match.pd: Guard 2 simplifications on integral TYPE_OVERFLOW (*)
  051cd2a... c: Handle scoped attributes in __has*attribute and scoped a (*)
  856a66a... call-cdce: Add missing BUILT_IN_*F{32,64}X handling and imp (*)
  9de6ff5... attribs: Don't canonicalize lookup_scoped_attribute_spec ar (*)
  e084a64... gimple-low: Fix up handling of volatile automatic vars in a (*)
  f03c78b... ggc-common: Fix save PCH assertion (*)
  21d7bff... simplify-rtx: Fix up last argument to simplify_gen_unary [P (*)
  7bc85af... tree-ssa-strlen: Fix up handle_store [PR113603] (*)
  2ff9cea... docs: Fix 2 typos (*)
  8b2a402... i386: Add -masm=intel profiling support [PR113122] (

[gcc(refs/vendors/redhat/heads/gcc-13-branch)] Merge commit 'r13-8456-g5acf62723967605ad9037d83c3dc0fb2c8ca9669' into redhat/gcc-13-branch

2024-03-16 Thread Jakub Jelinek via Gcc-cvs
https://gcc.gnu.org/g:6facfa150dbfe6626c3f2b8d5d5ef8252317

commit 6facfa150dbfe6626c3f2b8d5d5ef8252317
Merge: f783814ad6a 5acf6272396
Author: Jakub Jelinek 
Date:   Sat Mar 16 09:26:51 2024 +0100

Merge commit 'r13-8456-g5acf62723967605ad9037d83c3dc0fb2c8ca9669' into 
redhat/gcc-13-branch

Diff:

 contrib/ChangeLog  |9 +
 contrib/dg-extract-results.sh  |   17 +-
 fixincludes/ChangeLog  |7 +
 fixincludes/fixincl.x  |8 +-
 fixincludes/inclhack.def   |7 +-
 fixincludes/tests/base/math.h  |1 +
 gcc/ChangeLog  |  917 +
 gcc/DATESTAMP  |2 +-
 gcc/ada/ChangeLog  |  115 +
 gcc/ada/einfo-utils.adb|2 +-
 gcc/ada/einfo.ads  |2 +-
 gcc/ada/exp_attr.adb   |   63 +-
 gcc/ada/exp_ch3.adb|  101 +-
 gcc/ada/exp_ch4.adb|2 -
 gcc/ada/exp_ch6.adb|  258 +-
 gcc/ada/exp_ch6.ads|3 +-
 gcc/ada/exp_ch7.adb|   13 +
 gcc/ada/exp_intr.adb   |   45 -
 gcc/ada/exp_util.adb   |   15 +-
 gcc/ada/gcc-interface/utils2.cc|   12 +-
 gcc/ada/sem_aggr.adb   |9 +-
 gcc/ada/sem_ch12.adb   |3 +-
 gcc/ada/sem_ch13.adb   |   12 +-
 gcc/ada/sem_ch3.adb|   11 +-
 gcc/ada/sem_ch4.adb|4 +-
 gcc/ada/sem_ch6.adb|  185 +-
 gcc/ada/sem_res.adb|   14 +-
 gcc/ada/sem_util.adb   |9 +-
 gcc/asan.cc|   12 +-
 gcc/attribs.cc |   10 -
 gcc/bb-reorder.cc  |3 +-
 gcc/c-family/ChangeLog |   27 +
 gcc/c-family/c-attribs.cc  |   32 +-
 gcc/c-family/c-lex.cc  |   32 +-
 gcc/c-family/c-pch.cc  |5 +-
 gcc/calls.cc   |7 +-
 gcc/cfgexpand.cc   |   32 +-
 gcc/cfgrtl.cc  |   24 +-
 gcc/cfgrtl.h   |1 +
 gcc/combine.cc |   12 +-
 gcc/common.opt |2 +-
 gcc/common/config/avr/avr-common.cc|6 -
 gcc/config.in  |   12 +
 gcc/config/aarch64/aarch64-builtins.cc |2 +-
 gcc/config/aarch64/aarch64-cores.def   |1 +
 gcc/config/aarch64/aarch64-tune.md |2 +-
 gcc/config/aarch64/aarch64.cc  |   15 +-
 gcc/config/aarch64/aarch64.md  |   35 +-
 gcc/config/aarch64/iterators.md|3 +
 gcc/config/arm/neon.md |4 +-
 gcc/config/avr/avr-arch.h  |1 +
 gcc/config/avr/avr-c.cc|1 +
 gcc/config/avr/avr-devices.cc  |   16 +
 gcc/config/avr/avr-mcus.def|   26 +-
 gcc/config/avr/avr-protos.h|1 +
 gcc/config/avr/avr.cc  |  211 +-
 gcc/config/avr/avr.h   |3 +
 gcc/config/avr/avr.md  |   47 +-
 gcc/config/avr/avr.opt |   10 +-
 gcc/config/avr/driver-avr.cc   |   27 +-
 gcc/config/avr/gen-avr-mmcu-specs.cc   |   20 +-
 gcc/config/i386/amxtileintrin.h|4 +-
 gcc/config/i386/driver-i386.cc |5 +-
 gcc/config/i386/i386-builtin.def   |4 +
 gcc/config/i386/i386-expand.cc |   38 +-
 gcc/config/i386/i386-features.cc   |   50 +-
 gcc/config/i386/i386-features.h|1 +
 gcc/config/i386/i386.cc|   93 +-
 gcc/config/i386/i386.h |2 +-
 gcc/config/i386/i386.md|   29 +-
 gcc/config/i386/mmx.md |5 +-
 gcc/config/i386/sse.md |5 +-
 gcc/config/loongarch/genopts/loongarch.opt.in  |   11 +-
 gcc/config/loongarch/gnu-user.h|3 +-
 gcc/config/loongarch/loongarch-opts.h  |   12 +
 gcc/config/loongarch/loongarch.cc  |

[gcc r14-9500] libcc1: fix include

2024-03-16 Thread François-Xavier Coudert via Gcc-cvs
https://gcc.gnu.org/g:5213047b1d50af63dfabb5e5649821a6cb157e33

commit r14-9500-g5213047b1d50af63dfabb5e5649821a6cb157e33
Author: Francois-Xavier Coudert 
Date:   Sat Mar 16 09:50:00 2024 +0100

libcc1: fix  include

Use INCLUDE_VECTOR before including system.h, instead of directly
including , to avoid running into poisoned identifiers.

Signed-off-by: Dimitry Andric 

libcc1/ChangeLog:

PR middle-end/111632
* libcc1plugin.cc: Fix include.
* libcp1plugin.cc: Fix include.

Diff:
---
 libcc1/libcc1plugin.cc | 3 +--
 libcc1/libcp1plugin.cc | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/libcc1/libcc1plugin.cc b/libcc1/libcc1plugin.cc
index 72d17c3b81c..e64847466f4 100644
--- a/libcc1/libcc1plugin.cc
+++ b/libcc1/libcc1plugin.cc
@@ -32,6 +32,7 @@
 #undef PACKAGE_VERSION
 
 #define INCLUDE_MEMORY
+#define INCLUDE_VECTOR
 #include "gcc-plugin.h"
 #include "system.h"
 #include "coretypes.h"
@@ -69,8 +70,6 @@
 #include "gcc-c-interface.h"
 #include "context.hh"
 
-#include 
-
 using namespace cc1_plugin;
 
 
diff --git a/libcc1/libcp1plugin.cc b/libcc1/libcp1plugin.cc
index 0eff7c68d29..da68c5d0ac1 100644
--- a/libcc1/libcp1plugin.cc
+++ b/libcc1/libcp1plugin.cc
@@ -33,6 +33,7 @@
 #undef PACKAGE_VERSION
 
 #define INCLUDE_MEMORY
+#define INCLUDE_VECTOR
 #include "gcc-plugin.h"
 #include "system.h"
 #include "coretypes.h"
@@ -71,8 +72,6 @@
 #include "rpc.hh"
 #include "context.hh"
 
-#include 
-
 using namespace cc1_plugin;


[gcc r13-8457] libstdc++: Add missing std::tuple constructor [PR114147]

2024-03-16 Thread Jonathan Wakely via Libstdc++-cvs
https://gcc.gnu.org/g:8a0a24b9a097452c576d5f409fe7efbafd6aef6b

commit r13-8457-g8a0a24b9a097452c576d5f409fe7efbafd6aef6b
Author: Jonathan Wakely 
Date:   Fri Mar 1 11:16:58 2024 +

libstdc++: Add missing std::tuple constructor [PR114147]

I caused a regression with commit r10-908 by adding a constraint to the
non-explicit allocator-extended default constructor, but seemingly
forgot to add an explicit overload with the corresponding constraint.

libstdc++-v3/ChangeLog:

PR libstdc++/114147
* include/std/tuple (tuple::tuple(allocator_arg_t, const Alloc&)):
Add missing overload of allocator-extended default constructor.
(tuple::tuple(allocator_arg_t, const Alloc&)): Likewise.
* testsuite/20_util/tuple/cons/114147.cc: New test.

(cherry picked from commit 0a545ac7000501844670add0b3560ebdbcb123c6)

Diff:
---
 libstdc++-v3/include/std/tuple  | 14 ++
 libstdc++-v3/testsuite/20_util/tuple/cons/114147.cc | 15 +++
 2 files changed, 29 insertions(+)

diff --git a/libstdc++-v3/include/std/tuple b/libstdc++-v3/include/std/tuple
index c9ea2a892b4..f0183ffe827 100644
--- a/libstdc++-v3/include/std/tuple
+++ b/libstdc++-v3/include/std/tuple
@@ -971,6 +971,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
tuple(allocator_arg_t __tag, const _Alloc& __a)
: _Inherited(__tag, __a) { }
 
+  template::value> = false>
+   _GLIBCXX20_CONSTEXPR
+   explicit
+   tuple(allocator_arg_t __tag, const _Alloc& __a)
+   : _Inherited(__tag, __a) { }
+
   template= 1),
   _ImplicitCtor<_NotEmpty, const _Elements&...> = true>
_GLIBCXX20_CONSTEXPR
@@ -1453,6 +1460,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
tuple(allocator_arg_t __tag, const _Alloc& __a)
: _Inherited(__tag, __a) { }
 
+  template::value, _T1, _T2> = false>
+   _GLIBCXX20_CONSTEXPR
+   explicit
+   tuple(allocator_arg_t __tag, const _Alloc& __a)
+   : _Inherited(__tag, __a) { }
+
   template = true>
_GLIBCXX20_CONSTEXPR
diff --git a/libstdc++-v3/testsuite/20_util/tuple/cons/114147.cc 
b/libstdc++-v3/testsuite/20_util/tuple/cons/114147.cc
new file mode 100644
index 000..916e7204964
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/tuple/cons/114147.cc
@@ -0,0 +1,15 @@
+// { dg-do compile { target c++11 } }
+
+// PR libstdc++/114147
+// tuple allocator-extended ctor requires non-explicit default ctor
+
+#include 
+#include 
+
+struct X { explicit X(); };
+
+std::allocator a;
+std::tuple t0(std::allocator_arg, a);
+std::tuple t1(std::allocator_arg, a);
+std::tuple t2(std::allocator_arg, a);
+std::tuple t3(std::allocator_arg, a);


[gcc r13-8458] libstdc++: Simplify chrono::__units_suffix using std::format

2024-03-16 Thread Jonathan Wakely via Libstdc++-cvs
https://gcc.gnu.org/g:de45abc4b2a0446f374254981b59a19e0c6eebae

commit r13-8458-gde45abc4b2a0446f374254981b59a19e0c6eebae
Author: Jonathan Wakely 
Date:   Tue Aug 15 16:35:22 2023 +0100

libstdc++: Simplify chrono::__units_suffix using std::format

For std::chrono formatting we can simplify __units_suffix by using
std::format_to to generate the "[n/m]s" suffix with the correct
character type and write directly to the output iterator, so it doesn't
need to be widened using ctype. We can't remove the use of ctype::widen
for formatting a time zone abbreviation as a wide string, because that
can contain arbitrary characters that can't be widened by
__to_wstring_numeric.

This also fixes a bug in the chrono formatter for %Z which created a
dangling wstring_view.

libstdc++-v3/ChangeLog:

* include/bits/chrono_io.h (__units_suffix_misc): Remove.
(__units_suffix): Return a known suffix as string view, do not
write unknown suffixes to a buffer.
(__fmt_units_suffix): New function that formats the suffix using
std::format_to.
(operator<<, __chrono_formatter::_M_q): Use __fmt_units_suffix.
(__chrono_formatter::_M_Z): Correct lifetime of wstring.

(cherry picked from commit c992acdc6774ef3d566fab5f324d254bed1b9d4b)

Diff:
---
 libstdc++-v3/include/bits/chrono_io.h | 84 ---
 1 file changed, 29 insertions(+), 55 deletions(-)

diff --git a/libstdc++-v3/include/bits/chrono_io.h 
b/libstdc++-v3/include/bits/chrono_io.h
index 1c08130bf65..1838ad1a8c6 100644
--- a/libstdc++-v3/include/bits/chrono_io.h
+++ b/libstdc++-v3/include/bits/chrono_io.h
@@ -38,7 +38,7 @@
 #include  // setw, setfill
 #include 
 
-#include 
+#include 
 
 namespace std _GLIBCXX_VISIBILITY(default)
 {
@@ -69,34 +69,9 @@ namespace __detail
 #define _GLIBCXX_WIDEN_(C, S) ::std::chrono::__detail::_Widen(S, L##S)
 #define _GLIBCXX_WIDEN(S) _GLIBCXX_WIDEN_(_CharT, S)
 
-
-  // Write an arbitrary duration suffix into the buffer.
-  template
-constexpr const char*
-__units_suffix_misc(char* __buf, size_t /* TODO check length? */) noexcept
-{
-  namespace __tc = std::__detail;
-  char* __p = __buf;
-  __p[0] = '[';
-  unsigned __nlen = __tc::__to_chars_len((uintmax_t)_Period::num);
-  __tc::__to_chars_10_impl(__p + 1, __nlen, (uintmax_t)_Period::num);
-  __p += 1 + __nlen;
-  if constexpr (_Period::den != 1)
-   {
- __p[0] = '/';
- unsigned __dlen = __tc::__to_chars_len((uintmax_t)_Period::den);
- __tc::__to_chars_10_impl(__p + 1, __dlen, (uintmax_t)_Period::den);
- __p += 1 + __dlen;
-   }
-  __p[0] = ']';
-  __p[1] = 's';
-  __p[2] = '\0';
-  return __buf;
-}
-
   template
-constexpr auto
-__units_suffix(char* __buf, size_t __n) noexcept
+constexpr basic_string_view<_CharT>
+__units_suffix() noexcept
 {
   // The standard say these are all narrow strings, which would need to
   // be widened at run-time when inserted into a wide stream. We use
@@ -134,7 +109,22 @@ namespace __detail
   _GLIBCXX_UNITS_SUFFIX(ratio<3600>,  "h")
   _GLIBCXX_UNITS_SUFFIX(ratio<86400>, "d")
 #undef _GLIBCXX_UNITS_SUFFIX
-  return __detail::__units_suffix_misc<_Period>(__buf, __n);
+   return {};
+}
+
+  template
+inline _Out
+__fmt_units_suffix(_Out __out) noexcept
+{
+  if (auto __s = __detail::__units_suffix<_Period, _CharT>(); __s.size())
+   return __format::__write(std::move(__out), __s);
+  else if constexpr (_Period::den == 1)
+   return std::format_to(std::move(__out), _GLIBCXX_WIDEN("[{}]s"),
+ (uintmax_t)_Period::num);
+  else
+   return std::format_to(std::move(__out), _GLIBCXX_WIDEN("[{}/{}]s"),
+ (uintmax_t)_Period::num,
+ (uintmax_t)_Period::den);
 }
 } // namespace __detail
 /// @endcond
@@ -149,14 +139,14 @@ namespace __detail
 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
   const duration<_Rep, _Period>& __d)
 {
+  using _Out = ostreambuf_iterator<_CharT, _Traits>;
   using period = typename _Period::type;
-  char __buf[sizeof("[/]s") + 2 * numeric_limits::digits10];
   std::basic_ostringstream<_CharT, _Traits> __s;
   __s.flags(__os.flags());
   __s.imbue(__os.getloc());
   __s.precision(__os.precision());
   __s << __d.count();
-  __s << __detail::__units_suffix(__buf, sizeof(__buf));
+  __detail::__fmt_units_suffix(_Out(__s));
   __os << std::move(__s).str();
   return __os;
 }
@@ -1074,32 +1064,16 @@ namespace __format
   template
typename _FormatContext::iterator
_M_q(const _Tp&, typename _FormatContext::iterator __out,
-_FormatContext& __ctx) const
+_FormatContext&) const
{
   

[gcc r14-9501] c++: Check module attachment instead of just purview when necessary [PR112631]

2024-03-16 Thread Nathaniel Shead via Gcc-cvs
https://gcc.gnu.org/g:ead3075406ece9daaad65a01ae539150aee43f5a

commit r14-9501-gead3075406ece9daaad65a01ae539150aee43f5a
Author: Nathaniel Shead 
Date:   Tue Mar 12 23:24:27 2024 +1100

c++: Check module attachment instead of just purview when necessary 
[PR112631]

Block-scope declarations of functions or extern values are not allowed
when attached to a named module. Similarly, class member functions are
not inline if attached to a named module. However, in both these cases
we currently only check if the declaration is within the module purview;
it is possible for such a declaration to occur within the module purview
but not be attached to a named module (e.g. in an 'extern "C++"' block).
This patch makes the required adjustments.

PR c++/112631

gcc/cp/ChangeLog:

* cp-tree.h (named_module_attach_p): New function.
* decl.cc (start_decl): Check for attachment not purview.
(grokmethod): Likewise.

gcc/testsuite/ChangeLog:

* g++.dg/modules/block-decl-1_a.C: New test.
* g++.dg/modules/block-decl-1_b.C: New test.
* g++.dg/modules/block-decl-2.C: New test.

Signed-off-by: Nathaniel Shead 

Diff:
---
 gcc/cp/cp-tree.h  |  2 ++
 gcc/cp/decl.cc| 10 +-
 gcc/testsuite/g++.dg/modules/block-decl-1_a.C |  9 +
 gcc/testsuite/g++.dg/modules/block-decl-1_b.C | 10 ++
 gcc/testsuite/g++.dg/modules/block-decl-2.C   | 21 +
 5 files changed, 47 insertions(+), 5 deletions(-)

diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 14895bc6585..05913861e06 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -7381,6 +7381,8 @@ inline bool module_attach_p ()
 
 inline bool named_module_purview_p ()
 { return named_module_p () && module_purview_p (); }
+inline bool named_module_attach_p ()
+{ return named_module_p () && module_attach_p (); }
 
 /* We're currently exporting declarations.  */
 inline bool module_exporting_p ()
diff --git a/gcc/cp/decl.cc b/gcc/cp/decl.cc
index dbc3df24e77..7a97b867199 100644
--- a/gcc/cp/decl.cc
+++ b/gcc/cp/decl.cc
@@ -6092,10 +6092,10 @@ start_decl (const cp_declarator *declarator,
 {
   /* A function-scope decl of some namespace-scope decl.  */
   DECL_LOCAL_DECL_P (decl) = true;
-  if (named_module_purview_p ())
+  if (named_module_attach_p ())
error_at (declarator->id_loc,
- "block-scope extern declaration %q#D not permitted"
- " in module purview", decl);
+ "block-scope extern declaration %q#D must not be"
+ " attached to a named module", decl);
 }
 
   /* Enter this declaration into the symbol table.  Don't push the plain
@@ -18907,10 +18907,10 @@ grokmethod (cp_decl_specifier_seq *declspecs,
   check_template_shadow (fndecl);
 
   /* p1779 ABI-Isolation makes inline not a default for in-class
- definitions in named module purview.  If the user explicitly
+ definitions attached to a named module.  If the user explicitly
  made it inline, grokdeclarator will already have done the right
  things.  */
-  if ((!named_module_purview_p ()
+  if ((!named_module_attach_p ()
|| flag_module_implicit_inline
   /* Lambda's operator function remains inline.  */
|| LAMBDA_TYPE_P (DECL_CONTEXT (fndecl)))
diff --git a/gcc/testsuite/g++.dg/modules/block-decl-1_a.C 
b/gcc/testsuite/g++.dg/modules/block-decl-1_a.C
new file mode 100644
index 000..e7ffc629192
--- /dev/null
+++ b/gcc/testsuite/g++.dg/modules/block-decl-1_a.C
@@ -0,0 +1,9 @@
+// { dg-additional-options "-fmodules-ts" }
+// { dg-module-cmi bla }
+
+export module bla;
+
+export extern "C++" inline void fun() {
+  void oops();  // { dg-bogus "block-scope extern declaration" }
+  oops();
+}
diff --git a/gcc/testsuite/g++.dg/modules/block-decl-1_b.C 
b/gcc/testsuite/g++.dg/modules/block-decl-1_b.C
new file mode 100644
index 000..c0d724f25ac
--- /dev/null
+++ b/gcc/testsuite/g++.dg/modules/block-decl-1_b.C
@@ -0,0 +1,10 @@
+// { dg-module-do link }
+// { dg-additional-options "-fmodules-ts" }
+
+import bla;
+
+void oops() {}
+
+int main() {
+  fun();
+}
diff --git a/gcc/testsuite/g++.dg/modules/block-decl-2.C 
b/gcc/testsuite/g++.dg/modules/block-decl-2.C
new file mode 100644
index 000..974e26f9b7a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/modules/block-decl-2.C
@@ -0,0 +1,21 @@
+// { dg-additional-options "-fmodules-ts" }
+// { dg-module-cmi !mod }
+
+export module mod;
+
+namespace {
+  void internal() {}
+}
+
+export extern "C++" auto foo() {
+  struct X {
+// `foo` is not attached to a named module, and as such
+// `X::f` should be implicitly `inline` here
+void f() {  // { dg-error "references internal linkage entity" }
+  internal();
+}
+  };
+  return X{};
+}
+
+// { dg-prune-output "failed to write compiled module"

[gcc r14-9502] bitint: Fix up stores to large/huge _BitInt bitfields [PR114329]

2024-03-16 Thread Jakub Jelinek via Gcc-cvs
https://gcc.gnu.org/g:3e8323e873c5af5047507d6b2cfbd12706820ee2

commit r14-9502-g3e8323e873c5af5047507d6b2cfbd12706820ee2
Author: Jakub Jelinek 
Date:   Sat Mar 16 15:15:29 2024 +0100

bitint: Fix up stores to large/huge _BitInt bitfields [PR114329]

The verifier requires BIT_FIELD_REFs with INTEGRAL_TYPE_P first operand
to have mode precision.  In most cases for the large/huge _BitInt bitfield
stores the code uses bitfield representatives, which are typically arrays
of chars, but if the bitfield starts at byte boundary on big endian,
the code uses as nlhs in lower_mergeable_store COMPONENT_REF of the
bitfield FIELD_DECL instead, which is fine for the limb accesses,
but when used for the most significant limb can result in invalid
BIT_FIELD_REF because the first operand then has BITINT_TYPE and
usually VOIDmode.

The following patch adds a helper method for the 4 creatikons of
BIT_FIELD_REF which when needed adds a VIEW_CONVERT_EXPR.

2024-03-16  Jakub Jelinek  

PR tree-optimization/114329
* gimple-lower-bitint.cc (struct bitint_large_huge): Declare
build_bit_field_ref method.
(bitint_large_huge::build_bit_field_ref): New method.
(bitint_large_huge::lower_mergeable_stmt): Use it.

* gcc.dg/bitint-101.c: New test.

Diff:
---
 gcc/gimple-lower-bitint.cc| 62 +++
 gcc/testsuite/gcc.dg/bitint-101.c | 17 +++
 2 files changed, 61 insertions(+), 18 deletions(-)

diff --git a/gcc/gimple-lower-bitint.cc b/gcc/gimple-lower-bitint.cc
index 42c39d8a47a..40d814e5c38 100644
--- a/gcc/gimple-lower-bitint.cc
+++ b/gcc/gimple-lower-bitint.cc
@@ -427,6 +427,8 @@ struct bitint_large_huge
   void insert_before (gimple *);
   tree limb_access_type (tree, tree);
   tree limb_access (tree, tree, tree, bool);
+  tree build_bit_field_ref (tree, tree, unsigned HOST_WIDE_INT,
+   unsigned HOST_WIDE_INT);
   void if_then (gimple *, profile_probability, edge &, edge &);
   void if_then_else (gimple *, profile_probability, edge &, edge &);
   void if_then_if_then_else (gimple *g, gimple *,
@@ -659,6 +661,31 @@ bitint_large_huge::limb_access (tree type, tree var, tree 
idx, bool write_p)
   return ret;
 }
 
+/* Build a BIT_FIELD_REF to access BITSIZE bits with FTYPE type at
+   offset BITPOS inside of OBJ.  */
+
+tree
+bitint_large_huge::build_bit_field_ref (tree ftype, tree obj,
+   unsigned HOST_WIDE_INT bitsize,
+   unsigned HOST_WIDE_INT bitpos)
+{
+  if (INTEGRAL_TYPE_P (TREE_TYPE (obj))
+  && !type_has_mode_precision_p (TREE_TYPE (obj)))
+{
+  unsigned HOST_WIDE_INT nelts
+   = CEIL (tree_to_uhwi (TYPE_SIZE (TREE_TYPE (obj))), limb_prec);
+  tree ltype = m_limb_type;
+  addr_space_t as = TYPE_ADDR_SPACE (TREE_TYPE (obj));
+  if (as != TYPE_ADDR_SPACE (ltype))
+   ltype = build_qualified_type (ltype, TYPE_QUALS (ltype)
+ | ENCODE_QUAL_ADDR_SPACE (as));
+  tree atype = build_array_type_nelts (ltype, nelts);
+  obj = build1 (VIEW_CONVERT_EXPR, atype, obj);
+}
+  return build3 (BIT_FIELD_REF, ftype, obj, bitsize_int (bitsize),
+bitsize_int (bitpos));
+}
+
 /* Emit a half diamond,
if (COND)
  |\
@@ -2651,9 +2678,9 @@ bitint_large_huge::lower_mergeable_stmt (gimple *stmt, 
tree_code &cmp_code,
}
  tree ftype
= build_nonstandard_integer_type (limb_prec - bo_bit, 1);
- tree bfr = build3 (BIT_FIELD_REF, ftype, unshare_expr (nlhs),
-bitsize_int (limb_prec - bo_bit),
-bitsize_int (bo_idx * limb_prec + bo_bit));
+ tree bfr = build_bit_field_ref (ftype, unshare_expr (nlhs),
+ limb_prec - bo_bit,
+ bo_idx * limb_prec + bo_bit);
  tree t = add_cast (ftype, rhs1);
  g = gimple_build_assign (bfr, t);
  insert_before (g);
@@ -2714,12 +2741,11 @@ bitint_large_huge::lower_mergeable_stmt (gimple *stmt, 
tree_code &cmp_code,
{
  tree ftype
= build_nonstandard_integer_type (rprec + bo_bit, 1);
- tree bfr = build3 (BIT_FIELD_REF, ftype,
-unshare_expr (nlhs),
-bitsize_int (rprec + bo_bit),
-bitsize_int ((bo_idx
-  + tprec / limb_prec)
- * limb_prec));
+ tree bfr
+   = build_bit_field_ref (ftype, unshare_expr (nlhs),
+  

[gcc r14-9503] i386: Fix setup of incoming varargs for (...) functions which return large aggregates [PR114175]

2024-03-16 Thread Jakub Jelinek via Gcc-cvs
https://gcc.gnu.org/g:218d17496122abe1fd831bd003f129310b32ca83

commit r14-9503-g218d17496122abe1fd831bd003f129310b32ca83
Author: Jakub Jelinek 
Date:   Sat Mar 16 15:16:33 2024 +0100

i386: Fix setup of incoming varargs for (...) functions which return large 
aggregates [PR114175]

The c23-stdarg-6.c testcase I've added recently apparently works fine with
-O0 but aborts with -O1 and higher on x86_64-linux.
The problem is in setup of incoming varargs.

Like function.cc before r14-9249 even ix86_setup_incoming_varargs assumes
that TYPE_NO_NAMED_ARGS_STDARG_P don't have any named arguments and there
is nothing to advance, but that is not the case for (...) functions
returning by hidden reference which have one such artificial argument.
If the setup_incoming_varargs hook is called from the
  if (TYPE_NO_NAMED_ARGS_STDARG_P (TREE_TYPE (fndecl))
  && fnargs.is_empty ())
{
  struct assign_parm_data_one data = {};
  assign_parms_setup_varargs (&all, &data, false);
}
spot, i.e. where there is no hidden return argument passed, arg.type
is always NULL, while when it is called in the
  if (cfun->stdarg && !DECL_CHAIN (parm))
assign_parms_setup_varargs (&all, &data, false);
spot, even when it is TYPE_NO_NAMED_ARGS_STDARG_P arg.type will be non-NULL.
The tree-stdarg.cc pass in f in c23-stdarg-6.cc at -O1 or higher determines
that va_arg is used on integral types at most twice (loads 2 words),
and because ix86_setup_incoming_varargs doesn't advance, the code saves
just the %rdi and %rsi registers to the save area.  But that isn't correct,
it should save %rsi and %rdx because %rdi is the hidden return argument.
With -O0 tree-stdarg.cc doesn't attempt to optimize and we save all the
registers, so it works fine in that case.

Now, I think we'll need the same fix also on
aarch64, alpha, arc, csky, ia64, loongarch, mips, mmix, nios2, riscv, visium
which have pretty much the similarly looking snippet in their hooks
changed by the r13-3549 commit.
Then arm, epiphany, fr30, frv, ft32, m32r, mcore, nds32, rs6000, sh
have different changes but most likely need something similar too.
I don't have access to most of those, could test aarch64 and rs6000 I guess.

2024-03-16  Jakub Jelinek  

PR target/114175
* config/i386/i386.cc (ix86_setup_incoming_varargs): Only skip
ix86_function_arg_advance for TYPE_NO_NAMED_ARGS_STDARG_P functions
if arg.type is NULL.

* gcc.dg/c23-stdarg-7.c: New test.
* gcc.dg/c23-stdarg-8.c: New test.

Diff:
---
 gcc/config/i386/i386.cc | 3 ++-
 gcc/testsuite/gcc.dg/c23-stdarg-7.c | 6 ++
 gcc/testsuite/gcc.dg/c23-stdarg-8.c | 6 ++
 3 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/gcc/config/i386/i386.cc b/gcc/config/i386/i386.cc
index 4b6b665e599..2357ba3f4c6 100644
--- a/gcc/config/i386/i386.cc
+++ b/gcc/config/i386/i386.cc
@@ -4643,7 +4643,8 @@ ix86_setup_incoming_varargs (cumulative_args_t cum_v,
   /* For varargs, we do not want to skip the dummy va_dcl argument.
  For stdargs, we do want to skip the last named argument.  */
   next_cum = *cum;
-  if (!TYPE_NO_NAMED_ARGS_STDARG_P (TREE_TYPE (current_function_decl))
+  if ((!TYPE_NO_NAMED_ARGS_STDARG_P (TREE_TYPE (current_function_decl))
+   || arg.type != NULL_TREE)
   && stdarg_p (fntype))
 ix86_function_arg_advance (pack_cumulative_args (&next_cum), arg);
 
diff --git a/gcc/testsuite/gcc.dg/c23-stdarg-7.c 
b/gcc/testsuite/gcc.dg/c23-stdarg-7.c
new file mode 100644
index 000..b05a9623cd7
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/c23-stdarg-7.c
@@ -0,0 +1,6 @@
+/* Test C23 variadic functions with no named parameters, or last named
+   parameter with a declaration not allowed in C17.  Execution tests.  */
+/* { dg-do run } */
+/* { dg-options "-O2 -std=c23 -pedantic-errors" } */
+
+#include "c23-stdarg-4.c"
diff --git a/gcc/testsuite/gcc.dg/c23-stdarg-8.c 
b/gcc/testsuite/gcc.dg/c23-stdarg-8.c
new file mode 100644
index 000..81140312731
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/c23-stdarg-8.c
@@ -0,0 +1,6 @@
+/* Test C23 variadic functions with no named parameters, or last named
+   parameter with a declaration not allowed in C17.  Execution tests.  */
+/* { dg-do run } */
+/* { dg-options "-O2 -std=c23 -pedantic-errors" } */
+
+#include "c23-stdarg-6.c"


[gcc r12-10218] Darwin: Fix bootstrap break on X86.

2024-03-16 Thread Iain D Sandoe via Gcc-cvs
https://gcc.gnu.org/g:f84bca11b1d4a504da699d02349d949c11d59bd7

commit r12-10218-gf84bca11b1d4a504da699d02349d949c11d59bd7
Author: Iain Sandoe 
Date:   Sun Mar 17 03:04:44 2024 +

Darwin: Fix bootstrap break on X86.

The changes in r12-9536-gefcca6481eab18 mangled the whitespace in
the ENDFILE_SPEC i386/darwin.h leading to a bootstrap fail.

gcc/ChangeLog:

* config/i386/darwin.h (ENDFILE_SPEC): Fix whitespace.

Signed-off-by: Iain Sandoe 

Diff:
---
 gcc/config/i386/darwin.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/config/i386/darwin.h b/gcc/config/i386/darwin.h
index 2f773924d6e..12cdc34a19e 100644
--- a/gcc/config/i386/darwin.h
+++ b/gcc/config/i386/darwin.h
@@ -109,8 +109,8 @@ along with GCC; see the file COPYING3.  If not see
 "%{!force_cpusubtype_ALL:-force_cpusubtype_ALL} "
 
 #undef ENDFILE_SPEC
-#define ENDFILE_SPEC
-\  
"%{mdaz-ftz:crtfastmath.o%s;Ofast|ffast-math|funsafe-math-optimizations:%{!mno-daz-ftz:crtfastmath.o%s}}
 \
+#define ENDFILE_SPEC \
+  
"%{mdaz-ftz:crtfastmath.o%s;Ofast|ffast-math|funsafe-math-optimizations:%{!mno-daz-ftz:crtfastmath.o%s}}
 \
%{mpc32:crtprec32.o%s} \
%{mpc64:crtprec64.o%s} \
%{mpc80:crtprec80.o%s}" TM_DESTRUCTOR


[gcc r12-10219] Darwin, Objective-C: Support -fconstant-cfstrings [PR108743].

2024-03-16 Thread Iain D Sandoe via Gcc-cvs
https://gcc.gnu.org/g:215d67485ce8d4f6cef4e9cf7ecfd4d79abc1c48

commit r12-10219-g215d67485ce8d4f6cef4e9cf7ecfd4d79abc1c48
Author: Iain Sandoe 
Date:   Sun Jul 2 14:18:04 2023 +0100

Darwin, Objective-C: Support -fconstant-cfstrings [PR108743].

This support the -fconstant-cfstrings option as used by clang (and
expect by some build scripts) as an alias to the target-specific
-mconstant-cfstrings.

The documentation is also updated to reflect that the 'f' option is
only available on Darwin, and to add the 'm' option to the Darwin
section of the invocation text.

Signed-off-by: Iain Sandoe 

PR target/108743

gcc/ChangeLog:

* config/darwin.opt: Add fconstant-cfstrings alias to
mconstant-cfstrings.
* doc/invoke.texi: Amend invocation descriptions to reflect
that the fconstant-cfstrings is a target-option alias and to
add the missing mconstant-cfstrings option description to the
Darwin section.

(cherry picked from commit cdd4b3c0f0f428678c24de74b1f626628450799c)

Diff:
---
 gcc/config/darwin.opt |  4 
 gcc/doc/invoke.texi   | 27 ---
 2 files changed, 24 insertions(+), 7 deletions(-)

diff --git a/gcc/config/darwin.opt b/gcc/config/darwin.opt
index cc7d14c2e4d..51fe410cb72 100644
--- a/gcc/config/darwin.opt
+++ b/gcc/config/darwin.opt
@@ -33,6 +33,10 @@ fapple-kext
 Target C++ Var(flag_apple_kext)
 Generate code for darwin loadable kernel extensions.
 
+fconstant-cfstrings
+ObjC ObjC++ Alias(mconstant-cfstrings)
+Generate compile-time CFString objects.
+
 iframework
 Target RejectNegative C ObjC C++ ObjC++ Joined Separate
 -iframework   Add  to the end of the system framework include 
path.
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 8f5c7abea64..c83f667260e 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -4521,10 +4521,12 @@ and Objective-C++ programs:
 Use @var{class-name} as the name of the class to instantiate for each
 literal string specified with the syntax @code{@@"@dots{}"}.  The default
 class name is @code{NXConstantString} if the GNU runtime is being used, and
-@code{NSConstantString} if the NeXT runtime is being used (see below).  The
-@option{-fconstant-cfstrings} option, if also present, overrides the
-@option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
-to be laid out as constant CoreFoundation strings.
+@code{NSConstantString} if the NeXT runtime is being used (see below).  On
+Darwin (macOS, MacOS X) platforms, the @option{-fconstant-cfstrings} option, if
+also present, overrides the @option{-fconstant-string-class} setting and cause
+@code{@@"@dots{}"} literals to be laid out as constant CoreFoundation strings.
+Note that @option{-fconstant-cfstrings} is an alias for the target-specific
+@option{-mconstant-cfstrings} equivalent.
 
 @item -fgnu-runtime
 @opindex fgnu-runtime
@@ -22804,10 +22806,21 @@ This is by default ON@.
 @opindex gfull
 Emit debugging information for all symbols and types.
 
+@opindex fconstant-cfstrings
+@item -fconstant-cfstrings
+The @option{-fconstant-cfstrings} is an alias for 
@option{-mconstant-cfstrings}.
+
+@opindex mconstant-cfstrings
+@item -mconstant-cfstrings
+When the NeXT runtime is being used (the default on these systems), override
+any @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"}
+literals to be laid out as constant CoreFoundation strings.
+
+@opindex mmacosx-version-min
 @item -mmacosx-version-min=@var{version}
-The earliest version of MacOS X that this executable will run on
-is @var{version}.  Typical values of @var{version} include @code{10.1},
-@code{10.2}, and @code{10.3.9}.
+The earliest version of MacOS X that this executable will run on is
+@var{version}.  Typical values supported for @var{version} include @code{12},
+@code{10.12}, and @code{10.5.8}.
 
 If the compiler was built to use the system's headers by default,
 then the default for this option is the system version on which the


[gcc r11-11283] Darwin, Objective-C: Support -fconstant-cfstrings [PR108743].

2024-03-16 Thread Iain D Sandoe via Gcc-cvs
https://gcc.gnu.org/g:87152f50a89deb5044145a80fa2ed705f4913f98

commit r11-11283-g87152f50a89deb5044145a80fa2ed705f4913f98
Author: Iain Sandoe 
Date:   Sun Jul 2 14:18:04 2023 +0100

Darwin, Objective-C: Support -fconstant-cfstrings [PR108743].

This support the -fconstant-cfstrings option as used by clang (and
expect by some build scripts) as an alias to the target-specific
-mconstant-cfstrings.

The documentation is also updated to reflect that the 'f' option is
only available on Darwin, and to add the 'm' option to the Darwin
section of the invocation text.

Signed-off-by: Iain Sandoe 

PR target/108743

gcc/ChangeLog:

* config/darwin.opt: Add fconstant-cfstrings alias to
mconstant-cfstrings.
* doc/invoke.texi: Amend invocation descriptions to reflect
that the fconstant-cfstrings is a target-option alias and to
add the missing mconstant-cfstrings option description to the
Darwin section.

(cherry picked from commit cdd4b3c0f0f428678c24de74b1f626628450799c)

Diff:
---
 gcc/config/darwin.opt |  4 
 gcc/doc/invoke.texi   | 27 ---
 2 files changed, 24 insertions(+), 7 deletions(-)

diff --git a/gcc/config/darwin.opt b/gcc/config/darwin.opt
index 48d3aa97800..91c05166b3e 100644
--- a/gcc/config/darwin.opt
+++ b/gcc/config/darwin.opt
@@ -33,6 +33,10 @@ fapple-kext
 Target C++ Var(flag_apple_kext)
 Generate code for darwin loadable kernel extensions.
 
+fconstant-cfstrings
+ObjC ObjC++ Alias(mconstant-cfstrings)
+Generate compile-time CFString objects.
+
 iframework
 Target RejectNegative C ObjC C++ ObjC++ Joined Separate
 -iframework   Add  to the end of the system framework include 
path.
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 86affa84212..1ae94fb3677 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -4346,10 +4346,12 @@ and Objective-C++ programs:
 Use @var{class-name} as the name of the class to instantiate for each
 literal string specified with the syntax @code{@@"@dots{}"}.  The default
 class name is @code{NXConstantString} if the GNU runtime is being used, and
-@code{NSConstantString} if the NeXT runtime is being used (see below).  The
-@option{-fconstant-cfstrings} option, if also present, overrides the
-@option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
-to be laid out as constant CoreFoundation strings.
+@code{NSConstantString} if the NeXT runtime is being used (see below).  On
+Darwin (macOS, MacOS X) platforms, the @option{-fconstant-cfstrings} option, if
+also present, overrides the @option{-fconstant-string-class} setting and cause
+@code{@@"@dots{}"} literals to be laid out as constant CoreFoundation strings.
+Note that @option{-fconstant-cfstrings} is an alias for the target-specific
+@option{-mconstant-cfstrings} equivalent.
 
 @item -fgnu-runtime
 @opindex fgnu-runtime
@@ -21812,10 +21814,21 @@ This is by default ON@.
 @opindex gfull
 Emit debugging information for all symbols and types.
 
+@opindex fconstant-cfstrings
+@item -fconstant-cfstrings
+The @option{-fconstant-cfstrings} is an alias for 
@option{-mconstant-cfstrings}.
+
+@opindex mconstant-cfstrings
+@item -mconstant-cfstrings
+When the NeXT runtime is being used (the default on these systems), override
+any @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"}
+literals to be laid out as constant CoreFoundation strings.
+
+@opindex mmacosx-version-min
 @item -mmacosx-version-min=@var{version}
-The earliest version of MacOS X that this executable will run on
-is @var{version}.  Typical values of @var{version} include @code{10.1},
-@code{10.2}, and @code{10.3.9}.
+The earliest version of MacOS X that this executable will run on is
+@var{version}.  Typical values supported for @var{version} include @code{12},
+@code{10.12}, and @code{10.5.8}.
 
 If the compiler was built to use the system's headers by default,
 then the default for this option is the system version on which the