Commit Graph

226081 Commits

Author SHA1 Message Date
GCC Administrator
672b580d85 Daily bump. 2026-01-02 00:16:23 +00:00
Jerry DeLisle
489423763d Fortran: Generate a runtime error on recursive I/O
PR libfortran/119136

gcc/fortran/ChangeLog:

	* libgfortran.h: Add enum for new LIBERROR_RECURSIVE_IO.

libgfortran/ChangeLog:

	* io/io.h: Delete prototype for unused stash_internal_unit.
	(check_for_recursive): Add prototype for this new function.
	* io/transfer.c (data_transfer_init): Add call to new
	check_for_recursive.
	* io/unit.c (delete_unit): Fix comment.
	(check_for_recursive): Add new function.
	* runtime/error.c (translate_error): Add translation for
	"Recursive I/O not allowed runtime error message.

gcc/testsuite/ChangeLog:

	* gfortran.dg/pr119136.f90: New test.
2026-01-01 13:41:46 -08:00
Kugan Vivekanandarajah
1e314be3cc [PATCH] [AutoFDO/devirt] Fix ICE with duplicate speculative ID
This happens due to autoprofile pass makes edge make_speculative.
Then ipa-devirt does the same with the same speculative_id which
reults in duplicate speculative_id and ICE.

during IPA pass: cp
test.i:31:1: internal compiler error: verify_cgraph_node failed
0x39bfa6b internal_error(char const*, ...)
	../../gcc/gcc/diagnostic-global-context.cc:787
0x13914eb cgraph_node::verify_node()
	../../gcc/gcc/cgraph.cc:4454
0x13738ab symtab_node::verify()
	../../gcc/gcc/symtab.cc:1377
0x1373d1b symtab_node::verify_symtab_nodes()
	../../gcc/gcc/symtab.cc:1499
0x13a3653 symtab_node::checking_verify_symtab_nodes()
	../../gcc/gcc/cgraph.h:718
0x182d267 symbol_table::remove_unreachable_nodes(_IO_FILE*)
	../../gcc/gcc/ipa.cc:688
0x19f8c33 execute_todo
	../../gcc/gcc/passes.cc:2163

We may also have to check if the speculative edge is present
before making speculative.

gcc/ChangeLog:

2025-12-22  Kugan Vivekanandarajah  <kvivekananda@nvidia.com>

	* cgraph.cc (cgraph_edge::get_next_speculative_id): New.
	* cgraph.h (cgraph_edge::get_next_speculative_id): New.
	* ipa-devirt.cc (ipa_devirt): Use get_next_speculative_id
	in make_speculative.

Signed-off-by: Kugan Vivekanandarajah <kvivekananda@nvidia.com>
2026-01-02 07:59:11 +11:00
Jakub Jelinek
c715060dd6 Update Copyright year in ChangeLog files
2025 -> 2026
2026-01-01 18:58:28 +01:00
Jakub Jelinek
24fbc14eeb Rotate ChangeLog files.
Rotate ChangeLog files for ChangeLogs with yearly cadence.
Also remove empty lines before Form Feed line.
2026-01-01 18:50:16 +01:00
Jakub Jelinek
2af2da18cb Update copyright dates.
Manual part of copyright year updates.

2026-01-01  Jakub Jelinek  <jakub@redhat.com>

gcc/
	* gcc.cc (process_command): Update copyright notice dates.
	* gcov-dump.cc (print_version): Ditto.
	* gcov.cc (print_version): Ditto.
	* gcov-tool.cc (print_version): Ditto.
	* gengtype.cc (create_file): Ditto.
	* doc/cpp.texi: Bump @copying's copyright year.
	* doc/cppinternals.texi: Ditto.
	* doc/gcc.texi: Ditto.
	* doc/gccint.texi: Ditto.
	* doc/gcov.texi: Ditto.
	* doc/install.texi: Ditto.
	* doc/invoke.texi: Ditto.
gcc/ada/
	* gnat_ugn.texi: Bump @copying's copyright year.
	* gnat_rm.texi: Likewise.
gcc/d/
	* gdc.texi: Bump @copyrights-d year.
gcc/fortran/
	* gfortranspec.cc (lang_specific_driver): Update copyright notice
	dates.
	* gfc-internals.texi: Bump @copying's copyright year.
	* gfortran.texi: Ditto.
	* intrinsic.texi: Ditto.
	* invoke.texi: Ditto.
gcc/go/
	* gccgo.texi: Bump @copyrights-go year.
libgomp/
	* libgomp.texi: Bump @copying's copyright year.
libitm/
	* libitm.texi: Bump @copying's copyright year.
libquadmath/
	* libquadmath.texi: Bump @copying's copyright year.
2026-01-01 18:40:58 +01:00
Jose E. Marchesi
7132a4a945 a68: fix portability problems in sppp.awk
Happy new year!

Turns out the optional third argument of 'match' is a GNU extension
and is not POSIX.  Also, POSIX doens't recognize interval expressions
in regexps.

This patch vandalizes sppp.awk to remove the use of these nonportable
(but nice) constructs.

Tested with mawk.

Signed-off-by: Jose E. Marchesi <jemarch@gnu.org>

libga68/ChangeLog

	* sppp.awk: Fix non-portable uses of 'match'.
2026-01-01 14:30:45 +01:00
Tobias Burnus
a2de9378d8 c-c++-common/gomp/uses_allocators-8.c: Add missing -fdump-tree-original [PR123299]
gcc/testsuite/ChangeLog:

	PR testsuite/123299
	* c-c++-common/gomp/uses_allocators-8.c: Add missing
	-fdump-tree-original and add C++ version of scan-tree-dump.
2026-01-01 12:48:40 +01:00
GCC Administrator
8946d80a18 Daily bump. 2026-01-01 00:16:28 +00:00
Jose E. Marchesi
96c704b082 a68: do not rely on DIM to count modes in an union mode
Signed-off-by: Jose E. Marchesi <jemarch@gnu.org>

gcc/algol68/ChangeLog

	* a68-exports.cc (a68_asm_output_mode): Do not rely on DIM to
	count modes in an union mode.
2025-12-31 23:40:48 +01:00
Jose E. Marchesi
1a6a3ce5ac a68: use a68_error specific tag in diagnostic message
a68_error and friends still use their own upper-letter based tag
format.  We will be switching these to use the GCC standard %-based
tags for diagnostics, hopefully soonish, but in the meanwhile do not
pass a %s tag to a68_error because bad things happen.

Signed-off-by: Jose E. Marchesi <jemarch@gnu.org>

gcc/algol68/ChangeLog

	* a68-imports.cc (a68_open_packet): Use right tag format in
	a68_error.
2025-12-31 23:03:28 +01:00
Pietro Monteiro
180e5eb7e9 doc: Fix typo in install doc
gcc/ChangeLog:

	* doc/install.texi (--enable-languages): Fix typo.

Signed-off-by: Pietro Monteiro <pietro@sociotechnical.xyz>
2025-12-31 09:33:37 -05:00
Pietro Monteiro
e499b91a66 libga68: Regenerate Makefile.in
libga68/ChangeLog:

	* Makefile.in: Regenerate.

Signed-off-by: Pietro Monteiro <pietro@sociotechnical.xyz>
2025-12-31 05:28:05 -05:00
Jeff Law
5d3874416c [RISC-V][PR target/121485] Fix mode on Zvkned lmul extending patterns
This fixes the mode on the lmul-extending variants of various Zvkned patterns.

Essentially vsetvl insertion depends on the mode of each insn and for lmul
extending patterns, we need the larger mode, not the smaller one to get the
correct vsetvls.

Tested on riscv{32,64}-elf on the simple testcase in the PR.  I also verified
the larger testcase in godbolt appears to work correctly.

Waiting on upstream CI before committing.

	PR target/121485
gcc/
	* config/riscv/vector-crypto.md: Fix mode attribute for the
	lmul extending Zvkned patterns.

gcc/testsuite/
	* gcc.target/riscv/rvv/vsetvl/pr121485.c: New test.
2025-12-30 22:57:00 -07:00
Andrew Pinski
96a0aeaf87 testsuite: Skip pr123295-1.c for non int128 targets [PR123334]
This was an oversight on my part. The testcase uses __int128 but
forgot to check if it is compiling for a target that supports that
type.

Mark the testcase as unsupported for non-int128 targets.
Pushed as obvious after run the testcase with and without -m32 on x86_64:
make check-gcc RUNTESTFLAGS="--target_board=unix/-m32 dg.exp=pr123295-1.c"
make check-gcc RUNTESTFLAGS="--target_board=unix dg.exp=pr123295-1.c"

	PR testsuite/123334
gcc/testsuite/ChangeLog:

	* gcc.dg/pr123295-1.c: Require int128.

Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
2025-12-30 17:27:16 -08:00
GCC Administrator
92ed269875 Daily bump. 2025-12-31 00:16:24 +00:00
Jose E. Marchesi
2515b13700 a68: support for Algol 68 code in libga68 and initial transput
Most of the standard prelude is implemented in a combination of code
lowered by the front-end (standard operators, contants, etc) and
functions provided by the libga68 run-time library, to which the
former libcalls.  Until now, all the support routines in libga68 were
written in C.  However, many of the transput facilities are better
implemented in Algol 68.

The Revised Report includes a reference implementation (code listing)
of many of the standard routines.  This implementation, however, makes
use of an "extended" program notation in order to denote certain
notions to avoid repetitive code.  Therefore this commit includes
sppp, a build-time pre-processor written in awk that is only intended
to be used internally by the libga68 run-time library.  This
preprocessor allows us to write code like:

    proc subwhole = (Number v, int width) string:
       case v in
          {iter L {short short} {short} {} {long}    {long long}}
          {iter S {LENG LENG}   {LENG}  {} {SHORTEN} {SHORTEN SHORTEN}}
          ({L} int x):
             begin string s, {L} int n := x;
                   while dig_char ({S} (n MOD {L} 10)) +=: s;
                         n %:= {L} 10; n /= {L} 0
                   do ~ od;
                   (UPB s > width | width * errorchar | s)
             end
          {reti {,}}
       esac;

Resulting in cases for short short int, short int, int, long int and
long long int being macro-expanded in the routine's conformance
clause.

This commit also adds the necessary infrastructure for writing Algol
68 code in the libga68 library, including the ability of having
modules exported by libga68.  An implementation of some of the
transput routines is also provided in standard.a68: whole, fixed,
float, string_to_L_real, char_in_string, L_int_width, L_real_width and
L_exp_with.

The build system changes include the backport of the Automake Algol 68
support, which is in a released version of Automake but not in the
version used for GCC, to libga68/m4/autoconf.m4.

Signed-off-by: Jose E. Marchesi <jemarch@gnu.org>

ChangeLog

	* Makefile.def (flags_to_pass): Rename GA68, GA68FLAGS,
	GA68_FOR_TARGET, GA68FLAGS_FOR_TARGET to A68, A68FLAGS,
	A68_FOR_TARGET and A68FLAGS_FOR_TARGET.
	* Makefile.tpl: Use A68, A68FLAGS, A68_FOR_BUILD and
	A68_FOR_TARGET rather than GA68, GA68FLAGS, GA68_FOR_BUILD and
	GA68_FOR_TARGET.
	* Makefile.in: Regenerate.
	* configure.ac: Set A68_FOR_BUILD rather than GA68_FOR_BUILD, and
	invoke ACX_PROG_A68 rather than ACX_PROG_GA68.
	Subst A68_FOR_BUILD rather than GA68_FOR_BUILD.
	Subst A68 and A68FLAGS rather than GA68 and GA68FLAGS.
	Set A68_FOR_TARGET rather than GA68_FOR_TARGET.
	* configure: Regenerate.
	* config-ml.in: Handle A68FLAGS and define A68 in sub-configures.

config/ChangeLog

	* acx.m4: Define ACX_PROG_A68 rather than ACX_PROG_GA68.
	(ACX_PROG_A68): Set A68 rather than GA68.

gcc/algol68/ChangeLog

	* a68-lang.cc (a68_init_options): Add an entry to A68_MODULE_FILES
	to map module Transput to the basename ga68.

gcc/testsuite/ChangeLog

	* algol68/execute/char-in-string-1.a68: New test.

libga68/ChangeLog

	* m4/autoconf.m4: New file.
	* configure.ac: Expand AC_PROG_A68.
	* configure: Regenerate.
	* Makefile.am: Add rules to build Algol 68 sources and to
	build the transput module.
	* Makefile.in: Regenerate.
	* acinclude.m4: Include m4/autoconf.m4.
	* sppp.awk: New file.
	* transput.a68.in: Likewise.
2025-12-30 22:45:51 +01:00
Pietro Monteiro
896073b66d libga68: Hide internal functions
Test if the target supports the visibility attribute and apply it to
internal functions.

libga68/ChangeLog:

	* acinclude.m4: New file. Add visibility attribute test.
	* configure.ac: Use the new test.
	* Makefile.in: Regenerate.
	* aclocal.m4: Likewise.
	* config.h.in: Likewise.
	* configure: Likewise.
	* ga68.h (GA68_HIDDEN): New macro.
	(_libga68_abort): Add visibility hidden attribute.
	(_libga68_init_heap): Likewise.
	(_libga68_malloc_internal): Likewise.
	(_libga68_realloc): Likewise.
	(_libga68_realloc_unchecked): Likewise.
	(_libga68_free_internal): Likewise.
	(_libga68_u8_uctomb): Likewise.
	(_libga68_u8_mbtouc): Likewise.
	(_libga68_u32_to_u8): Likewise.

Signed-off-by: Pietro Monteiro <pietro@sociotechnical.xyz>
2025-12-30 16:42:09 -05:00
Eric Botcazou
7a9b0d73fe Ada: Fix warnings during bootstrap
The warnings are:

warning: "g-htable.adb" should be recompiled
warning: ("/usr/lib64/gcc/x86_64-suse-linux/7/adalib/g-htable.ali" is
  obsolete and read-only)
warning: "g-byorma.adb" should be recompiled
warning: ("/usr/lib64/gcc/x86_64-suse-linux/7/adalib/g-byorma.ali" is
  obsolete and read-only)
warning: "g-speche.adb" should be recompiled
warning: ("/usr/lib64/gcc/x86_64-suse-linux/7/adalib/g-speche.ali" is
  obsolete and read-only)
warning: "g-spchge.adb" should be recompiled
warning: ("/usr/lib64/gcc/x86_64-suse-linux/7/adalib/g-spchge.ali" is
  obsolete and read-only)
warning: "g-u3spch.adb" should be recompiled
warning: ("/usr/lib64/gcc/x86_64-suse-linux/7/adalib/g-u3spch.ali" is
  obsolete and read-only)

but would be hard errors if a kluge was not used (passing -t to gnatbind).

This fixes the warnings, as well as tentatively removes the kludge.

gcc/ada/
	* gcc-interface/Make-lang.in (GNATBIND_FLAGS): Delete.
	(GNAT_ADA_OBJS): Move g-byorma.o, g-htable.o, g-spchge.o,
	g-speche.o and g-u3spch.o to STAGE1 list.
	(GNATBIND_OBJS): Move g-byorma.o, g-hesora.o and g-htable.o
	to STAGE1 list.
	(ada/b_gnat1.adb): Do not pass GNATBIND_FLAGS to gnatbind.
	(ada/b_gnatb.adb): Likewise.
	(ADA_GENERATED_FILES): Add g-byorma.ad[sb], g-hesora.ad[sb],
	g-htable.ad[sb], g-spchge.ad[sb], g-speche.ad[sb], g-u3spch.ad[sb]
	and alphabetize.
	* libgnat/g-byorma.ads: Add note to head comment.
	* libgnat/g-hesora.ads: Likewise.
	* libgnat/g-htable.ads: Likewise.
	* libgnat/g-spchge.ads: Likewise.
	* libgnat/g-speche.ads: Likewise.
	* libgnat/g-u3spch.ads: Likewise.
2025-12-30 20:15:56 +01:00
Jeff Law
7274c781e8 [RISC-V][PR target/123318] Use a Pmode temporary for output of auipc
In the explict-relocs path through the RISC-V backend we generate sequences
using auipc which stores its result in a GPR.

Under the right circumstances we can end up with cases where we try to use
pseudos which may not be Pmode sized or worse yet may be a floating point mode.

This patch forces those paths to generate a fresh temporary when the provided
one isn't already Pmode.  That helps this bug, but I'm not 100% convinced the
explict-relocs stuff is correct and I wouldn't be surprised to find other bugs
lurking in here.

Bootstrapped & regression tested on the Pioneer and regression tested on
riscv{32,64}-elf as well.

Will commit once pre-commit CI gives it the green light.

	PR target/123318
gcc/
	* config/riscv/riscv.cc (riscv_legitimize_const_move): Force
	riscv_split_symbol to generate a new temporary if the provided
	one isn't Pmode.

gcc/testsuite/
	* gcc.target/riscv/pr123318.c: New test.
2025-12-30 10:38:07 -07:00
Eric Botcazou
564af5667f Ada: Reject formal parameter as name of subprogram renaming
This implements a minimal form of the old RM 8.5.4(6) rule, which forbids
the use of (the name of) a formal parameter of the specification in the
name of a renaming subprogram declaration; it turns out that implementing
the full rule breaks existing code that works fine otherwise.

gcc/ada/
	PR ada/15605
	* sem_ch8.adb (Analyze_Subprogram_Renaming): Give an error if the
	name is also that of a formal parameter of the specification.

gcc/testsuite/
	* gnat.dg/specs/profile1.ads: New test.
2025-12-30 12:06:07 +01:00
GCC Administrator
019d7b6672 Daily bump. 2025-12-30 00:16:33 +00:00
Jose E. Marchesi
6839de7f03 a68: scanner fixes for bits denotations
This commit:

1. Fixes a bug in the scanner so it now checks whether the digits in a
   bits denotation are ok for its radix.

2. Does not allow to have typographical display features between the
   digits of bits denotations in SUPPER stropping, when the radix is
   16.  This is is avoid confusing situations like the one described
   in the comment below.

3. Adds a few tests.

4. Fixes an existing test that was assuming that bits denotations with
   radix 10 are allowed.  The report allows radixes 2, 4, 8 and 16.

Signed-off-by: Jose E. Marchesi <jemarch@gnu.org>

gcc/algol68/ChangeLog

	* a68-parser-scanner.cc (get_next_token): Bits denotation parsing
	fixes.
	* ga68.texi (SUPPER stropping): Document special rule for bits
	denotations with radix 16.

gcc/testsuite/ChangeLog

	* algol68/compile/error-radix-1.a68: New test.
	* algol68/compile/radix-hex-upper-1.a68: Likewise.
	* algol68/compile/radix-hex-supper-1.a68: Likewise.
	* algol68/compile/error-radix-4.a68: Likewise.
	* algol68/compile/error-radix-3.a68: Likewise.
	* algol68/compile/error-radix-2.a68: Likewise.
	* algol68/execute/environment-enquiries-6.a68: Do not use radix 10
	in bits denotations.
2025-12-30 00:16:51 +01:00
Andrew Pinski
cc515677b9 ifcvt: Allow non-comparisons against 0 in noce_try_cond_zero_arith
Like r16-6332-g2a84a753afcf37 but instead of just allowing any comparisons
against 0, this allows all comparisons. I mentioned this in
https://gcc.gnu.org/pipermail/gcc-patches/2025-December/704463.html.

gcc/ChangeLog:

	* ifcvt.cc (noce_try_cond_zero_arith): Remove restriction on comparison
	against 0.

Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
2025-12-29 10:27:41 -08:00
Andrew Pinski
92f2a86794 ifcvt: Handle lowpart subregs if noce_emit_cmove fails in noce_try_cond_zero_arith [PR123308]
This fixes up a missed optimization regression for riscv in ifcvt after r16-6350-g9e61a171244110.
The problem is noce_emit_cmove will fail for QImode. This can show up when dealing with shifts
and the right hand side is `(subreg:QI (reg:DI) lowpart)`. Trying first for the subreg mode
fails so the need to try to unwrap the subreg and try for the full mode.

This fixes test_ShiftLeft_eqz in gcc.target/riscv/zicond_ifcvt_opt.c.

Bootstrapped and tested on x86_64-linux-gnu.

	PR rtl-optimization/123308
gcc/ChangeLog:

	* ifcvt.cc (noce_try_cond_zero_arith): If noce_emit_cmove fails
	for a lowpart subreg case, then try the full reg cmove and
	take the lowpart subreg afterwards.

Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
2025-12-29 10:27:40 -08:00
Andrew Pinski
594f2cbf30 ifcvt: cleanup if_info->cond usage in noce_try_cond_zero_arith
Since r16-6332-g2a84a753afcf37, if_info->cond is not used indirectly any more
for creating the conditional. So this patch stops doing the swap and fixes up
so the case where if_info->rev_cond might be null.

gcc/ChangeLog:

	* ifcvt.cc (noce_try_cond_zero_arith): Don't swap if_info->cond
	but use it directly with if_info->rev_cond.

Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
2025-12-29 10:27:40 -08:00
Pietro Monteiro
f426587cf9 libga68: Add symbol versions to exports
libga68/ChangeLog:

	* configure.ac: New test to determine if symbol versioning is
	supported.
	* Makefile.am: Use result of above test to add appropriate linker
	flags.
	* Makefile.in: Regenerated.
	* aclocal.m4: Likewise.
	* configure: Likewise.
	* ga68.map: New file.
	* libtool-version: New file.

Signed-off-by: Pietro Monteiro <pietro@sociotechnical.xyz>
2025-12-29 12:53:20 -05:00
Jose E. Marchesi
7e8034ae44 a68: fix handling of publicized declarations in victal pass
Signed-off-by: Jose E. Marchesi <jemarch@gnu.org>

gcc/algol68/ChangeLog

	* a68-parser-victal.cc (victal_check_mode_dec): Mind publicized
	declarations.
	(victal_check_variable_dec): Likewise.
	(victal_check_identity_dec): Likewise.

gcc/testsuite/ChangeLog

	* algol68/compile/actual-bounds-expected-4.a68: New test.
	* algol68/compile/formal-bounds-expected-1.a68: Likewise.
2025-12-29 17:42:22 +01:00
Egas Ribeiro
549bfeaa0b c++: Fix ICE with requires-expression in lambda requires-clause [PR123080]
When parsing a lambda with a trailing requires-clause, calling
cp_parser_requires_clause_opt confused generic lambda parsing when
implicit template parameters were involved.
After failing to parse a type-requirement during tentative parsing and
hitting error recovery code in cp_parser_skip_to_end_of_statement that
aborted the current implicit template, attemping to finish the lambda
declaration caused ICEs.

Fix this by not aborting the current implicit template during tentative
parsing and adding cleanup for fully_implicit_function_template_p.

	PR c++/123080

gcc/cp/ChangeLog:

	* parser.cc (cp_parser_skip_to_end_of_statement): Don't abort
	implicit templates during tentative parsing.
	(cp_parser_lambda_declarator_opt): Add cleanup for
	fully_implicit_function_template_p before parsing
	trailing_requires_clause.

gcc/testsuite/ChangeLog:

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

Signed-off-by: Egas Ribeiro <egas.g.ribeiro@gmail.com>
Reviewed-by: Jason Merrill <jason@redhat.com>
2025-12-29 22:07:43 +07:00
Nathaniel Shead
c388d56a88 c++: Fold non-ODR usages of potentially constant values early [PR120005]
[basic.link] p14.4 says that a declaration naming a TU-local entity is
an exposure, ignoring "any reference to a non-volatile const object or
reference with internal or no linkage initialized with a constant
expression that is not an odr-use".

To implement this, we cannot stream these entities but must fold them
into their underlying values beforehand.  This was already done to a
degree by cp_fold, but it didn't handle all cases, and notably was not
performed on the saved body of a constexpr function, which would then
cause errors during modules streaming.

This patch implements this by supplementing cp_fold with additional
rules to fold non-ODR usages of contants.  We need to do this as an
additional walk before saving the constexpr function definition, so we
also disable as much other folding during this walk as possible to
prevent removing any information that the constexpr interpreter
requires to function correctly.

With this we still will error on uses in templates.  In general it's
impossible to tell within an uninstantiated template body whether a
reference is an ODR-use in the face of dependent expressions, so we
don't attempt to do anything for this case.

	PR c++/119097
	PR c++/120005

gcc/cp/ChangeLog:

	* constexpr.cc (potential_constant_expression_1): Fall back to
	location from parent expression if needed.
	* cp-gimplify.cc (enum fold_flags): Add ff_only_non_odr.
	(cp_fold_data::cp_fold_data): Assert invariant for flags.
	(cp_fold_omp_clause_refs_r): New function.
	(cp_fold_r): Specially handle OMP_CLAUSE_DECL.
	(cp_fold_function_non_odr_use): New function.
	(cp_fold_non_odr_use_1): New function.
	(cp_fold_maybe_rvalue): Fold non-ODR uses when requested.
	(cp_fold_non_odr_use): New function.
	(fold_caches): Increase number of caches.
	(get_fold_cache): Use a new cache for non-ODR use walks.
	(cp_fold): Skip most folding for non-ODR use walks; always
	fold constant-initialized references; remove dead code to
	fold __builtin_source_location.
	* cp-tree.h (cp_fold_function_non_odr_use): Declare.
	(cp_fold_non_odr_use): Declare.
	* decl.cc (finish_function): Fold non-ODR uses before saving
	constexpr fundef.  Invoke PLUGIN_PRE_GENERICIZE before this
	folding.
	* ptree.cc (cxx_print_xnode): Handle TU_LOCAL_ENTITY.
	* tree.cc (bot_manip): Propagate TREE_CONSTANT.
	* typeck2.cc (digest_nsdmi_init): Fold non-ODR uses in NSDMIs.

gcc/testsuite/ChangeLog:

	* g++.dg/cpp0x/constexpr-cast.C: Adjust diagnostics.
	* g++.dg/warn/overflow-warn-1.C: Fix diagnostic checks.
	* g++.dg/warn/overflow-warn-3.C: Likewise.
	* g++.dg/warn/overflow-warn-4.C: Likewise.
	* g++.dg/modules/internal-8_a.C: Remove xfails, supplement with
	additional testcases.
	* g++.dg/modules/internal-8_b.C: New test.

Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
Reviewed-by: Jason Merrill <jason@redhat.com>
2025-12-30 00:15:21 +11:00
Jose E. Marchesi
e7a8c5d198 a68: scope prelude packets
This commit adapts the static scope checker to prelude packets.

Signed-off-by: Jose E. Marchesi <jemarch@gnu.org>

gcc/algol68/ChangeLog

	* a68-parser-scope.cc (scope_module_text): New function.
	(scope_module_declaration): Likewise.
	(scope_particular_program): Likewise.
	(scope_prelude_packet): Likewise.
	(a68_scope_checker): Call scope_particular_program and
	scope_prelude_packet.

gcc/testsuite/ChangeLog

	* algol68/compile/warning-scope-module-1.a68: New test.
	* algol68/compile/warning-scope-module-2.a68: Likewise.
2025-12-29 14:06:15 +01:00
Jakub Jelinek
49c38ba6ab auto-profile.cc: Fix build with C++14
On Tue, Dec 23, 2025 at 11:01:36AM +0530, Dhruv Chawla wrote:
> Committed as:
> - r16-6347-g84058c3cc805f7

This broke building gcc with C++14 system compilers.
../../gcc/auto-profile.cc: In member function ‘std::pair<const char*, int> autofdo::string_table::get_original_name(const char*) const’:
../../gcc/auto-profile.cc:1129:7: warning: init-statement in selection statements only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions]
 1129 |   if (symtab_node *n
      |       ^~~~~~~~~~~
This is valid only in C++17 and later.

Fixed thusly.

2025-12-29  Jakub Jelinek  <jakub@redhat.com>

	* auto-profile.cc (string_table::get_original_name): Avoid using
	init-statement in selection statement.
2025-12-29 14:01:36 +01:00
Rainer Orth
1bcba38291 build: Cherry-pick libtool.m4 support for GNU ld *_sol2 emulations
GNU ld gained separate Solaris-specific linker emulations (*_sol2) long
ago.  Since their introduction, GCC has preferred them over their
non-*_sol2 counterparts but supported both forms.  This has changed for
GCC 16: since all supported versions of GNU ld do support the *_sol2
emulations, GCC now uses them unconditionally.

libtool has also been updated to handle this since libtool 2.4.2 back in
2011.  However, that change has only partially been backported to the
heavily patched libtool.m4 in the GCC tree: the sparcv9 part is there,
but the amd64 part is missing for some reason.  This causes problems
with some recent binutils changes.

Therefore this patch cherry-picks the libtool patch to bring
Solaris/x86_64 in sync with Solaris/sparcv9 and upstream libtool.

Bootstrapped without regressions on {amd64,i386}-pc-solaris2.11 and
{sparcv9,sparc}-sun-solaris2.11.

2025-09-22  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* libtool.m4: Cherry-pick libtool commit
	9196966580f6853a31187a7a3c7e7ff36ef08982.

	gcc:
	* configure: Regenerate.

	libatomic:
	* configure: Regenerate.

	libbacktrace:
	* configure: Regenerate.

	libcc1:
	* configure: Regenerate.

	libffi:
	* configure: Regenerate.

	libga68:
	* configure: Regenerate.

	libgcobol:
	* configure: Regenerate.

	libgfortran:
	* configure: Regenerate.

	libgm2:
	* configure: Regenerate.

	libgomp:
	* configure: Regenerate.

	libgrust:
	* configure: Regenerate.

	libitm:
	* configure: Regenerate.

	libobjc:
	* configure: Regenerate.

	libphobos:
	* configure: Regenerate.

	libquadmath:
	* configure: Regenerate.

	libsanitizer:
	* configure: Regenerate.

	libssp:
	* configure: Regenerate.

	libstdc++-v3:
	* configure: Regenerate.

	libvtv:
	* configure: Regenerate.

	lto-plugin:
	* configure: Regenerate.

	zlib:
	* configure: Regenerate.
2025-12-29 12:09:35 +01:00
Jose E. Marchesi
1b99521483 a68: use LMD instead of LM for mode labels in exports
dwarf2out uses "LM" for line-info labels in text sections, using the
global counter line_info_label_num to get unique label names.  The
Algol 68 exports were using the same string for the mode labels in the
.a68_exports sections using its own private counter.  This led to
assemblers to not be happy whey they find duplicated labels in the
input assembly files.

This commit changes the names of mode labels in Algol 68 export
sections to use the "LMD" string instead.

Signed-off-by: Jose E. Marchesi <jemarch@gnu.org>

gcc/algol68/ChangeLog

	* a68-exports.cc (a68_asm_output_mode): Use .LMDnn labels for
	modes instead of .LMnn.
2025-12-29 04:19:34 +01:00
Hongyu Wang
cac032367d [APX] i386: Use setzucc by default when APX-ZU enabled
When APX-ZU enabled, all legacy setcc can directly use zu sematic to
avoid potential partial-dependency.

gcc/ChangeLog:

	* config/i386/i386.md (*setcc_qi): Force output setzucc for
	reg operand[0].
	(*setcc_qi_slp): Likewise.

gcc/testsuite/ChangeLog:

	* gcc.target/i386/apx-zu-3.c: New test.
2025-12-29 09:15:58 +08:00
Andrew Pinski
c93e74a838 LRA: Fix eliminate regs into a subreg inside a debug insn [PR123295]
So the problem here is during LRA we are eliminating argp and trying to
simplify the RTL as we go but inside a debug insn, almost all subreg
are valid due to gen_lowpart_for_debug done during debug insn simplification.
So simplify_gen_subreg will fail on some subregs and return null.
This causes problems later on. The solution is create a raw SUBREG
like what is done in lra_substitute_pseudo for debug insns.

Bootstrapped and tested on x86_64-linux-gnu.

	PR rtl-optimization/123295
gcc/ChangeLog:

	* lra-eliminations.cc (lra_eliminate_regs_1): For a debug
	insn, create a raw SUBREG if simplify_gen_subreg fails.

gcc/testsuite/ChangeLog:

	* gcc.dg/pr123295-1.c: New test.

Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
2025-12-28 16:21:44 -08:00
GCC Administrator
6bd5a275d2 Daily bump. 2025-12-29 00:16:26 +00:00
Jose E. Marchesi
b276de7be7 a68: add new test program-24.a68
This commit adds a new simple testcase that checks whether publicized
operator priority declarations work as expected.

Signed-off-by: Jose E. Marchesi <jemarch@gnu.org>

gcc/testsuite/ChangeLog

	* algol68/execute/modules/module24.a68: New file.
	* algol68/execute/modules/program-24.a68: New test.
2025-12-28 20:41:09 +01:00
Jose E. Marchesi
a9becd7d35 a68: document finding module exports in the manual
This commit contains some little updates on the ga68 user manual, on
the topic of modules, exports and the modules map.

Signed-off-by: Jose E. Marchesi <jemarch@gnu.org>

gcc/algol68/ChangeLog

	* ga68.texi (Packets): Update to specify only particular programs
	and prelude packets are currently supported.
	(Writing modules): Few updates.
	(Module activation): Likewise.
	(Modules and exports): New section.
2025-12-28 20:05:50 +01:00
Jose E. Marchesi
210a11e1b2 a68: cache moifs in a68_open_packet
Signed-off-by: Jose E. Marchesi <jemarch@gnu.org>

gcc/algol68/ChangeLog

	* a68-imports.cc (a68_open_packet): Use already decoded moifs
	if present.
2025-12-28 16:13:22 +01:00
Jose E. Marchesi
eb5da48dd4 a68: fix deduplication of imported modes
The internal global list of modes maintained by the compiler should
not contain two modes that are equivalent.  When importing module
interfaces, the modes in these interfaces should get deduplicated
before being "interned" in the compiler's modes list.  This commit
fixes the deduplication to accommodate the fact that more than one
module interface may be read from a given packet (compilation unit)
and also that multiple interfaces may be imported indirectly via
publicized modules.

Signed-off-by: Jose E. Marchesi <jemarch@gnu.org>

gcc/algol68/ChangeLog

	* a68-imports.cc (a68_decode_modes): Do not deduplicate imported
	modes here.
	(a68_open_packet): Do it here.
	* a68-parser-extract.cc (extract_revelation): Recurse into
	publicized modules after interning modes in the current module,
	not before.

gcc/testsuite/ChangeLog

	* algol68/execute/modules/module23bar.a68: New test.
	* algol68/execute/modules/module23foo.a68: Likewise.
	* algol68/execute/modules/program-23.a68: Likewise.
2025-12-28 14:33:19 +01:00
Rainer Orth
5212086d0a Support Solaris CTF generation
The Solaris Compact C Type Format, CTF, was introduced back in Solaris
9.  It is the precursor to current GNU CTF, meant primarily for tools
like the low-level debugger mdb or DTrace that would like to avoid the
overhead of full DWARF-2 debugging information.  However, for a long
time creation required separate steps to convert DWARF information
(version 2 only) to CTF in the input objects and later merge this into
the final objects.  The tools to do so were available, but they were
barely documented and their use restricted to the core OS because of
this difficulty.

There's recently been a massive effort to simplify this and allow for
wider adoption.  The native linker has been extended to take GNU CTF
info in the input objects and convert that to Solaris CTF itself.  At
the same time, the massively enhanced tools and the format itself are
fully documented.

To make this even simpler to use, this patch introduces a new -gsctf
option to hide the details from users.  At compile time, it just passes
-gctf to the compiler, and at link time it invokes ld with -z ctf.

Bootstrapped without regressions on i386-pc-solaris2.11 and
sparc-sun-solaris2.11.

2025-11-23  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	gcc:
	* configure.ac (gcc_cv_ld_ctf): New check.
	(gcc_cv_have_ctfmerge): Likewise.
	* configure: Regenerate.
	* config.in: Regenerate.

	* config/sol2.h (SCTF_CC1_SPEC): Define.
	(LINK_SCTF_SPEC): Define.
	(LINK_SPEC): Add LINK_SCTF_SPEC.
	* config/i386/sol2.h (CC1_SPEC): Add SCTF_CC1_SPEC.
	* config/sparc/sol2.h: Likewise.
	* config/sol2.opt (gsctf): Declare.
	* config/sol2.opt.urls: Regenerate.

	* doc/invoke.texi (Option Summary): Add -gsctf.
	(Solaris 2 Options): Document it.
2025-12-28 11:32:37 +01:00
Rainer Orth
a616f73cda testsuite: i386: Fix up check-function-bodies tests
Several recent tests that use check-function-bodies on x86 FAIL on Solaris:
they all lack dg-add-options check_function_bodies which is required to
handle some Solaris differences.  One test also needs -fomit-frame-pointer
to deal with a different Solaris/x86 default.

Tested on i386-pc-solaris2.11 and x86_64-pc-linux-gnu.

2025-12-10  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* gcc.target/i386/20040112-1.c: Add dg-add-options
	check_function_bodies.
	* gcc.target/i386/pr122343-1a.c: Likewise.
	* gcc.target/i386/pr122343-1b.c: Likewise.
	* gcc.target/i386/pr122343-2a.c: Likewise.
	* gcc.target/i386/pr122343-2b.c: Likewise.
	* gcc.target/i386/pr122343-3.c: Likewise.
	* gcc.target/i386/pr122343-4a.c: Likewise.
	* gcc.target/i386/pr122343-4b.c: Likewise.
	* gcc.target/i386/pr122343-5a.c: Likewise.
	* gcc.target/i386/pr122343-5b.c: Likewise.
	* gcc.target/i386/pr122343-6a.c: Likewise.
	* gcc.target/i386/pr122343-6b.c: Likewise.
	* gcc.target/i386/pr122343-7.c: Likewise.
	* gcc.target/i386/pr122675-1.c: Likewise.
	(dg-options): Add -fomit-frame-pointer.
2025-12-28 11:08:07 +01:00
Rainer Orth
413a2aedce Don't check for -xbrace_comment with Solaris/x86 as
With Solaris/x86 as, GCC uses the -xbrace_comment option if supported.
Since it is present in the Solaris 11.4 FCS assembler and 11.4 is the
only supported Solaris version, this check is no longer necessary.

Bootstrapped without regressions on i386-pc-solaris2.11.

2025-12-23  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	gcc:
	* configure.ac (gcc_cv_as_ix86_xbrace_comment): Remove.
	* configure: Regenerate.
	* config.in: Regenerate.
	* config/i386/sol2.h (ASM_XBRACE_COMMENT_SPEC): Adapt guard.
2025-12-28 10:43:04 +01:00
GCC Administrator
a74ef4bd7b Daily bump. 2025-12-28 00:16:28 +00:00
Jose E. Marchesi
f3d9820d2b a68: support for publicized modules
This commit adds support for modules publicizing the exports of other
modules.  For example:

  module GRAMP =
      access pub GRAMP_Symbol,
             pub GRAMP_Word,
             pub GRAMP_Alphabet
  def pub string libgramp_version = "1.0";
      skip
  fed

Signed-off-by: Jose E. Marchesi <jemarch@gnu.org>

gcc/algol68/ChangeLog

	* a68-parser-taxes.cc (tax_module_dec): Do not handle
	DEFINING_MODULE_INDICANT.
	* a68-exports.cc (a68_add_module_to_moif): Do not mangle module
	names in module extracts.
	(add_pub_revelations_to_moif): New function.
	(a68_do_exports): Simplify and call add_pub_revelations_to_moif.
	* a68-imports.cc (a68_decode_moifs): Add all decoded moifs to the
	global list TOP_MOIF.
	* a68-parser-extract.cc (extract_revelation): Recurse to import
	extracts from publicized modules.
	(a68_extract_indicants): Do not add symbol table entries for
	defining modules.
	* a68-types.h (struct TAG_T): Remove field EXPORTED.
	(EXPORTED): Remove macro.
	(TOP_MOIF): Define.
	* a68-parser.cc (a68_parser): Initialize global list of moifs.
	(a68_new_tag): Do not initialize EXPORTED.

gcc/testsuite/ChangeLog

	* algol68/execute/modules/module22bar.a68: New test.
	* algol68/execute/modules/module22foo.a68: Likewise.
	* algol68/execute/modules/program-22.a68: Likewise.
	* algol68/compile/modules/program-11.a68: Adjust test to
	publicized modules.
	* algol68/compile/modules/program-error-multiple-delaration-module-1.a68:
	Likewise.
2025-12-28 00:54:36 +01:00
Pietro Monteiro
f129bfb6a8 libga68: Include ga68.h before system headers
Make sure all declarations added by autoconf are seen by system
headers.

libga68/ChangeLog:

	* ga68-alloc.c: Include ga68.h before all includes.
	* ga68-error.c: Likewise.
	* ga68-standenv.c: Likewise.
	* ga68-unistr.c:  Likewise.

Signed-off-by: Pietro Monteiro <pietro@sociotechnical.xyz>
2025-12-27 14:45:07 -05:00
Jose E. Marchesi
e2ea8d40f1 a68: fix error handling in top-down parser
Signed-off-by: Jose E. Marchesi <jemarch@gnu.org>

gcc/algol68/ChangeLog

	* a68-parser-top-down.cc (a68_top_down_parser): Stop parsing after
	longjump.

gcc/testsuite/ChangeLog

	* algol68/compile/error-loop-1.a68: New test.
2025-12-27 19:54:20 +01:00
Jose E. Marchesi
2a3e308b29 a68: remove coalesce_public_symbols shortcut
As planned, this commit removes a crude hack (the coalescing of 'pub'
symbols right after bottom-up parsing) that I introduced during the
initial implementation of modules.  The goal was to get working
separated compilation as soon as possible.  Now the rest of the
parser, and also the lowerer pass, is made to know about these 'pub'
symbols.

Signed-off-by: Jose E. Marchesi <jemarch@gnu.org>

gcc/algol68/ChangeLog

	* a68-parser-bottom-up.cc (a68_bottom_up_error_check): Do not
	check for the absence of public-symbols.
	(a68_bottom_up_coalesce_pub): Removed function.
	* a68-parser.cc (a68_parser): Do not call
	a68_bottom_up_coalesce_pub
	* a68-parser-extract.cc (a68_extract_indicants): Adapt to the
	presence of public-symbols.
	* a68-parser-modes.cc (get_mode_from_proc_variables): Likewise.
	* a68-parser-taxes.cc (tax_variable_dec): Likewise.
	(tax_proc_variable_dec): Likewise.
	(tax_op_dec): Likewise
	(tax_prio_dec): Likewise.
	* a68-low-decls.cc (a68_lower_mode_declaration): Adapt to the
	presence of public-symbols.
	(a68_lower_variable_declaration): Likewise.
	(a68_lower_identity_declaration): Likewise.
	(a68_lower_procedure_declaration): Likewise.
	(a68_lower_procedure_variable_declaration): Likewise.
	(a68_lower_brief_operator_declaration): Likewise.
	(a68_lower_operator_declaration): Likewise.

gcc/testsuite/ChangeLog

	* algol68/compile/module-2.a68: Expand test a little.
2025-12-27 18:42:38 +01:00
Jose E. Marchesi
4ac337019a a68: avoid pack_soids_in_moid to return unregistered modes
This function fixes the pack_soids_in_moid function so it never
returns a mode that has not been registered.

Signed-off-by: Jose E. Marchesi <jemarch@gnu.org>

gcc/algol68/ChangeLog

	* a68-moids-misc.cc (a68_pack_soids_in_moid): Return the result of
	a68_register_extra_mode.

gcc/testsuite/ChangeLog

	* algol68/execute/pack-soids-in-moid-1.a68: New test.
2025-12-27 16:04:06 +01:00