diff options
-rw-r--r-- | gcc/ChangeLog | 23 | ||||
-rw-r--r-- | gcc/DATESTAMP | 2 | ||||
-rw-r--r-- | gcc/config/i386/i386-features.cc | 107 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 10 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/DRs/dr1709.C | 18 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/i386/pr120941-1.c | 49 | ||||
-rw-r--r-- | libcpp/ChangeLog | 7 | ||||
-rw-r--r-- | libstdc++-v3/ChangeLog | 4 |
8 files changed, 169 insertions, 51 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index fec8c7a..d73ba82 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,26 @@ +2025-08-03 Georg-Johann Lay <avr@gjlay.de> + + * config/avr/avr.md (define_insn_and_split) [reload_completed]: + For splits that just append a (clobber (reg:CC REG_CC)) to + the pattern, use avr_add_ccclobber (curr_insn) instead of + repeating the original pattern. + * config/avr/avr-dimode.md: Same. + * config/avr/avr-fixed.md: Same. + +2025-08-03 Georg-Johann Lay <avr@gjlay.de> + + * config/avr/avr.cc (avr_add_ccclobber): New function. + * config/avr/avr-protos.h (avr_add_ccclobber): New proto. + (DONE_ADD_CCC): New define. + +2025-08-03 Richard Biener <rguenther@suse.de> + + PR tree-optimization/90242 + * tree-ssa-sccvn.cc (vn_reference_compute_hash): Use + poly_offset_int for offset accumulation. For hashing + truncate to 64 bits and also hash 64 bits. + (vn_reference_eq): Likewise. + 2025-08-02 Gerald Pfeifer <gerald@pfeifer.com> PR target/69374 diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index 963d4c7..85faa76 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20250803 +20250804 diff --git a/gcc/config/i386/i386-features.cc b/gcc/config/i386/i386-features.cc index 53e86c8..9941e61 100644 --- a/gcc/config/i386/i386-features.cc +++ b/gcc/config/i386/i386-features.cc @@ -3085,21 +3085,63 @@ ix86_rpad_gate () && optimize_function_for_speed_p (cfun)); } +enum x86_cse_kind +{ + X86_CSE_CONST0_VECTOR, + X86_CSE_CONSTM1_VECTOR, + X86_CSE_VEC_DUP +}; + +struct redundant_load +{ + /* Bitmap of basic blocks with broadcast instructions. */ + auto_bitmap bbs; + /* Bitmap of broadcast instructions. */ + auto_bitmap insns; + /* The broadcast inner scalar. */ + rtx val; + /* The inner scalar mode. */ + machine_mode mode; + /* The instruction which sets the inner scalar. Nullptr if the inner + scalar is applied to the whole function, instead of within the same + block. */ + rtx_insn *def_insn; + /* The widest broadcast source. */ + rtx broadcast_source; + /* The widest broadcast register. */ + rtx broadcast_reg; + /* The basic block of the broadcast instruction. */ + basic_block bb; + /* The number of broadcast instructions with the same inner scalar. */ + unsigned HOST_WIDE_INT count; + /* The threshold of broadcast instructions with the same inner + scalar. */ + unsigned int threshold; + /* The widest broadcast size in bytes. */ + unsigned int size; + /* Load kind. */ + x86_cse_kind kind; +}; + /* Generate a vector set, DEST = SRC, at entry of the nearest dominator for basic block map BBS, which is in the fake loop that contains the whole function, so that there is only a single vector set in the - whole function. If not nullptr, INNER_SCALAR is the inner scalar of - SRC, as (reg:SI 99) in (vec_duplicate:V4SI (reg:SI 99)). */ + whole function. If not nullptr, LOAD is a pointer to the load. */ static void ix86_place_single_vector_set (rtx dest, rtx src, bitmap bbs, - rtx inner_scalar = nullptr) + redundant_load *load = nullptr) { basic_block bb = nearest_common_dominator_for_set (CDI_DOMINATORS, bbs); - while (bb->loop_father->latch - != EXIT_BLOCK_PTR_FOR_FN (cfun)) - bb = get_immediate_dominator (CDI_DOMINATORS, - bb->loop_father->header); + /* For X86_CSE_VEC_DUP, don't place the vector set outside of the loop + to avoid extra spills. */ + if (!load || load->kind != X86_CSE_VEC_DUP) + { + while (bb->loop_father->latch + != EXIT_BLOCK_PTR_FOR_FN (cfun)) + bb = get_immediate_dominator (CDI_DOMINATORS, + bb->loop_father->header); + } rtx set = gen_rtx_SET (dest, src); @@ -3141,8 +3183,14 @@ ix86_place_single_vector_set (rtx dest, rtx src, bitmap bbs, } } - if (inner_scalar) + if (load && load->kind == X86_CSE_VEC_DUP) { + /* Get the source from LOAD as (reg:SI 99) in + + (vec_duplicate:V4SI (reg:SI 99)) + + */ + rtx inner_scalar = load->val; /* Set the source in (vec_duplicate:V4SI (reg:SI 99)). */ rtx reg = XEXP (src, 0); if ((REG_P (inner_scalar) || MEM_P (inner_scalar)) @@ -3489,44 +3537,6 @@ replace_vector_const (machine_mode vector_mode, rtx vector_const, } } -enum x86_cse_kind -{ - X86_CSE_CONST0_VECTOR, - X86_CSE_CONSTM1_VECTOR, - X86_CSE_VEC_DUP -}; - -struct redundant_load -{ - /* Bitmap of basic blocks with broadcast instructions. */ - auto_bitmap bbs; - /* Bitmap of broadcast instructions. */ - auto_bitmap insns; - /* The broadcast inner scalar. */ - rtx val; - /* The inner scalar mode. */ - machine_mode mode; - /* The instruction which sets the inner scalar. Nullptr if the inner - scalar is applied to the whole function, instead of within the same - block. */ - rtx_insn *def_insn; - /* The widest broadcast source. */ - rtx broadcast_source; - /* The widest broadcast register. */ - rtx broadcast_reg; - /* The basic block of the broadcast instruction. */ - basic_block bb; - /* The number of broadcast instructions with the same inner scalar. */ - unsigned HOST_WIDE_INT count; - /* The threshold of broadcast instructions with the same inner - scalar. */ - unsigned int threshold; - /* The widest broadcast size in bytes. */ - unsigned int size; - /* Load kind. */ - x86_cse_kind kind; -}; - /* Return the inner scalar if OP is a broadcast, else return nullptr. */ static rtx @@ -3872,10 +3882,7 @@ remove_redundant_vector_load (void) else ix86_place_single_vector_set (load->broadcast_reg, load->broadcast_source, - load->bbs, - (load->kind == X86_CSE_VEC_DUP - ? load->val - : nullptr)); + load->bbs, load); } loop_optimizer_finalize (); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index db4d560..b43cbb7 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,13 @@ +2025-08-03 Jakub Jelinek <jakub@redhat.com> + + PR preprocessor/120778 + * g++.dg/DRs/dr1709.C: New test. + +2025-08-03 Jakub Jelinek <jakub@redhat.com> + + PR c++/120845 + * g++.dg/modules/cpp-21.C: New test. + 2025-08-02 Martin Uecker <uecker@tugraz.at> * gcc.dg/Warray-parameter-11.c: Change Warray-parameter to diff --git a/gcc/testsuite/g++.dg/DRs/dr1709.C b/gcc/testsuite/g++.dg/DRs/dr1709.C new file mode 100644 index 0000000..d3854d8 --- /dev/null +++ b/gcc/testsuite/g++.dg/DRs/dr1709.C @@ -0,0 +1,18 @@ +// DR 1709 - Stringizing raw string literals containing newline +// { dg-do run { target c++26 } } + +#define A(a) #a +const char *a = A(a\f\\b"c"); +const char *b = A(R"abc(a\b + +)abc"); + +int +main () +{ + if (a[1] != '\f' || a[2] != '\\' || a[4] != '"' || a[6] != '"') + __builtin_abort (); + if (b[1] != '"' || b[7] != '\\' || b[9] != '\n' || b[10] != '\n' + || b[11] != ')' || b[15] != '"') + __builtin_abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/pr120941-1.c b/gcc/testsuite/gcc.target/i386/pr120941-1.c new file mode 100644 index 0000000..b4fc6ac --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr120941-1.c @@ -0,0 +1,49 @@ +/* { dg-do compile } */ +/* { dg-options "-Ofast -march=x86-64-v3" } */ +/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ +/* { dg-final { check-function-bodies "**" "" "" { target lp64 } {^\t?\.} } } */ + +/* +**bar: +**.LFB[0-9]+: +**... +** vbroadcastsd .LC4\(%rip\), %ymm2 +** leal 2\(%rbx\), %eax +** vbroadcastsd .LC2\(%rip\), %ymm4 +** negl %eax +**... +*/ + +extern void foo (int); + +enum { N_CELL_ENTRIES1 = 2 } +typedef LBM_Grid1[64]; +enum { N_CELL_ENTRIES2 = 2 } +typedef LBM_Grid2[64]; +LBM_Grid1 grid1; +LBM_Grid2 grid2; +extern int n; + +void +LBM_handleInOutFlow() +{ + int i, j; + for (; i; i += 2) + { + for (j = 0; j < n; j++) + { + grid1[i] = 1.0 / 36.0 * i; + grid2[i] = 1.0 / 36.0 * i; + } + } +} + +int main_t; +void +bar (void) +{ + for (; main_t; main_t++) { + LBM_handleInOutFlow(); + foo (main_t); + } +} diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog index ca67a64..b5188fd 100644 --- a/libcpp/ChangeLog +++ b/libcpp/ChangeLog @@ -1,3 +1,10 @@ +2025-08-03 Jakub Jelinek <jakub@redhat.com> + + PR c++/120845 + * lex.cc (cpp_maybe_module_directive): Move eol variable declaration + to the start of the function, initialize to false and only set it to + peek->type == CPP_PRAGMA_EOL in the not_module case. Formatting fix. + 2025-07-30 Jakub Jelinek <jakub@redhat.com> PR c++/120778 diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 7f697f2..cd1f142 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,7 @@ +2025-08-03 Jakub Jelinek <jakub@redhat.com> + + * src/c++23/std.cc.in (std::owner_equal, std::owner_hash): Export. + 2025-07-30 François Dumont <frs.dumont@gmail.com> * testsuite/std/time/format/data_not_present_neg.cc: Remove _GLIBCXX_USE_DUAL_ABI |