[gcc] Deleted branch 'mikael/heads/refactor_descriptor_v04' in namespace 'refs/users'
The branch 'mikael/heads/refactor_descriptor_v04' in namespace 'refs/users' was deleted. It previously pointed to: 26b1165b01ae... Réduction usages gfc_conv_descriptor_ubound_get Diff: !!! WARNING: THE FOLLOWING COMMITS ARE NO LONGER ACCESSIBLE (LOST): --- 26b1165... Réduction usages gfc_conv_descriptor_ubound_get 0ae779b... Factorisation gfc_conv_array_extent_dim 8410cda... Suppression export gfc_conv_descriptor_span_set ccd1a87... Suppression modification span 7d797f8... Sauvegarde modifs fichiers générés. 53867f6... Suppression déclarations inutiles.
[gcc(refs/users/mikael/heads/refactor_descriptor_v04)] Réduction usages gfc_conv_descriptor_ubound_get
https://gcc.gnu.org/g:4ea1ba1598c2a1f13384cf9a42aedb33d027d146 commit 4ea1ba1598c2a1f13384cf9a42aedb33d027d146 Author: Mikael Morin Date: Sat Mar 29 15:26:26 2025 +0100 Réduction usages gfc_conv_descriptor_ubound_get Correction régression PR96727.f90 correction ff-descriptor_6.f90 Diff: --- gcc/fortran/trans-array.cc | 48 +++--- gcc/fortran/trans-decl.cc | 6 +- gcc/fortran/trans-expr.cc | 3 +-- gcc/fortran/trans-intrinsic.cc | 44 +++--- gcc/fortran/trans-openmp.cc| 38 ++--- gcc/fortran/trans-stmt.cc | 10 - 6 files changed, 36 insertions(+), 113 deletions(-) diff --git a/gcc/fortran/trans-array.cc b/gcc/fortran/trans-array.cc index 0cda02d7cefc..595ba97aa8ca 100644 --- a/gcc/fortran/trans-array.cc +++ b/gcc/fortran/trans-array.cc @@ -6523,8 +6523,7 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, tree stmtInit, stmtCleanup; tree lbound; tree ubound; - tree dubound; - tree dlbound; + tree dextent; tree dumdesc; tree tmp; tree stride, stride2; @@ -6658,16 +6657,10 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, for (n = 0; n < as->rank; n++) { if (checkparm || !as->upper[n]) - { - /* Get the bounds of the actual parameter. */ - dubound = gfc_conv_descriptor_ubound_get (dumdesc, gfc_rank_cst[n]); - dlbound = gfc_conv_descriptor_lbound_get (dumdesc, gfc_rank_cst[n]); - } + /* Get the bounds of the actual parameter. */ + dextent = gfc_conv_descriptor_extent_get (dumdesc, gfc_rank_cst[n]); else - { - dubound = NULL_TREE; - dlbound = NULL_TREE; - } + dextent = NULL_TREE; lbound = GFC_TYPE_ARRAY_LBOUND (type, n); if (!INTEGER_CST_P (lbound)) @@ -6707,12 +6700,7 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, temp = fold_build2_loc (input_location, PLUS_EXPR, gfc_array_index_type, gfc_index_one_node, temp); - stride2 = fold_build2_loc (input_location, MINUS_EXPR, -gfc_array_index_type, dubound, -dlbound); - stride2 = fold_build2_loc (input_location, PLUS_EXPR, -gfc_array_index_type, -gfc_index_one_node, stride2); + stride2 = dextent; tmp = fold_build2_loc (input_location, NE_EXPR, gfc_array_index_type, temp, stride2); msg = xasprintf ("Dimension %d of array '%s' has extent " @@ -6730,7 +6718,8 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, /* For assumed shape arrays move the upper bound by the same amount as the lower bound. */ tmp = fold_build2_loc (input_location, MINUS_EXPR, -gfc_array_index_type, dubound, dlbound); +gfc_array_index_type, dextent, +gfc_index_one_node); tmp = fold_build2_loc (input_location, PLUS_EXPR, gfc_array_index_type, tmp, lbound); gfc_add_modify (&init, ubound, tmp); @@ -7794,13 +7783,7 @@ gfc_tree_array_size (stmtblock_t *block, tree desc, gfc_expr *expr, tree dim) { if (!dim) dim = gfc_index_zero_node; - tree ubound = gfc_conv_descriptor_ubound_get (desc, dim); - tree lbound = gfc_conv_descriptor_lbound_get (desc, dim); - - size = fold_build2_loc (input_location, MINUS_EXPR, - gfc_array_index_type, ubound, lbound); - size = fold_build2_loc (input_location, PLUS_EXPR, gfc_array_index_type, - size, gfc_index_one_node); + size = gfc_conv_descriptor_extent_get (desc, dim); /* if (!allocatable && !pointer && assumed rank) size = (idx == rank && ubound[rank-1] == -1 ? -1 : size; else @@ -7861,11 +7844,7 @@ gfc_tree_array_size (stmtblock_t *block, tree desc, gfc_expr *expr, tree dim) cond = fold_build2_loc (input_location, TRUTH_AND_EXPR, boolean_type_node, cond, tmp); } - tmp = fold_build2_loc (input_location, MINUS_EXPR, gfc_array_index_type, -gfc_conv_descriptor_ubound_get (desc, idx), -gfc_conv_descriptor_lbound_get (desc, idx)); - tmp = fold_build2_loc (input_location, PLUS_EXPR, gfc_array_index_type, -tmp, gfc_index_one_node); + tmp = gfc_conv_descriptor_extent_get (desc, idx); gfc_add_modify (&cond_block, extent, tmp); tmp = fold_build2_loc (input_location, LT_EXPR, boolean_type_node, extent, gfc_index_zero_node); @@ -102
[gcc r14-11475] Reuse scratch registers generated by LRA
https://gcc.gnu.org/g:d54c8ebda8674fbed85e2a3c4f141ffe9fa7f8a4 commit r14-11475-gd54c8ebda8674fbed85e2a3c4f141ffe9fa7f8a4 Author: Denis Chertykov Date: Thu Oct 17 11:12:38 2024 +0400 Reuse scratch registers generated by LRA Test file: udivmoddi.c problem insn: 484 Before LRA pass we have: (insn 484 483 485 72 (parallel [ (set (reg/v:SI 143 [ __q1 ]) (plus:SI (reg/v:SI 143 [ __q1 ]) (const_int -2 [0xfffe]))) (clobber (scratch:QI)) ]) "udivmoddi.c":163:405 discrim 5 186 {addsi3} (nil)) LRA substitute all scratches with new pseudos, so we have: (insn 484 483 485 72 (parallel [ (set (reg/v:SI 143 [ __q1 ]) (plus:SI (reg/v:SI 143 [ __q1 ]) (const_int -2 [0xfffe]))) (clobber (reg:QI 619)) ]) "/mnt/d/avr-lra/udivmoddi.c":163:405 discrim 5 186 {addsi3} (expr_list:REG_UNUSED (reg:QI 619) (nil))) Pseudo 619 is a special scratch register generated by LRA which is marked in `scratch_bitmap' and can be tested by call `ira_former_scratch_p(regno)'. In dump file (udivmoddi.c.317r.reload) we have: Creating newreg=619 Removing SCRATCH to p619 in insn #484 (nop 3) rescanning insn with uid = 484. After that LRA tries to spill (reg:QI 619) It's a bug because (reg:QI 619) is an output scratch register which is already something like spill register. Fragment from udivmoddi.c.317r.reload: Choosing alt 2 in insn 484: (0) r (1) 0 (2) nYnn (3) &d {addsi3} Creating newreg=728 from oldreg=619, assigning class LD_REGS to r728 IMHO: the bug is in lra-constraints.cc in function `get_reload_reg' fragment of `get_reload_reg': if (type == OP_OUT) { /* Output reload registers tend to start out with a conservative choice of register class. Usually this is ALL_REGS, although a target might narrow it (for performance reasons) through targetm.preferred_reload_class. It's therefore quite common for a reload instruction to require a more restrictive class than the class that was originally assigned to the reload register. In these situations, it's more efficient to refine the choice of register class rather than create a second reload register. This also helps to avoid cycling for registers that are only used by reload instructions. */ if (REG_P (original) && (int) REGNO (original) >= new_regno_start && INSN_UID (curr_insn) >= new_insn_uid_start __^^ && in_class_p (original, rclass, &new_class, true)) { unsigned int regno = REGNO (original); if (lra_dump_file != NULL) { fprintf (lra_dump_file, " Reuse r%d for output ", regno); dump_value_slim (lra_dump_file, original, 1); } This condition incorrectly limits register reuse to ONLY newly generated instructions. i.e. LRA can reuse registers only from insns generated by himself. IMHO:It's wrong. Scratch registers generated by LRA also have to be reused. The patch is very simple. On x86_64, it bootstraps+regtests fine. gcc/ PR target/116550 PR target/119340 * lra-constraints.cc (get_reload_reg): Reuse scratch registers generated by LRA. (cherry picked from commit e7393cbb5f2cae50b42713e71984064073aa378a) Diff: --- gcc/lra-constraints.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc/lra-constraints.cc b/gcc/lra-constraints.cc index dbc5129ae0a2..0065f46f1f0f 100644 --- a/gcc/lra-constraints.cc +++ b/gcc/lra-constraints.cc @@ -679,7 +679,8 @@ get_reload_reg (enum op_type type, machine_mode mode, rtx original, used by reload instructions. */ if (REG_P (original) && (int) REGNO (original) >= new_regno_start - && INSN_UID (curr_insn) >= new_insn_uid_start + && (INSN_UID (curr_insn) >= new_insn_uid_start + || ira_former_scratch_p (REGNO (original))) && in_class_p (original, rclass, &new_class, true)) { unsigned int regno = REGNO (original);
[gcc(refs/users/mikael/heads/refactor_descriptor_v04)] Suppression modification span
https://gcc.gnu.org/g:ccd1a8797bc1c75a443a237755b3394fe75de895 commit ccd1a8797bc1c75a443a237755b3394fe75de895 Author: Mikael Morin Date: Sat Mar 29 11:39:49 2025 +0100 Suppression modification span Diff: --- gcc/fortran/trans-expr.cc | 5 - 1 file changed, 5 deletions(-) diff --git a/gcc/fortran/trans-expr.cc b/gcc/fortran/trans-expr.cc index c5cbe2efca49..171fbd78fe6c 100644 --- a/gcc/fortran/trans-expr.cc +++ b/gcc/fortran/trans-expr.cc @@ -10912,11 +10912,6 @@ gfc_trans_pointer_assignment (gfc_expr * expr1, gfc_expr * expr2) { rse.expr = gfc_class_data_get (rse.expr); gfc_add_modify (&lse.pre, desc, rse.expr); - /* Set the lhs span. */ - tmp = TREE_TYPE (rse.expr); - tmp = TYPE_SIZE_UNIT (gfc_get_element_type (tmp)); - tmp = fold_convert (gfc_array_index_type, tmp); - gfc_conv_descriptor_span_set (&lse.pre, desc, tmp); } else {
[gcc(refs/users/mikael/heads/refactor_descriptor_v04)] Suppression export gfc_conv_descriptor_span_set
https://gcc.gnu.org/g:8410cda2b70228d358313cbacc0fe404c91b3ad2 commit 8410cda2b70228d358313cbacc0fe404c91b3ad2 Author: Mikael Morin Date: Sat Mar 29 11:41:45 2025 +0100 Suppression export gfc_conv_descriptor_span_set Diff: --- gcc/fortran/trans-descriptor.cc | 2 +- gcc/fortran/trans-descriptor.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/gcc/fortran/trans-descriptor.cc b/gcc/fortran/trans-descriptor.cc index bc2055bf3b56..7e709609435c 100644 --- a/gcc/fortran/trans-descriptor.cc +++ b/gcc/fortran/trans-descriptor.cc @@ -721,7 +721,7 @@ gfc_conv_descriptor_span_get (tree desc) return gfc_descriptor::conv_span_get (desc); } -void +static void gfc_conv_descriptor_span_set (stmtblock_t *block, tree desc, tree value) { return gfc_descriptor::conv_span_set (block, desc, value); diff --git a/gcc/fortran/trans-descriptor.h b/gcc/fortran/trans-descriptor.h index 5e8af26d1d8e..b991d2a41895 100644 --- a/gcc/fortran/trans-descriptor.h +++ b/gcc/fortran/trans-descriptor.h @@ -64,7 +64,6 @@ void gfc_conv_descriptor_dtype_set (stmtblock_t *, tree, tree); void gfc_conv_descriptor_version_set (stmtblock_t *, tree, tree); void gfc_conv_descriptor_rank_set (stmtblock_t *, tree, tree); void gfc_conv_descriptor_rank_set (stmtblock_t *, tree, int); -void gfc_conv_descriptor_span_set (stmtblock_t *, tree, tree); void gfc_conv_descriptor_ubound_set (stmtblock_t *, tree, tree, tree); /* CFI descriptor. */
[gcc(refs/users/mikael/heads/refactor_descriptor_v04)] Suppression déclarations inutiles.
https://gcc.gnu.org/g:53867f6799c9b3dacae90f27a0afd6b9fcc8edd0 commit 53867f6799c9b3dacae90f27a0afd6b9fcc8edd0 Author: Mikael Morin Date: Mon Mar 17 20:21:04 2025 +0100 Suppression déclarations inutiles. Diff: --- gcc/fortran/trans-descriptor.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/gcc/fortran/trans-descriptor.h b/gcc/fortran/trans-descriptor.h index 5db80f59a528..5e8af26d1d8e 100644 --- a/gcc/fortran/trans-descriptor.h +++ b/gcc/fortran/trans-descriptor.h @@ -61,13 +61,10 @@ tree gfc_conv_descriptor_token_field (tree); void gfc_conv_descriptor_data_set (stmtblock_t *, tree, tree); void gfc_conv_descriptor_token_set (stmtblock_t *, tree, tree); void gfc_conv_descriptor_dtype_set (stmtblock_t *, tree, tree); -void gfc_conv_descriptor_dimensions_set (stmtblock_t *, tree, tree); void gfc_conv_descriptor_version_set (stmtblock_t *, tree, tree); void gfc_conv_descriptor_rank_set (stmtblock_t *, tree, tree); void gfc_conv_descriptor_rank_set (stmtblock_t *, tree, int); void gfc_conv_descriptor_span_set (stmtblock_t *, tree, tree); -void gfc_conv_descriptor_stride_set (stmtblock_t *, tree, tree, tree); -void gfc_conv_descriptor_lbound_set (stmtblock_t *, tree, tree, tree); void gfc_conv_descriptor_ubound_set (stmtblock_t *, tree, tree, tree); /* CFI descriptor. */
[gcc] Created branch 'mikael/heads/refactor_descriptor_v04' in namespace 'refs/users'
The branch 'mikael/heads/refactor_descriptor_v04' was created in namespace 'refs/users' pointing to: 8410cda2b702... Suppression export gfc_conv_descriptor_span_set
[gcc r15-9024] c++/modules: Fix modules and LTO with header units [PR118961]
https://gcc.gnu.org/g:3258c89fbb092412a69b689425e77972e7a1c567 commit r15-9024-g3258c89fbb092412a69b689425e77972e7a1c567 Author: Nathaniel Shead Date: Fri Mar 28 23:38:26 2025 +1100 c++/modules: Fix modules and LTO with header units [PR118961] This patch makes some adjustments required to get a simple modules testcase working with LTO. There are two main issues fixed. Firstly, modules only streams the maybe-in-charge constructor, and any clones are recreated on stream-in. These clones are copied from the existing function decl and then adjusted. This caused issues because the clones were getting incorrectly marked as abstract, since after clones have been created (in the imported file) the maybe-in-charge decl gets marked as abstract. So this patch just ensures that clones are always created as non-abstract. The second issue is that we need to explicitly tell cgraph that explicit instantiations need to be emitted, otherwise LTO will elide them (as they don't necessarily appear to be used directly) and cause link errors. Additionally, expand_or_defer_fn doesn't setup comdat groups for explicit instantiations, so we need to do that here as well. Currently this is all handled in 'mark_decl_instantiated'; this patch splits out the linkage handling into a separate function that we can call from modules code, maybe in GCC16 we could move this somewhere more central. PR c++/118961 gcc/cp/ChangeLog: * class.cc (copy_fndecl_with_name): Mark clones as non-abstract. * cp-tree.h (setup_explicit_instantiation_definition_linkage): Declare new function. * module.cc (trees_in::read_var_def): Use it. (module_state::read_cluster): Likewise. * pt.cc (setup_explicit_instantiation_definition_linkage): New function. (mark_decl_instantiated): Use it. gcc/testsuite/ChangeLog: * g++.dg/modules/lto-1.h: New test. * g++.dg/modules/lto-1_a.H: New test. * g++.dg/modules/lto-1_b.C: New test. * g++.dg/modules/lto-1_c.C: New test. * g++.dg/modules/lto-2_a.H: New test. * g++.dg/modules/lto-2_b.C: New test. * g++.dg/modules/lto-3_a.H: New test. * g++.dg/modules/lto-3_b.C: New test. Signed-off-by: Nathaniel Shead Reviewed-by: Jason Merrill Diff: --- gcc/cp/class.cc| 1 + gcc/cp/cp-tree.h | 1 + gcc/cp/module.cc | 9 + gcc/cp/pt.cc | 27 ++- gcc/testsuite/g++.dg/modules/lto-1.h | 13 + gcc/testsuite/g++.dg/modules/lto-1_a.H | 9 + gcc/testsuite/g++.dg/modules/lto-1_b.C | 9 + gcc/testsuite/g++.dg/modules/lto-1_c.C | 8 gcc/testsuite/g++.dg/modules/lto-2_a.H | 11 +++ gcc/testsuite/g++.dg/modules/lto-2_b.C | 9 + gcc/testsuite/g++.dg/modules/lto-3_a.H | 6 ++ gcc/testsuite/g++.dg/modules/lto-3_b.C | 10 ++ 12 files changed, 104 insertions(+), 9 deletions(-) diff --git a/gcc/cp/class.cc b/gcc/cp/class.cc index d5ae69b0fdfa..2b694b98e565 100644 --- a/gcc/cp/class.cc +++ b/gcc/cp/class.cc @@ -5169,6 +5169,7 @@ copy_fndecl_with_name (tree fn, tree name, tree_code code, set_constraints (clone, copy_node (ci)); SET_DECL_ASSEMBLER_NAME (clone, NULL_TREE); + DECL_ABSTRACT_P (clone) = false; /* There's no pending inline data for this function. */ DECL_PENDING_INLINE_INFO (clone) = NULL; DECL_PENDING_INLINE_P (clone) = 0; diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index f0b4484ec2a8..2f2122dcf241 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -7692,6 +7692,7 @@ extern tree fn_type_unification (tree, tree, tree, tree, unification_kind_t, int, struct conversion **, bool, bool); +extern void setup_explicit_instantiation_definition_linkage (tree); extern void mark_decl_instantiated (tree, int); extern int more_specialized_fn (tree, tree, int); extern tree type_targs_deducible_from (tree, tree); diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc index 214fb918e8d8..894c70f7225f 100644 --- a/gcc/cp/module.cc +++ b/gcc/cp/module.cc @@ -12737,6 +12737,9 @@ trees_in::read_var_def (tree decl, tree maybe_template) if (maybe_dup && DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (maybe_dup)) DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (decl) = true; tentative_decl_linkage (decl); + if (DECL_EXPLICIT_INSTANTIATION (decl) + && !DECL_EXTERNAL (decl)) + setup_explicit_instantiation_definition_linkage (decl); if (DECL_IMP
[gcc(refs/users/mikael/heads/refactor_descriptor_v04)] Factorisation gfc_conv_array_extent_dim
https://gcc.gnu.org/g:0ae779bf3365bafc7b8f6cc51298779333ba22ed commit 0ae779bf3365bafc7b8f6cc51298779333ba22ed Author: Mikael Morin Date: Sat Mar 29 12:50:41 2025 +0100 Factorisation gfc_conv_array_extent_dim Diff: --- gcc/fortran/trans-intrinsic.cc | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/gcc/fortran/trans-intrinsic.cc b/gcc/fortran/trans-intrinsic.cc index 1b109f822643..cd047aca8149 100644 --- a/gcc/fortran/trans-intrinsic.cc +++ b/gcc/fortran/trans-intrinsic.cc @@ -2359,11 +2359,7 @@ gfc_conv_is_contiguous_expr (gfc_se *se, gfc_expr *arg) { tmp = gfc_conv_descriptor_lbound_get (desc, gfc_rank_cst[i]); extent = gfc_conv_descriptor_ubound_get (desc, gfc_rank_cst[i]); - extent = fold_build2_loc (input_location, MINUS_EXPR, - gfc_array_index_type, extent, tmp); - extent = fold_build2_loc (input_location, PLUS_EXPR, - gfc_array_index_type, extent, - gfc_index_one_node); + extent = gfc_conv_array_extent_dim (tmp, extent, nullptr); tmp = gfc_conv_descriptor_stride_get (desc, gfc_rank_cst[i]); tmp = fold_build2_loc (input_location, MULT_EXPR, TREE_TYPE (tmp), tmp, extent); @@ -2483,10 +2479,7 @@ gfc_conv_intrinsic_bound (gfc_se * se, gfc_expr * expr, enum gfc_isym_id op) ubound = gfc_conv_descriptor_ubound_get (desc, bound); lbound = gfc_conv_descriptor_lbound_get (desc, bound); - size = fold_build2_loc (input_location, MINUS_EXPR, - gfc_array_index_type, ubound, lbound); - size = fold_build2_loc (input_location, PLUS_EXPR, - gfc_array_index_type, size, gfc_index_one_node); + size = gfc_conv_array_extent_dim (lbound, ubound, nullptr); /* 13.14.53: Result value for LBOUND
[gcc r15-9028] libiberty, gcc: Add memrchr to libiberty and use it [PR119283].
https://gcc.gnu.org/g:9018336252463ffed28f01badfdea2a3ca3ba5c8 commit r15-9028-g9018336252463ffed28f01badfdea2a3ca3ba5c8 Author: Iain Sandoe Date: Sat Mar 15 22:30:20 2025 + libiberty, gcc: Add memrchr to libiberty and use it [PR119283]. This adds an implementation of memrchr to libiberty and arranges to configure gcc to use it, if the host does not have it. PR cobol/119283 gcc/ChangeLog: * config.in: Regenerate. * configure: Regenerate. * configure.ac: Check for host memrchr. include/ChangeLog: * libiberty.h (memrchr): New. libiberty/ChangeLog: * Makefile.in: Add memrchr build rules. * config.in: Regenerate. * configure: Regenerate. * configure.ac: Check for memrchr. * functions.texi: Document memrchr. * memrchr.c: New file. Signed-off-by: Iain Sandoe Diff: --- gcc/config.in| 6 ++ gcc/configure| 2 +- gcc/configure.ac | 2 +- include/libiberty.h | 10 ++ libiberty/Makefile.in| 17 + libiberty/config.in | 3 +++ libiberty/configure | 5 +++-- libiberty/configure.ac | 5 +++-- libiberty/functions.texi | 14 ++ libiberty/memrchr.c | 33 + 10 files changed, 87 insertions(+), 10 deletions(-) diff --git a/gcc/config.in b/gcc/config.in index 0d8a6ba18089..7c89cab7717f 100644 --- a/gcc/config.in +++ b/gcc/config.in @@ -1960,6 +1960,12 @@ #endif +/* Define to 1 if you have the `memrchr' function. */ +#ifndef USED_FOR_TARGET +#undef HAVE_MEMRCHR +#endif + + /* Define to 1 if you have the `mmap' function. */ #ifndef USED_FOR_TARGET #undef HAVE_MMAP diff --git a/gcc/configure b/gcc/configure index 063b9ce67011..ab6bec1f0ae7 100755 --- a/gcc/configure +++ b/gcc/configure @@ -10640,7 +10640,7 @@ for ac_func in times clock kill getrlimit setrlimit atoq \ popen sysconf strsignal getrusage nl_langinfo \ gettimeofday mbstowcs wcswidth mmap posix_fallocate setlocale \ clearerr_unlocked feof_unlocked ferror_unlocked fflush_unlocked fgetc_unlocked fgets_unlocked fileno_unlocked fprintf_unlocked fputc_unlocked fputs_unlocked fread_unlocked fwrite_unlocked getchar_unlocked getc_unlocked putchar_unlocked putc_unlocked madvise mallinfo mallinfo2 fstatat getauxval \ - clock_gettime munmap msync get_current_dir_name + clock_gettime munmap msync get_current_dir_name memrchr do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_cxx_check_func "$LINENO" "$ac_func" "$as_ac_var" diff --git a/gcc/configure.ac b/gcc/configure.ac index 3243472680c3..fca0579574fa 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -1574,7 +1574,7 @@ AC_CHECK_FUNCS(times clock kill getrlimit setrlimit atoq \ popen sysconf strsignal getrusage nl_langinfo \ gettimeofday mbstowcs wcswidth mmap posix_fallocate setlocale \ gcc_UNLOCKED_FUNCS madvise mallinfo mallinfo2 fstatat getauxval \ - clock_gettime munmap msync get_current_dir_name) + clock_gettime munmap msync get_current_dir_name memrchr) # At least for glibc, clock_gettime is in librt. But don't pull that # in if it still doesn't give us the function we want. diff --git a/include/libiberty.h b/include/libiberty.h index f2e763a306a1..d4e8791b14ba 100644 --- a/include/libiberty.h +++ b/include/libiberty.h @@ -215,6 +215,16 @@ extern int ffs(int); extern int mkstemps(char *, int); #endif +#if defined (HAVE_DECL_MKSTEMPS) && !HAVE_DECL_MKSTEMPS +extern int mkstemps(char *, int); +#endif + +/* Make memrchr available on systems that do not have it. */ +#if !defined (__GNU_LIBRARY__ ) && !defined (__linux__) && \ +!defined (HAVE_MEMRCHR) +extern void *memrchr(const void *, int, size_t); +#endif + /* Get the working directory. The result is cached, so don't call chdir() between calls to getpwd(). */ diff --git a/libiberty/Makefile.in b/libiberty/Makefile.in index 4870fa95f2f3..ce54d88278d2 100644 --- a/libiberty/Makefile.in +++ b/libiberty/Makefile.in @@ -139,8 +139,8 @@ CFILES = alloca.c argv.c asprintf.c atexit.c \ ldirname.c \ lrealpath.c \ make-relative-prefix.c \ - make-temp-file.c md5.c memchr.c memcmp.c memcpy.c memmem.c \ -memmove.c mempcpy.c memset.c mkstemps.c\ + make-temp-file.c md5.c memchr.c memrchr.c memcmp.c memcpy.c \ + memmem.c memmove.c mempcpy.c memset.c mkstemps.c\ objalloc.c obstack.c\ partition.c pexecute.c \ pex-common.c pex-djgp
[gcc(refs/users/aoliva/heads/testme)] [testsuite] [riscv] limit vwaddsub-1.c to rv64
https://gcc.gnu.org/g:1a1cadba643dbcc53b9ba7990493e5e9fdd24f20 commit 1a1cadba643dbcc53b9ba7990493e5e9fdd24f20 Author: Alexandre Oliva Date: Sat Mar 29 10:04:25 2025 -0300 [testsuite] [riscv] limit vwaddsub-1.c to rv64 The desired vw{add,sub}.wx instructions don't come up on rv32 for the first two functions, we get v{add,sub}.vx instead. I suppose this is an oversight, and something about the test is meant for rv64 only, but the fact that the instruction is spelled out in the intrinsic name and a different instruction is generated suggests something may be wrong after all. for gcc/testsuite/ChangeLog * gcc.target/riscv/rvv/base/vwaddsub-1.c: Require rv64. Diff: --- gcc/testsuite/gcc.target/riscv/rvv/base/vwaddsub-1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/vwaddsub-1.c b/gcc/testsuite/gcc.target/riscv/rvv/base/vwaddsub-1.c index 6e027a555f37..84d3c4cb4c71 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/base/vwaddsub-1.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/vwaddsub-1.c @@ -1,4 +1,4 @@ -/* { dg-do compile { target { ! riscv_abi_e } } } */ +/* { dg-do compile { target { { ! riscv_abi_e } && rv64 } } } */ /* { dg-add-options riscv_v } */ /* { dg-additional-options "-std=gnu99 -O3 -fno-schedule-insns -fno-schedule-insns2" } */
[gcc r15-8426] gccrs: Rework InlineAsmOperand
https://gcc.gnu.org/g:b7f03bbd20d6aab28b85b8edb645ff20badd6d10 commit r15-8426-gb7f03bbd20d6aab28b85b8edb645ff20badd6d10 Author: Owen Avery Date: Thu Oct 10 21:24:50 2024 -0400 gccrs: Rework InlineAsmOperand Not thrilled with some of this boilerplate, but it does seem like an improvement. gcc/rust/ChangeLog: * ast/rust-expr.h (InlineAsmOperand): Replace multiple mutually-exclusive tl::optional fields with a std::unique_ptr and modify nested classes to allow this. Also, make getters return references where possible. * expand/rust-macro-builtins-asm.cc (parse_reg_operand_out): Pass location when constructing InlineAsmOperand. Signed-off-by: Owen Avery Diff: --- gcc/rust/ast/rust-expr.h | 183 +++-- gcc/rust/expand/rust-macro-builtins-asm.cc | 3 +- 2 files changed, 150 insertions(+), 36 deletions(-) diff --git a/gcc/rust/ast/rust-expr.h b/gcc/rust/ast/rust-expr.h index 749fdc05f2ba..438d3d3b86eb 100644 --- a/gcc/rust/ast/rust-expr.h +++ b/gcc/rust/ast/rust-expr.h @@ -4771,7 +4771,7 @@ struct InlineAsmRegOrRegClass class InlineAsmOperand { public: - enum RegisterType + enum class RegisterType { In, Out, @@ -4782,8 +4782,24 @@ public: Label, }; - struct In + class Register { + public: +Register () {} +virtual ~Register () = default; + +std::unique_ptr clone () const +{ + return std::unique_ptr (clone_impl ()); +} + + protected: +virtual Register *clone_impl () const = 0; + }; + + class In : public Register + { + public: tl::optional reg; std::unique_ptr expr; @@ -4808,10 +4824,14 @@ public: return *this; } + + private: +In *clone_impl () const { return new In (*this); } }; - struct Out + class Out : public Register { + public: tl::optional reg; bool late; std::unique_ptr expr; // can be null @@ -4837,10 +4857,14 @@ public: expr = other.expr->clone_expr (); return *this; } + + private: +Out *clone_impl () const { return new Out (*this); } }; - struct InOut + class InOut : public Register { + public: tl::optional reg; bool late; std::unique_ptr expr; // this can't be null @@ -4867,10 +4891,14 @@ public: return *this; } + + private: +InOut *clone_impl () const { return new InOut (*this); } }; - struct SplitInOut + class SplitInOut : public Register { + public: tl::optional reg; bool late; std::unique_ptr in_expr; @@ -4902,15 +4930,23 @@ public: return *this; } + + private: +SplitInOut *clone_impl () const { return new SplitInOut (*this); } }; - struct Const + class Const : public Register { + public: AnonConst anon_const; + + private: +Const *clone_impl () const { return new Const (*this); } }; - struct Sym + class Sym : public Register { + public: std::unique_ptr expr; Sym (std::unique_ptr expr) : expr (std::move (expr)) @@ -4927,10 +4963,14 @@ public: expr = std::unique_ptr (other.expr->clone_expr ()); return *this; } + + private: +Sym *clone_impl () const { return new Sym (*this); } }; - struct Label + class Label : public Register { + public: std::string label_name; std::unique_ptr expr; @@ -4951,27 +4991,37 @@ public: expr = std::unique_ptr (other.expr->clone_expr ()); return *this; } + + private: +Label *clone_impl () const { return new Label (*this); } }; InlineAsmOperand (const InlineAsmOperand &other) -: register_type (other.register_type), in (other.in), out (other.out), - in_out (other.in_out), split_in_out (other.split_in_out), - cnst (other.cnst), sym (other.sym) +: register_type (other.register_type), locus (other.locus), + reg (other.reg->clone ()) {} - InlineAsmOperand (const struct In ®) : register_type (In), in (reg) {} - InlineAsmOperand (const struct Out ®) : register_type (Out), out (reg) {} - InlineAsmOperand (const struct InOut ®) -: register_type (InOut), in_out (reg) + InlineAsmOperand (const In ®, location_t locus) +: register_type (RegisterType::In), locus (locus), reg (new In (reg)) + {} + InlineAsmOperand (const Out ®, location_t locus) +: register_type (RegisterType::Out), locus (locus), reg (new Out (reg)) + {} + InlineAsmOperand (const InOut ®, location_t locus) +: register_type (RegisterType::InOut), locus (locus), reg (new InOut (reg)) + {} + InlineAsmOperand (const SplitInOut ®, location_t locus) +: register_type (RegisterType::SplitInOut), locus (locus), + reg (new SplitInOut (reg)) {} - InlineAsmOperand (const struct SplitInOut ®) -: register_type (SplitInOut), split_in_out (reg) + InlineAsmOperand (const Const ®, location_t locus) +: register_type (RegisterType::Const), lo
[gcc(refs/users/mikael/heads/refactor_descriptor_v04)] Factorisation gfc_conv_array_extent_dim
https://gcc.gnu.org/g:0ae779bf3365bafc7b8f6cc51298779333ba22ed commit 0ae779bf3365bafc7b8f6cc51298779333ba22ed Author: Mikael Morin Date: Sat Mar 29 12:50:41 2025 +0100 Factorisation gfc_conv_array_extent_dim Diff: --- gcc/fortran/trans-intrinsic.cc | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/gcc/fortran/trans-intrinsic.cc b/gcc/fortran/trans-intrinsic.cc index 1b109f822643..cd047aca8149 100644 --- a/gcc/fortran/trans-intrinsic.cc +++ b/gcc/fortran/trans-intrinsic.cc @@ -2359,11 +2359,7 @@ gfc_conv_is_contiguous_expr (gfc_se *se, gfc_expr *arg) { tmp = gfc_conv_descriptor_lbound_get (desc, gfc_rank_cst[i]); extent = gfc_conv_descriptor_ubound_get (desc, gfc_rank_cst[i]); - extent = fold_build2_loc (input_location, MINUS_EXPR, - gfc_array_index_type, extent, tmp); - extent = fold_build2_loc (input_location, PLUS_EXPR, - gfc_array_index_type, extent, - gfc_index_one_node); + extent = gfc_conv_array_extent_dim (tmp, extent, nullptr); tmp = gfc_conv_descriptor_stride_get (desc, gfc_rank_cst[i]); tmp = fold_build2_loc (input_location, MULT_EXPR, TREE_TYPE (tmp), tmp, extent); @@ -2483,10 +2479,7 @@ gfc_conv_intrinsic_bound (gfc_se * se, gfc_expr * expr, enum gfc_isym_id op) ubound = gfc_conv_descriptor_ubound_get (desc, bound); lbound = gfc_conv_descriptor_lbound_get (desc, bound); - size = fold_build2_loc (input_location, MINUS_EXPR, - gfc_array_index_type, ubound, lbound); - size = fold_build2_loc (input_location, PLUS_EXPR, - gfc_array_index_type, size, gfc_index_one_node); + size = gfc_conv_array_extent_dim (lbound, ubound, nullptr); /* 13.14.53: Result value for LBOUND
[gcc(refs/users/aoliva/heads/testme)] [testsuite] [riscv] xfail ssa-dom-cse-2 on riscv64
https://gcc.gnu.org/g:c4601db3f01b1608bd1a65852e3c7267cb4d8b28 commit c4601db3f01b1608bd1a65852e3c7267cb4d8b28 Author: Alexandre Oliva Date: Sat Mar 29 10:04:12 2025 -0300 [testsuite] [riscv] xfail ssa-dom-cse-2 on riscv64 For the same reasons that affect alpha and other targets, gcc.dg/tree-ssa/ssa-dom-cse-2.c fails to be optimized to the expected return statement: the array initializer is vectorized into pairs, and DOM cannot see through that. Add riscv*-*-* to the list of affected lp64 platforms. riscv32 is not affected. for gcc/testsuite/ChangeLog * gcc.dg/tree-ssa/ssa-dom-cse-2.c: XFAIL on riscv lp64. Diff: --- gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-cse-2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-cse-2.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-cse-2.c index 5c89e3f86980..a879d3059714 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-cse-2.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-cse-2.c @@ -27,4 +27,4 @@ foo () but the loop reads only one element at a time, and DOM cannot resolve these. The same happens on powerpc depending on the SIMD support available. */ -/* { dg-final { scan-tree-dump "return 28;" "optimized" { xfail { { alpha*-*-* hppa*64*-*-* nvptx*-*-* mmix-knuth-mmixware } || { { { lp64 && { powerpc*-*-* sparc*-*-* } } || aarch64_sve } || { arm*-*-* && { ! arm_neon } } } } } } } */ +/* { dg-final { scan-tree-dump "return 28;" "optimized" { xfail { { alpha*-*-* hppa*64*-*-* nvptx*-*-* mmix-knuth-mmixware } || { { { lp64 && { powerpc*-*-* sparc*-*-* riscv*-*-* } } || aarch64_sve } || { arm*-*-* && { ! arm_neon } } } } } } } */
[gcc/redhat/heads/gcc-15-branch] (997 commits) Merge commit 'r15-9024-g3258c89fbb092412a69b689425e77972e7a
The branch 'redhat/heads/gcc-15-branch' was updated to point to: 3d14ac28b1c0... Merge commit 'r15-9024-g3258c89fbb092412a69b689425e77972e7a It previously pointed to: 4fe62f20633b... Merge commit 'r15-8028-g6888a4bb584ad3977cb1e8cdefedea70b1f Diff: Summary of changes (added commits): --- 3d14ac2... Merge commit 'r15-9024-g3258c89fbb092412a69b689425e77972e7a 3258c89... c++/modules: Fix modules and LTO with header units [PR11896 (*) 8ad8f74... LoongArch: doc: Add same-address constraint to the descript (*) 6525b40... LoongArch: Set default alignment for functions jumps loops (*) 69a85f1... Daily bump. (*) 1a4aff7... testsuite: Fix up musttail2.C test (*) ea46ef1... cobol: Fix up cobol/{charmaps,valconv}.cc rules (*) d9b56c6... libcpp: Fix incorrect line numbers in large files [PR108900 (*) 878812b... libstdc++: Add testcase for bogus -Wstringop-overflow in st (*) fb13227... Fortran: fix spelling of flag -fallow-invalid-boz (*) 2cb728e... testsuite: Don't cycle through option list for gfortran.dg (*) 7e7ac81... PR modula2/118045: libm2iso.so.20.0.0 contains an unresolva (*) 58b5925... Regenerate common.opt.urls (*) 137e294... cobol: Confine all __int128/_Float128 references to libgcob (*) b69945d... PR modula2/119504: ICE when attempting to access an element (*) b9f08c8... srcextra fixes (*) bb389fb... other/119510 - use --enable-languages=default,cobol for rel (*) dd9ed95... If the LHS does not contain zero, neither do multiply opera (*) dcb7009... bootstrap/119513 - fix cobol bootstrap with --enable-genera (*) 4981d8d... testsuite: Add options for float16 for test [PR119133] (*) ae2f951... cobol: Eliminate check-cobol -Os failure in EVALUATE testca (*) 8b4a843... [COBOL] use native_encode_real (*) e176456... tailc: Handle musttail noreturn calls [PR119483] (*) c95f5a0... ipa-sra: Don't change return type to void if there are must (*) 9ac0ff5... Export native_encode_real operating on REAL_VALUE_TYPE (*) 04e5187... testsuite, riscv: fix broken dg directives (*) d6220c4... testsuite, i386: fix broken dg directives (*) 39d4c1f... testsuite, arm: fix broken dg directives (*) 8ac6399... testsuite, aarch64: fix broken dg directives (*) 7ba5d70... cobol: Do not include (no longer needed) (*) debe66a... Daily bump. (*) 1ee9caf... libstdc++-v3 testsuite: fix malformed dg-require-static-lib (*) c88abca... testsuite: fix some malformed dg-require-* directives (*) 8d6de75... contrib: add dg-lint and libgdiagnostics.py [PR116163] (*) 72ecfe3... cobol: Incorporate new testcases from the cobolworx UAT tes (*) d44aa3e... libcpp: Add missing configure check for setlocale. (*) 2af3281... i386: Fix offset calculation in ix86_redzone_clobber (*) 50f8148... testsuite: Fix up strub-internal-pr112938.C test for C++2{0 (*) f4649a8... Ada: Fix too late initialization of tasking runtime with st (*) 4242ea1... testsuite: fix g++.dg/template/explicit-args6.C (*) 1c5c570... testsuite: Require effective target sigsetjmp for gcov-31/3 (*) cdce649... c++: fix g++.dg/tree-ssa/initlist-opt2.C (*) 22f4125... testsuite: revert Fortran change (*) c35b4bc... RISC-V: testsuite: fix syntax error for assembler scan (*) 176c7a2... testsuite: aarch64: fix another unbalanced } (*) f4b6acf... libstdc++: Replace use of std::min in ranges::uninitialized (*) 16766d5... libstdc++: Use const_cast to workaround tm_zone being non-c (*) fd3bb31... libstdc++: Update tzdata to 2025b (*) 088ed10... target/119010 - add znver{4,5}_insn_both to resolve missing (*) 365c82d... target/119010 - more DFmode handling in zn4zn5 reservations (*) 7d3bbdc... testsuite: fix dg-* typos (*) 6d025f1... testsuite: fix typos in comments (*) 1307de1... testsuite: harmless dg-* whitespace fixes (*) 7e286b5... OpenMP: Fix C++ template handling with append_args' prefer_ (*) 6acfb68... libstdc++: re-bump the feature-test macro for P2562R1 [PR11 (*) aba3018... libstdc++: add constexpr stable_partition (*) 698ef4b... libstdc++: add constexpr inplace_merge (*) 8e99bd4... c++/modules: Handle conflicting ABI tags [PR118920] (*) 3e0768d... c++/modules: Fix tsubst of global module friend classes [PR (*) 3e52eb2... libstdc++: Fix std::ranges::iter_move for function referenc (*) b631ff4... arm: don't vectorize fmaxf() unless unsafe math opts are en (*) 271745b... i386: Set attr "addr" as "gpr16" for constraint "jm". [PR 1 (*) accbc1b... c: Fix tagname confusion for typedef redefinitions [PR11876 (*) 7c8da04... LoongArch: Support Q suffix for __float128. (*) 876a521... OpenMP: Fix declaration in append-args-interop.c test case (*) abd8e46... testsuite: fixup tree scan syntax for strub-internal-pr1129 (*) 042a169... testsuite: assorted targets: add missing braces to dg-* dir (*) 1ecdefb... testsuite: fix more dg-* whitespace issues (*) ec7b129... testsuite: fix dg-message typos (*) e90d6c2... testsuite: more (mostly c
[gcc/aoliva/heads/testme] (1433 commits) [testsuite] [riscv] limit vwaddsub-1.c to rv64
The branch 'aoliva/heads/testme' was updated to point to: 1a1cadba643d... [testsuite] [riscv] limit vwaddsub-1.c to rv64 It previously pointed to: 79f456a1cd84... [testsuite] add x86 effective target Diff: !!! WARNING: THE FOLLOWING COMMITS ARE NO LONGER ACCESSIBLE (LOST): --- 79f456a... [testsuite] add x86 effective target 9ed3973... [testsuite] adjust expectations of x86 vect-simd-clone test Summary of changes (added commits): --- 1a1cadb... [testsuite] [riscv] limit vwaddsub-1.c to rv64 5d5cf8e... [testsuite] [riscv] limit mcpu-xiangshan-nanhu.c to rv64 2653791... [testsuite] [riscv] xfail some [PR113281] tests 79f6390... [testsuite] [riscv] xfail update-threading on riscv [PR1106 c4601db... [testsuite] [riscv] xfail ssa-dom-cse-2 on riscv64 5ac4be2... c++: optimize push_to_top_level [PR64500] (*) 39bea4b... c++: Fix comment typo (*) 3258c89... c++/modules: Fix modules and LTO with header units [PR11896 (*) 8ad8f74... LoongArch: doc: Add same-address constraint to the descript (*) 6525b40... LoongArch: Set default alignment for functions jumps loops (*) 69a85f1... Daily bump. (*) 1a4aff7... testsuite: Fix up musttail2.C test (*) ea46ef1... cobol: Fix up cobol/{charmaps,valconv}.cc rules (*) d9b56c6... libcpp: Fix incorrect line numbers in large files [PR108900 (*) 878812b... libstdc++: Add testcase for bogus -Wstringop-overflow in st (*) fb13227... Fortran: fix spelling of flag -fallow-invalid-boz (*) 2cb728e... testsuite: Don't cycle through option list for gfortran.dg (*) 7e7ac81... PR modula2/118045: libm2iso.so.20.0.0 contains an unresolva (*) 58b5925... Regenerate common.opt.urls (*) 137e294... cobol: Confine all __int128/_Float128 references to libgcob (*) b69945d... PR modula2/119504: ICE when attempting to access an element (*) b9f08c8... srcextra fixes (*) bb389fb... other/119510 - use --enable-languages=default,cobol for rel (*) dd9ed95... If the LHS does not contain zero, neither do multiply opera (*) dcb7009... bootstrap/119513 - fix cobol bootstrap with --enable-genera (*) 4981d8d... testsuite: Add options for float16 for test [PR119133] (*) ae2f951... cobol: Eliminate check-cobol -Os failure in EVALUATE testca (*) 8b4a843... [COBOL] use native_encode_real (*) e176456... tailc: Handle musttail noreturn calls [PR119483] (*) c95f5a0... ipa-sra: Don't change return type to void if there are must (*) 9ac0ff5... Export native_encode_real operating on REAL_VALUE_TYPE (*) 04e5187... testsuite, riscv: fix broken dg directives (*) d6220c4... testsuite, i386: fix broken dg directives (*) 39d4c1f... testsuite, arm: fix broken dg directives (*) 8ac6399... testsuite, aarch64: fix broken dg directives (*) 7ba5d70... cobol: Do not include (no longer needed) (*) debe66a... Daily bump. (*) 1ee9caf... libstdc++-v3 testsuite: fix malformed dg-require-static-lib (*) c88abca... testsuite: fix some malformed dg-require-* directives (*) 8d6de75... contrib: add dg-lint and libgdiagnostics.py [PR116163] (*) 72ecfe3... cobol: Incorporate new testcases from the cobolworx UAT tes (*) d44aa3e... libcpp: Add missing configure check for setlocale. (*) 2af3281... i386: Fix offset calculation in ix86_redzone_clobber (*) 50f8148... testsuite: Fix up strub-internal-pr112938.C test for C++2{0 (*) f4649a8... Ada: Fix too late initialization of tasking runtime with st (*) 4242ea1... testsuite: fix g++.dg/template/explicit-args6.C (*) 1c5c570... testsuite: Require effective target sigsetjmp for gcov-31/3 (*) cdce649... c++: fix g++.dg/tree-ssa/initlist-opt2.C (*) 22f4125... testsuite: revert Fortran change (*) c35b4bc... RISC-V: testsuite: fix syntax error for assembler scan (*) 176c7a2... testsuite: aarch64: fix another unbalanced } (*) f4b6acf... libstdc++: Replace use of std::min in ranges::uninitialized (*) 16766d5... libstdc++: Use const_cast to workaround tm_zone being non-c (*) fd3bb31... libstdc++: Update tzdata to 2025b (*) 088ed10... target/119010 - add znver{4,5}_insn_both to resolve missing (*) 365c82d... target/119010 - more DFmode handling in zn4zn5 reservations (*) 7d3bbdc... testsuite: fix dg-* typos (*) 6d025f1... testsuite: fix typos in comments (*) 1307de1... testsuite: harmless dg-* whitespace fixes (*) 7e286b5... OpenMP: Fix C++ template handling with append_args' prefer_ (*) 6acfb68... libstdc++: re-bump the feature-test macro for P2562R1 [PR11 (*) aba3018... libstdc++: add constexpr stable_partition (*) 698ef4b... libstdc++: add constexpr inplace_merge (*) 8e99bd4... c++/modules: Handle conflicting ABI tags [PR118920] (*) 3e0768d... c++/modules: Fix tsubst of global module friend classes [PR (*) 3e52eb2... libstdc++: Fix std::ranges::iter_move for function referenc (*) b631ff4... arm: don't vectorize fmaxf() unless unsafe math opts are en (*) 271745b... i386: S
[gcc/aoliva/heads/testbase] (1428 commits) c++: optimize push_to_top_level [PR64500]
The branch 'aoliva/heads/testbase' was updated to point to: 5ac4be28822a... c++: optimize push_to_top_level [PR64500] It previously pointed to: f039584e9e6c... [testsuite] fix check-function-bodies usage Diff: Summary of changes (added commits): --- 5ac4be2... c++: optimize push_to_top_level [PR64500] (*) 39bea4b... c++: Fix comment typo (*) 3258c89... c++/modules: Fix modules and LTO with header units [PR11896 (*) 8ad8f74... LoongArch: doc: Add same-address constraint to the descript (*) 6525b40... LoongArch: Set default alignment for functions jumps loops (*) 69a85f1... Daily bump. (*) 1a4aff7... testsuite: Fix up musttail2.C test (*) ea46ef1... cobol: Fix up cobol/{charmaps,valconv}.cc rules (*) d9b56c6... libcpp: Fix incorrect line numbers in large files [PR108900 (*) 878812b... libstdc++: Add testcase for bogus -Wstringop-overflow in st (*) fb13227... Fortran: fix spelling of flag -fallow-invalid-boz (*) 2cb728e... testsuite: Don't cycle through option list for gfortran.dg (*) 7e7ac81... PR modula2/118045: libm2iso.so.20.0.0 contains an unresolva (*) 58b5925... Regenerate common.opt.urls (*) 137e294... cobol: Confine all __int128/_Float128 references to libgcob (*) b69945d... PR modula2/119504: ICE when attempting to access an element (*) b9f08c8... srcextra fixes (*) bb389fb... other/119510 - use --enable-languages=default,cobol for rel (*) dd9ed95... If the LHS does not contain zero, neither do multiply opera (*) dcb7009... bootstrap/119513 - fix cobol bootstrap with --enable-genera (*) 4981d8d... testsuite: Add options for float16 for test [PR119133] (*) ae2f951... cobol: Eliminate check-cobol -Os failure in EVALUATE testca (*) 8b4a843... [COBOL] use native_encode_real (*) e176456... tailc: Handle musttail noreturn calls [PR119483] (*) c95f5a0... ipa-sra: Don't change return type to void if there are must (*) 9ac0ff5... Export native_encode_real operating on REAL_VALUE_TYPE (*) 04e5187... testsuite, riscv: fix broken dg directives (*) d6220c4... testsuite, i386: fix broken dg directives (*) 39d4c1f... testsuite, arm: fix broken dg directives (*) 8ac6399... testsuite, aarch64: fix broken dg directives (*) 7ba5d70... cobol: Do not include (no longer needed) (*) debe66a... Daily bump. (*) 1ee9caf... libstdc++-v3 testsuite: fix malformed dg-require-static-lib (*) c88abca... testsuite: fix some malformed dg-require-* directives (*) 8d6de75... contrib: add dg-lint and libgdiagnostics.py [PR116163] (*) 72ecfe3... cobol: Incorporate new testcases from the cobolworx UAT tes (*) d44aa3e... libcpp: Add missing configure check for setlocale. (*) 2af3281... i386: Fix offset calculation in ix86_redzone_clobber (*) 50f8148... testsuite: Fix up strub-internal-pr112938.C test for C++2{0 (*) f4649a8... Ada: Fix too late initialization of tasking runtime with st (*) 4242ea1... testsuite: fix g++.dg/template/explicit-args6.C (*) 1c5c570... testsuite: Require effective target sigsetjmp for gcov-31/3 (*) cdce649... c++: fix g++.dg/tree-ssa/initlist-opt2.C (*) 22f4125... testsuite: revert Fortran change (*) c35b4bc... RISC-V: testsuite: fix syntax error for assembler scan (*) 176c7a2... testsuite: aarch64: fix another unbalanced } (*) f4b6acf... libstdc++: Replace use of std::min in ranges::uninitialized (*) 16766d5... libstdc++: Use const_cast to workaround tm_zone being non-c (*) fd3bb31... libstdc++: Update tzdata to 2025b (*) 088ed10... target/119010 - add znver{4,5}_insn_both to resolve missing (*) 365c82d... target/119010 - more DFmode handling in zn4zn5 reservations (*) 7d3bbdc... testsuite: fix dg-* typos (*) 6d025f1... testsuite: fix typos in comments (*) 1307de1... testsuite: harmless dg-* whitespace fixes (*) 7e286b5... OpenMP: Fix C++ template handling with append_args' prefer_ (*) 6acfb68... libstdc++: re-bump the feature-test macro for P2562R1 [PR11 (*) aba3018... libstdc++: add constexpr stable_partition (*) 698ef4b... libstdc++: add constexpr inplace_merge (*) 8e99bd4... c++/modules: Handle conflicting ABI tags [PR118920] (*) 3e0768d... c++/modules: Fix tsubst of global module friend classes [PR (*) 3e52eb2... libstdc++: Fix std::ranges::iter_move for function referenc (*) b631ff4... arm: don't vectorize fmaxf() unless unsafe math opts are en (*) 271745b... i386: Set attr "addr" as "gpr16" for constraint "jm". [PR 1 (*) accbc1b... c: Fix tagname confusion for typedef redefinitions [PR11876 (*) 7c8da04... LoongArch: Support Q suffix for __float128. (*) 876a521... OpenMP: Fix declaration in append-args-interop.c test case (*) abd8e46... testsuite: fixup tree scan syntax for strub-internal-pr1129 (*) 042a169... testsuite: assorted targets: add missing braces to dg-* dir (*) 1ecdefb... testsuite: fix more dg-* whitespace issues (*) ec7b129... testsuite: fix dg-message typos (*) e90d6c2... testsuite: more (mostly cosmetic) dg- w
[gcc(refs/users/aoliva/heads/testme)] [testsuite] [riscv] xfail some [PR113281] tests
https://gcc.gnu.org/g:26537916d9c3cac7930a7597fe1f8cb6274245fe commit 26537916d9c3cac7930a7597fe1f8cb6274245fe Author: Alexandre Oliva Date: Sat Mar 29 10:04:19 2025 -0300 [testsuite] [riscv] xfail some [PR113281] tests Some of the tests regressed with a fix for the vectorization of shifts. The riscv cost models need to be adjusted to avoid the unprofitable optimization. The failure of these tests has been known since 2024-03-13, without a forthcoming fix, so I suggest we consider it expected by now. Adjust the tests to reflect that expectation. for gcc/testsuite/ChangeLog PR tree-optimization/113281 * gcc.dg/vect/costmodel/riscv/rvv/pr113281-1.c: XFAIL. * gcc.dg/vect/costmodel/riscv/rvv/pr113281-2.c: Likewise. * gcc.dg/vect/costmodel/riscv/rvv/pr113281-5.c: Likewise. Diff: --- gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/pr113281-1.c | 2 +- gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/pr113281-2.c | 2 +- gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/pr113281-5.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/pr113281-1.c b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/pr113281-1.c index fdf6ed0334b7..683533fe9562 100644 --- a/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/pr113281-1.c +++ b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/pr113281-1.c @@ -15,4 +15,4 @@ int main() { return 1; } -/* { dg-final { scan-assembler-not {vset} } } */ +/* { dg-final { scan-assembler-not {vset} { xfail *-*-* } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/pr113281-2.c b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/pr113281-2.c index acc70810b4b2..94435d332bd7 100644 --- a/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/pr113281-2.c +++ b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/pr113281-2.c @@ -15,4 +15,4 @@ int main() { return 1; } -/* { dg-final { scan-assembler-not {vset} } } */ +/* { dg-final { scan-assembler-not {vset} { xfail *-*-* } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/pr113281-5.c b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/pr113281-5.c index 0163129be187..415c4bdd137c 100644 --- a/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/pr113281-5.c +++ b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/pr113281-5.c @@ -15,4 +15,4 @@ int main() { return 1; } -/* { dg-final { scan-assembler-not {vset} } } */ +/* { dg-final { scan-assembler-not {vset} { xfail *-*-* } } } */
[gcc r15-9029] c++/modules: unexported friend template
https://gcc.gnu.org/g:eb26b667518c951d06f3c51118a1d41dcdda8b99 commit r15-9029-geb26b667518c951d06f3c51118a1d41dcdda8b99 Author: Jason Merrill Date: Sat Mar 29 08:56:09 2025 -0400 c++/modules: unexported friend template Here we were failing to match the injected friend declaration to the definition because the latter isn't exported. But the friend is attached to the module, so we need to look for any reachable declaration in that module, not just the exports. The duplicate_decls change is to avoid clobbering DECL_MODULE_IMPORT_P on the imported definition; matching an injected friend doesn't change that it's imported. I considered checking get_originating_module == 0 or !decl_defined_p instead of DECL_UNIQUE_FRIEND_P there, but I think this situation is specific to friends. I removed an assert because we have a test for the same condition a few lines above. gcc/cp/ChangeLog: * decl.cc (duplicate_decls): Don't clobber DECL_MODULE_IMPORT_P with an injected friend. * name-lookup.cc (check_module_override): Look at all reachable decls in decl's originating module. gcc/testsuite/ChangeLog: * g++.dg/modules/friend-9_a.C: New test. * g++.dg/modules/friend-9_b.C: New test. Diff: --- gcc/cp/decl.cc| 6 -- gcc/cp/name-lookup.cc | 19 ++- gcc/testsuite/g++.dg/modules/friend-9_a.C | 13 + gcc/testsuite/g++.dg/modules/friend-9_b.C | 13 + 4 files changed, 40 insertions(+), 11 deletions(-) diff --git a/gcc/cp/decl.cc b/gcc/cp/decl.cc index a785d5e79cbf..7d10b228ec62 100644 --- a/gcc/cp/decl.cc +++ b/gcc/cp/decl.cc @@ -2539,8 +2539,10 @@ duplicate_decls (tree newdecl, tree olddecl, bool hiding, bool was_hidden) } /* Propagate purviewness and importingness as with -set_instantiating_module. */ - if (modules_p () && DECL_LANG_SPECIFIC (new_result)) +set_instantiating_module, unless newdecl is a friend injection. */ + if (modules_p () && DECL_LANG_SPECIFIC (new_result) + && !(TREE_CODE (new_result) == FUNCTION_DECL + && DECL_UNIQUE_FRIEND_P (new_result))) { if (DECL_MODULE_PURVIEW_P (new_result)) DECL_MODULE_PURVIEW_P (old_result) = true; diff --git a/gcc/cp/name-lookup.cc b/gcc/cp/name-lookup.cc index df033edafc76..7fadbccfe393 100644 --- a/gcc/cp/name-lookup.cc +++ b/gcc/cp/name-lookup.cc @@ -3777,6 +3777,10 @@ check_module_override (tree decl, tree mvec, bool hiding, any reachable declaration, so we should check for overriding here too. */ bool any_reachable = deduction_guide_p (decl); + /* DECL might have an originating module if it's an instantiation of a + friend; we want to look at all reachable decls in that module. */ + unsigned decl_mod = get_originating_module (decl); + if (BINDING_VECTOR_SLOTS_PER_CLUSTER == BINDING_SLOTS_FIXED) { cluster++; @@ -3789,18 +3793,15 @@ check_module_override (tree decl, tree mvec, bool hiding, /* Are we importing this module? */ if (cluster->indices[jx].span != 1) continue; - if (!cluster->indices[jx].base) + unsigned cluster_mod = cluster->indices[jx].base; + if (!cluster_mod) continue; - if (!any_reachable - && !bitmap_bit_p (imports, cluster->indices[jx].base)) + bool c_any_reachable = (any_reachable || cluster_mod == decl_mod); + if (!c_any_reachable && !bitmap_bit_p (imports, cluster_mod)) continue; /* Is it loaded? */ if (cluster->slots[jx].is_lazy ()) - { - gcc_assert (cluster->indices[jx].span == 1); - lazy_load_binding (cluster->indices[jx].base, - scope, name, &cluster->slots[jx]); - } + lazy_load_binding (cluster_mod, scope, name, &cluster->slots[jx]); tree bind = cluster->slots[jx]; if (!bind) /* Errors could cause there to be nothing. */ @@ -3812,7 +3813,7 @@ check_module_override (tree decl, tree mvec, bool hiding, /* If there was a matching STAT_TYPE here then xref_tag should have found it, but we need to check anyway because a conflicting using-declaration may exist. */ - if (any_reachable) + if (c_any_reachable) { type = STAT_TYPE (bind); bind = STAT_DECL (bind); diff --git a/gcc/testsuite/g++.dg/modules/friend-9_a.C b/gcc/testsuite/g++.dg/modules/friend-9_a.C new file mode 100644 index ..ca95027b470f --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/friend-9_a.C @@ -0,0 +1,13 @@ +// { dg-additional-options -fmodules } +// { dg-module-cmi M } +// { dg-module-do link } + +export module M; + +export template struct A +{ + template friend void f (U); +}
[gcc r15-9027] jit, Darwin: Update exports with ABI 28 throught 34.
https://gcc.gnu.org/g:eb2182479fa9e0d747c3ba595213d840f85614df commit r15-9027-geb2182479fa9e0d747c3ba595213d840f85614df Author: Iain Sandoe Date: Sat Mar 29 13:47:27 2025 + jit, Darwin: Update exports with ABI 28 throught 34. Synchronise the darwin export list with the current map. gcc/jit/ChangeLog: * libgccjit.exports: Add symbols for ABI 28 to 34. Signed-off-by: Iain Sandoe Diff: --- gcc/jit/libgccjit.exports | 21 + 1 file changed, 21 insertions(+) diff --git a/gcc/jit/libgccjit.exports b/gcc/jit/libgccjit.exports index e32bbe2fd408..26dc634a0e8f 100644 --- a/gcc/jit/libgccjit.exports +++ b/gcc/jit/libgccjit.exports @@ -230,4 +230,25 @@ _gcc_jit_function_add_integer_array_attribute # LIBGCCJIT_ABI_27 _gcc_jit_context_new_sizeof +# LIBGCCJIT_ABI_28 +_gcc_jit_context_new_alignof + +# LIBGCCJIT_ABI_29 +_gcc_jit_global_set_readonly + +# LIBGCCJIT_ABI_30 +_gcc_jit_context_convert_vector + +# LIBGCCJIT_ABI_31 +_gcc_jit_context_new_vector_access +_gcc_jit_context_new_rvalue_vector_perm + +# LIBGCCJIT_ABI_32 +_gcc_jit_context_get_target_builtin_function + +# LIBGCCJIT_ABI_33 +_gcc_jit_function_new_temp + +# LIBGCCJIT_ABI_34 +_gcc_jit_context_set_output_ident
[gcc(refs/users/mikael/heads/refactor_descriptor_v04)] Réduction usages gfc_conv_descriptor_ubound_get
https://gcc.gnu.org/g:ae46f3a492f896c2ef2abb80b3fd7fe3ea04147a commit ae46f3a492f896c2ef2abb80b3fd7fe3ea04147a Author: Mikael Morin Date: Sat Mar 29 15:26:26 2025 +0100 Réduction usages gfc_conv_descriptor_ubound_get Diff: --- gcc/fortran/trans-array.cc | 52 -- gcc/fortran/trans-decl.cc | 6 + gcc/fortran/trans-expr.cc | 3 +-- gcc/fortran/trans-intrinsic.cc | 44 ++- gcc/fortran/trans-openmp.cc| 38 +- gcc/fortran/trans-stmt.cc | 10 6 files changed, 38 insertions(+), 115 deletions(-) diff --git a/gcc/fortran/trans-array.cc b/gcc/fortran/trans-array.cc index 0cda02d7cefc..44b21c3c80c8 100644 --- a/gcc/fortran/trans-array.cc +++ b/gcc/fortran/trans-array.cc @@ -6523,8 +6523,7 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, tree stmtInit, stmtCleanup; tree lbound; tree ubound; - tree dubound; - tree dlbound; + tree dextent; tree dumdesc; tree tmp; tree stride, stride2; @@ -6658,16 +6657,10 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, for (n = 0; n < as->rank; n++) { if (checkparm || !as->upper[n]) - { - /* Get the bounds of the actual parameter. */ - dubound = gfc_conv_descriptor_ubound_get (dumdesc, gfc_rank_cst[n]); - dlbound = gfc_conv_descriptor_lbound_get (dumdesc, gfc_rank_cst[n]); - } + /* Get the bounds of the actual parameter. */ + dextent = gfc_conv_descriptor_extent_get (dumdesc, gfc_rank_cst[n]); else - { - dubound = NULL_TREE; - dlbound = NULL_TREE; - } + dextent = NULL_TREE; lbound = GFC_TYPE_ARRAY_LBOUND (type, n); if (!INTEGER_CST_P (lbound)) @@ -6707,12 +6700,7 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, temp = fold_build2_loc (input_location, PLUS_EXPR, gfc_array_index_type, gfc_index_one_node, temp); - stride2 = fold_build2_loc (input_location, MINUS_EXPR, -gfc_array_index_type, dubound, -dlbound); - stride2 = fold_build2_loc (input_location, PLUS_EXPR, -gfc_array_index_type, -gfc_index_one_node, stride2); + stride2 = dextent; tmp = fold_build2_loc (input_location, NE_EXPR, gfc_array_index_type, temp, stride2); msg = xasprintf ("Dimension %d of array '%s' has extent " @@ -6730,7 +6718,8 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, /* For assumed shape arrays move the upper bound by the same amount as the lower bound. */ tmp = fold_build2_loc (input_location, MINUS_EXPR, -gfc_array_index_type, dubound, dlbound); +gfc_array_index_type, dextent, +gfc_index_one_node); tmp = fold_build2_loc (input_location, PLUS_EXPR, gfc_array_index_type, tmp, lbound); gfc_add_modify (&init, ubound, tmp); @@ -7794,13 +7783,7 @@ gfc_tree_array_size (stmtblock_t *block, tree desc, gfc_expr *expr, tree dim) { if (!dim) dim = gfc_index_zero_node; - tree ubound = gfc_conv_descriptor_ubound_get (desc, dim); - tree lbound = gfc_conv_descriptor_lbound_get (desc, dim); - - size = fold_build2_loc (input_location, MINUS_EXPR, - gfc_array_index_type, ubound, lbound); - size = fold_build2_loc (input_location, PLUS_EXPR, gfc_array_index_type, - size, gfc_index_one_node); + size = gfc_conv_descriptor_extent_get (desc, dim); /* if (!allocatable && !pointer && assumed rank) size = (idx == rank && ubound[rank-1] == -1 ? -1 : size; else @@ -7816,7 +7799,7 @@ gfc_tree_array_size (stmtblock_t *block, tree desc, gfc_expr *expr, tree dim) fold_convert (signed_char_type_node, dim), tmp); tmp = fold_build2_loc (input_location, EQ_EXPR, boolean_type_node, -gfc_conv_descriptor_ubound_get (desc, dim), +gfc_conv_descriptor_extent_get (desc, dim), build_int_cst (gfc_array_index_type, -1)); cond = fold_build2_loc (input_location, TRUTH_AND_EXPR, boolean_type_node, cond, tmp); @@ -7856,16 +7839,12 @@ gfc_tree_array_size (stmtblock_t *block, tree desc, gfc_expr *expr, tree dim) cond = fold_build2_loc (input_location, EQ_EXPR, boolean_type_node, idx, tmp); tmp = fold
[gcc r15-9025] c++: Fix comment typo
https://gcc.gnu.org/g:39bea4b71f0ee45756e68b9e74002b0ca25606e4 commit r15-9025-g39bea4b71f0ee45756e68b9e74002b0ca25606e4 Author: Jakub Jelinek Date: Sat Mar 29 13:26:38 2025 +0100 c++: Fix comment typo Found a typo in a comment. 2025-03-29 Jakub Jelinek * name-lookup.cc (maybe_lazily_declare): Fix comment typo, anout -> about. Diff: --- gcc/cp/name-lookup.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/cp/name-lookup.cc b/gcc/cp/name-lookup.cc index 7f1ee869d523..d3aa47baafe6 100644 --- a/gcc/cp/name-lookup.cc +++ b/gcc/cp/name-lookup.cc @@ -2012,8 +2012,8 @@ get_class_binding_direct (tree klass, tree name, bool want_type) static void maybe_lazily_declare (tree klass, tree name) { - /* See big comment anout module_state::write_pendings regarding adding a check - bit. */ + /* See big comment about module_state::write_pendings regarding adding + a check bit. */ if (modules_p ()) lazy_load_pendings (TYPE_NAME (klass));
[gcc] Created branch 'mikael/heads/refactor_descriptor_v04' in namespace 'refs/users'
The branch 'mikael/heads/refactor_descriptor_v04' was created in namespace 'refs/users' pointing to: 26b1165b01ae... Réduction usages gfc_conv_descriptor_ubound_get
[gcc(refs/users/mikael/heads/refactor_descriptor_v04)] Suppression déclarations inutiles.
https://gcc.gnu.org/g:53867f6799c9b3dacae90f27a0afd6b9fcc8edd0 commit 53867f6799c9b3dacae90f27a0afd6b9fcc8edd0 Author: Mikael Morin Date: Mon Mar 17 20:21:04 2025 +0100 Suppression déclarations inutiles. Diff: --- gcc/fortran/trans-descriptor.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/gcc/fortran/trans-descriptor.h b/gcc/fortran/trans-descriptor.h index 5db80f59a528..5e8af26d1d8e 100644 --- a/gcc/fortran/trans-descriptor.h +++ b/gcc/fortran/trans-descriptor.h @@ -61,13 +61,10 @@ tree gfc_conv_descriptor_token_field (tree); void gfc_conv_descriptor_data_set (stmtblock_t *, tree, tree); void gfc_conv_descriptor_token_set (stmtblock_t *, tree, tree); void gfc_conv_descriptor_dtype_set (stmtblock_t *, tree, tree); -void gfc_conv_descriptor_dimensions_set (stmtblock_t *, tree, tree); void gfc_conv_descriptor_version_set (stmtblock_t *, tree, tree); void gfc_conv_descriptor_rank_set (stmtblock_t *, tree, tree); void gfc_conv_descriptor_rank_set (stmtblock_t *, tree, int); void gfc_conv_descriptor_span_set (stmtblock_t *, tree, tree); -void gfc_conv_descriptor_stride_set (stmtblock_t *, tree, tree, tree); -void gfc_conv_descriptor_lbound_set (stmtblock_t *, tree, tree, tree); void gfc_conv_descriptor_ubound_set (stmtblock_t *, tree, tree, tree); /* CFI descriptor. */
[gcc] Deleted branch 'mikael/heads/refactor_descriptor_v04' in namespace 'refs/users'
The branch 'mikael/heads/refactor_descriptor_v04' in namespace 'refs/users' was deleted. It previously pointed to: ae46f3a492f8... Réduction usages gfc_conv_descriptor_ubound_get Diff: !!! WARNING: THE FOLLOWING COMMITS ARE NO LONGER ACCESSIBLE (LOST): --- ae46f3a... Réduction usages gfc_conv_descriptor_ubound_get 0ae779b... Factorisation gfc_conv_array_extent_dim 8410cda... Suppression export gfc_conv_descriptor_span_set ccd1a87... Suppression modification span 7d797f8... Sauvegarde modifs fichiers générés. 53867f6... Suppression déclarations inutiles.
[gcc(refs/users/mikael/heads/refactor_descriptor_v04)] Réduction usages gfc_conv_descriptor_ubound_get
https://gcc.gnu.org/g:26b1165b01ae50757befe541c1873561d1f4ded8 commit 26b1165b01ae50757befe541c1873561d1f4ded8 Author: Mikael Morin Date: Sat Mar 29 15:26:26 2025 +0100 Réduction usages gfc_conv_descriptor_ubound_get Correction régression PR96727.f90 Diff: --- gcc/fortran/trans-array.cc | 52 -- gcc/fortran/trans-decl.cc | 6 + gcc/fortran/trans-expr.cc | 3 +-- gcc/fortran/trans-intrinsic.cc | 44 ++- gcc/fortran/trans-openmp.cc| 38 +- gcc/fortran/trans-stmt.cc | 10 6 files changed, 38 insertions(+), 115 deletions(-) diff --git a/gcc/fortran/trans-array.cc b/gcc/fortran/trans-array.cc index 0cda02d7cefc..7ace0f73b818 100644 --- a/gcc/fortran/trans-array.cc +++ b/gcc/fortran/trans-array.cc @@ -6523,8 +6523,7 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, tree stmtInit, stmtCleanup; tree lbound; tree ubound; - tree dubound; - tree dlbound; + tree dextent; tree dumdesc; tree tmp; tree stride, stride2; @@ -6658,16 +6657,10 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, for (n = 0; n < as->rank; n++) { if (checkparm || !as->upper[n]) - { - /* Get the bounds of the actual parameter. */ - dubound = gfc_conv_descriptor_ubound_get (dumdesc, gfc_rank_cst[n]); - dlbound = gfc_conv_descriptor_lbound_get (dumdesc, gfc_rank_cst[n]); - } + /* Get the bounds of the actual parameter. */ + dextent = gfc_conv_descriptor_extent_get (dumdesc, gfc_rank_cst[n]); else - { - dubound = NULL_TREE; - dlbound = NULL_TREE; - } + dextent = NULL_TREE; lbound = GFC_TYPE_ARRAY_LBOUND (type, n); if (!INTEGER_CST_P (lbound)) @@ -6707,12 +6700,7 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, temp = fold_build2_loc (input_location, PLUS_EXPR, gfc_array_index_type, gfc_index_one_node, temp); - stride2 = fold_build2_loc (input_location, MINUS_EXPR, -gfc_array_index_type, dubound, -dlbound); - stride2 = fold_build2_loc (input_location, PLUS_EXPR, -gfc_array_index_type, -gfc_index_one_node, stride2); + stride2 = dextent; tmp = fold_build2_loc (input_location, NE_EXPR, gfc_array_index_type, temp, stride2); msg = xasprintf ("Dimension %d of array '%s' has extent " @@ -6730,7 +6718,8 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, /* For assumed shape arrays move the upper bound by the same amount as the lower bound. */ tmp = fold_build2_loc (input_location, MINUS_EXPR, -gfc_array_index_type, dubound, dlbound); +gfc_array_index_type, dextent, +gfc_index_one_node); tmp = fold_build2_loc (input_location, PLUS_EXPR, gfc_array_index_type, tmp, lbound); gfc_add_modify (&init, ubound, tmp); @@ -7794,13 +7783,7 @@ gfc_tree_array_size (stmtblock_t *block, tree desc, gfc_expr *expr, tree dim) { if (!dim) dim = gfc_index_zero_node; - tree ubound = gfc_conv_descriptor_ubound_get (desc, dim); - tree lbound = gfc_conv_descriptor_lbound_get (desc, dim); - - size = fold_build2_loc (input_location, MINUS_EXPR, - gfc_array_index_type, ubound, lbound); - size = fold_build2_loc (input_location, PLUS_EXPR, gfc_array_index_type, - size, gfc_index_one_node); + size = gfc_conv_descriptor_extent_get (desc, dim); /* if (!allocatable && !pointer && assumed rank) size = (idx == rank && ubound[rank-1] == -1 ? -1 : size; else @@ -7816,7 +7799,7 @@ gfc_tree_array_size (stmtblock_t *block, tree desc, gfc_expr *expr, tree dim) fold_convert (signed_char_type_node, dim), tmp); tmp = fold_build2_loc (input_location, EQ_EXPR, boolean_type_node, -gfc_conv_descriptor_ubound_get (desc, dim), +gfc_conv_descriptor_extent_get (desc, dim), build_int_cst (gfc_array_index_type, -1)); cond = fold_build2_loc (input_location, TRUTH_AND_EXPR, boolean_type_node, cond, tmp); @@ -7856,16 +7839,12 @@ gfc_tree_array_size (stmtblock_t *block, tree desc, gfc_expr *expr, tree dim) cond = fold_build2_loc (input_location, EQ_EXPR, boolean_type_node,
[gcc(refs/users/mikael/heads/refactor_descriptor_v04)] Factorisation gfc_conv_array_extent_dim
https://gcc.gnu.org/g:0ae779bf3365bafc7b8f6cc51298779333ba22ed commit 0ae779bf3365bafc7b8f6cc51298779333ba22ed Author: Mikael Morin Date: Sat Mar 29 12:50:41 2025 +0100 Factorisation gfc_conv_array_extent_dim Diff: --- gcc/fortran/trans-intrinsic.cc | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/gcc/fortran/trans-intrinsic.cc b/gcc/fortran/trans-intrinsic.cc index 1b109f822643..cd047aca8149 100644 --- a/gcc/fortran/trans-intrinsic.cc +++ b/gcc/fortran/trans-intrinsic.cc @@ -2359,11 +2359,7 @@ gfc_conv_is_contiguous_expr (gfc_se *se, gfc_expr *arg) { tmp = gfc_conv_descriptor_lbound_get (desc, gfc_rank_cst[i]); extent = gfc_conv_descriptor_ubound_get (desc, gfc_rank_cst[i]); - extent = fold_build2_loc (input_location, MINUS_EXPR, - gfc_array_index_type, extent, tmp); - extent = fold_build2_loc (input_location, PLUS_EXPR, - gfc_array_index_type, extent, - gfc_index_one_node); + extent = gfc_conv_array_extent_dim (tmp, extent, nullptr); tmp = gfc_conv_descriptor_stride_get (desc, gfc_rank_cst[i]); tmp = fold_build2_loc (input_location, MULT_EXPR, TREE_TYPE (tmp), tmp, extent); @@ -2483,10 +2479,7 @@ gfc_conv_intrinsic_bound (gfc_se * se, gfc_expr * expr, enum gfc_isym_id op) ubound = gfc_conv_descriptor_ubound_get (desc, bound); lbound = gfc_conv_descriptor_lbound_get (desc, bound); - size = fold_build2_loc (input_location, MINUS_EXPR, - gfc_array_index_type, ubound, lbound); - size = fold_build2_loc (input_location, PLUS_EXPR, - gfc_array_index_type, size, gfc_index_one_node); + size = gfc_conv_array_extent_dim (lbound, ubound, nullptr); /* 13.14.53: Result value for LBOUND
[gcc(refs/users/mikael/heads/refactor_descriptor_v04)] Suppression export gfc_conv_descriptor_span_set
https://gcc.gnu.org/g:8410cda2b70228d358313cbacc0fe404c91b3ad2 commit 8410cda2b70228d358313cbacc0fe404c91b3ad2 Author: Mikael Morin Date: Sat Mar 29 11:41:45 2025 +0100 Suppression export gfc_conv_descriptor_span_set Diff: --- gcc/fortran/trans-descriptor.cc | 2 +- gcc/fortran/trans-descriptor.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/gcc/fortran/trans-descriptor.cc b/gcc/fortran/trans-descriptor.cc index bc2055bf3b56..7e709609435c 100644 --- a/gcc/fortran/trans-descriptor.cc +++ b/gcc/fortran/trans-descriptor.cc @@ -721,7 +721,7 @@ gfc_conv_descriptor_span_get (tree desc) return gfc_descriptor::conv_span_get (desc); } -void +static void gfc_conv_descriptor_span_set (stmtblock_t *block, tree desc, tree value) { return gfc_descriptor::conv_span_set (block, desc, value); diff --git a/gcc/fortran/trans-descriptor.h b/gcc/fortran/trans-descriptor.h index 5e8af26d1d8e..b991d2a41895 100644 --- a/gcc/fortran/trans-descriptor.h +++ b/gcc/fortran/trans-descriptor.h @@ -64,7 +64,6 @@ void gfc_conv_descriptor_dtype_set (stmtblock_t *, tree, tree); void gfc_conv_descriptor_version_set (stmtblock_t *, tree, tree); void gfc_conv_descriptor_rank_set (stmtblock_t *, tree, tree); void gfc_conv_descriptor_rank_set (stmtblock_t *, tree, int); -void gfc_conv_descriptor_span_set (stmtblock_t *, tree, tree); void gfc_conv_descriptor_ubound_set (stmtblock_t *, tree, tree, tree); /* CFI descriptor. */
[gcc(refs/users/mikael/heads/refactor_descriptor_v04)] Suppression modification span
https://gcc.gnu.org/g:ccd1a8797bc1c75a443a237755b3394fe75de895 commit ccd1a8797bc1c75a443a237755b3394fe75de895 Author: Mikael Morin Date: Sat Mar 29 11:39:49 2025 +0100 Suppression modification span Diff: --- gcc/fortran/trans-expr.cc | 5 - 1 file changed, 5 deletions(-) diff --git a/gcc/fortran/trans-expr.cc b/gcc/fortran/trans-expr.cc index c5cbe2efca49..171fbd78fe6c 100644 --- a/gcc/fortran/trans-expr.cc +++ b/gcc/fortran/trans-expr.cc @@ -10912,11 +10912,6 @@ gfc_trans_pointer_assignment (gfc_expr * expr1, gfc_expr * expr2) { rse.expr = gfc_class_data_get (rse.expr); gfc_add_modify (&lse.pre, desc, rse.expr); - /* Set the lhs span. */ - tmp = TREE_TYPE (rse.expr); - tmp = TYPE_SIZE_UNIT (gfc_get_element_type (tmp)); - tmp = fold_convert (gfc_array_index_type, tmp); - gfc_conv_descriptor_span_set (&lse.pre, desc, tmp); } else {
[gcc r15-9026] c++: optimize push_to_top_level [PR64500]
https://gcc.gnu.org/g:5ac4be28822a4e6f506a69096f92d4675a7d5a72 commit r15-9026-g5ac4be28822a4e6f506a69096f92d4675a7d5a72 Author: Jason Merrill Date: Mon Mar 24 15:28:04 2025 -0400 c++: optimize push_to_top_level [PR64500] Profiling showed that the loop to save away IDENTIFIER_BINDINGs from open binding levels was taking 5% of total compilation time in the PR116285 testcase. This turned out to be because we were unnecessarily trying to do this for namespaces, whose bindings are found through DECL_NAMESPACE_BINDINGS, not IDENTIFIER_BINDING. As a result we would frequently loop through everything in std::, checking whether it needs to be stored, and never storing anything. This change actually appears to speed up compilation for the PR116285 testcase by ~20%. The replaced comments referred either to long-replaced handling of classes and templates, or to wanting b to point to :: when the loop exits. PR c++/64500 PR c++/116285 gcc/cp/ChangeLog: * name-lookup.cc (push_to_top_level): Don't try to store_bindings for namespace levels. Diff: --- gcc/cp/name-lookup.cc | 20 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/gcc/cp/name-lookup.cc b/gcc/cp/name-lookup.cc index d3aa47baafe6..df033edafc76 100644 --- a/gcc/cp/name-lookup.cc +++ b/gcc/cp/name-lookup.cc @@ -8675,6 +8675,9 @@ store_class_bindings (vec *names, static GTY((deletable)) struct saved_scope *free_saved_scope; +/* Temporarily make the current scope the global namespace, saving away + the current scope for pop_from_top_level. */ + void push_to_top_level (void) { @@ -8716,18 +8719,19 @@ push_to_top_level (void) store_class_bindings (previous_class_level->class_shadowed, &s->old_bindings); - /* Have to include the global scope, because class-scope decls - aren't listed anywhere useful. */ + /* Save and clear any IDENTIFIER_BINDING from local scopes. */ for (; b; b = b->level_chain) { tree t; - /* Template IDs are inserted into the global level. If they were -inserted into namespace level, finish_file wouldn't find them -when doing pending instantiations. Therefore, don't stop at -namespace level, but continue until :: . */ - if (global_scope_p (b)) - break; + /* We don't need to consider namespace scopes, they don't affect +IDENTIFIER_BINDING. */ + if (b->kind == sk_namespace) + { + /* Jump straight to '::'. */ + b = NAMESPACE_LEVEL (global_namespace); + break; + } store_bindings (b->names, &s->old_bindings); /* We also need to check class_shadowed to save class-level type
[gcc(refs/users/mikael/heads/refactor_descriptor_v04)] Suppression modification span
https://gcc.gnu.org/g:ccd1a8797bc1c75a443a237755b3394fe75de895 commit ccd1a8797bc1c75a443a237755b3394fe75de895 Author: Mikael Morin Date: Sat Mar 29 11:39:49 2025 +0100 Suppression modification span Diff: --- gcc/fortran/trans-expr.cc | 5 - 1 file changed, 5 deletions(-) diff --git a/gcc/fortran/trans-expr.cc b/gcc/fortran/trans-expr.cc index c5cbe2efca49..171fbd78fe6c 100644 --- a/gcc/fortran/trans-expr.cc +++ b/gcc/fortran/trans-expr.cc @@ -10912,11 +10912,6 @@ gfc_trans_pointer_assignment (gfc_expr * expr1, gfc_expr * expr2) { rse.expr = gfc_class_data_get (rse.expr); gfc_add_modify (&lse.pre, desc, rse.expr); - /* Set the lhs span. */ - tmp = TREE_TYPE (rse.expr); - tmp = TYPE_SIZE_UNIT (gfc_get_element_type (tmp)); - tmp = fold_convert (gfc_array_index_type, tmp); - gfc_conv_descriptor_span_set (&lse.pre, desc, tmp); } else {
[gcc] Created branch 'mikael/heads/refactor_descriptor_v04' in namespace 'refs/users'
The branch 'mikael/heads/refactor_descriptor_v04' was created in namespace 'refs/users' pointing to: 4ea1ba1598c2... Réduction usages gfc_conv_descriptor_ubound_get
[gcc(refs/users/mikael/heads/refactor_descriptor_v04)] Suppression déclarations inutiles.
https://gcc.gnu.org/g:53867f6799c9b3dacae90f27a0afd6b9fcc8edd0 commit 53867f6799c9b3dacae90f27a0afd6b9fcc8edd0 Author: Mikael Morin Date: Mon Mar 17 20:21:04 2025 +0100 Suppression déclarations inutiles. Diff: --- gcc/fortran/trans-descriptor.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/gcc/fortran/trans-descriptor.h b/gcc/fortran/trans-descriptor.h index 5db80f59a528..5e8af26d1d8e 100644 --- a/gcc/fortran/trans-descriptor.h +++ b/gcc/fortran/trans-descriptor.h @@ -61,13 +61,10 @@ tree gfc_conv_descriptor_token_field (tree); void gfc_conv_descriptor_data_set (stmtblock_t *, tree, tree); void gfc_conv_descriptor_token_set (stmtblock_t *, tree, tree); void gfc_conv_descriptor_dtype_set (stmtblock_t *, tree, tree); -void gfc_conv_descriptor_dimensions_set (stmtblock_t *, tree, tree); void gfc_conv_descriptor_version_set (stmtblock_t *, tree, tree); void gfc_conv_descriptor_rank_set (stmtblock_t *, tree, tree); void gfc_conv_descriptor_rank_set (stmtblock_t *, tree, int); void gfc_conv_descriptor_span_set (stmtblock_t *, tree, tree); -void gfc_conv_descriptor_stride_set (stmtblock_t *, tree, tree, tree); -void gfc_conv_descriptor_lbound_set (stmtblock_t *, tree, tree, tree); void gfc_conv_descriptor_ubound_set (stmtblock_t *, tree, tree, tree); /* CFI descriptor. */
[gcc r15-9030] testsuite: arm: fixup more dg-final syntax
https://gcc.gnu.org/g:78e0cf06c818e6293d36e52ad7a96bd9e7953c06 commit r15-9030-g78e0cf06c818e6293d36e52ad7a96bd9e7953c06 Author: Sam James Date: Sat Mar 29 21:09:25 2025 + testsuite: arm: fixup more dg-final syntax ... as Richard E mentioned on the ML. Followup to r15-8956-ge90d6c2639c392. gcc/testsuite/ChangeLog: * gcc.target/arm/short-vfp-1.c: Add whitespace around brace. Diff: --- gcc/testsuite/gcc.target/arm/short-vfp-1.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gcc/testsuite/gcc.target/arm/short-vfp-1.c b/gcc/testsuite/gcc.target/arm/short-vfp-1.c index ddab09a4b7fb..18d38a580377 100644 --- a/gcc/testsuite/gcc.target/arm/short-vfp-1.c +++ b/gcc/testsuite/gcc.target/arm/short-vfp-1.c @@ -38,8 +38,8 @@ test_sihi (short x) return (int)x; } -/* { dg-final { scan-assembler-times {vcvt\.s32\.f32\ts[0-9]+,s[0-9]+} 2 }} */ -/* { dg-final { scan-assembler-times {vcvt\.f32\.s32\ts[0-9]+,s[0-9]+} 2 }} */ -/* { dg-final { scan-assembler-times {vmov\tr[0-9]+,s[0-9]+} 2 }} */ -/* { dg-final { scan-assembler-times {vmov\ts[0-9]+,r[0-9]+} 2 }} */ -/* { dg-final { scan-assembler-times {sxth\tr[0-9]+,r[0-9]+} 2 }} */ +/* { dg-final { scan-assembler-times {vcvt\.s32\.f32\ts[0-9]+,s[0-9]+} 2 } } */ +/* { dg-final { scan-assembler-times {vcvt\.f32\.s32\ts[0-9]+,s[0-9]+} 2 } } */ +/* { dg-final { scan-assembler-times {vmov\tr[0-9]+,s[0-9]+} 2 } } */ +/* { dg-final { scan-assembler-times {vmov\ts[0-9]+,r[0-9]+} 2 } } */ +/* { dg-final { scan-assembler-times {sxth\tr[0-9]+,r[0-9]+} 2 } } */