https://gcc.gnu.org/g:9514a728a62cb82fd05b2db97717525e98ebdd53

commit r17-4930-g9514a728a62cb82fd05b2db97717525e98ebdd53
Author: Richard Biener <[email protected]>
Date:   Tue Oct 6 10:42:02 2026 +0200

    tree-optimization/127705 - access violation with SCC copy
    
    The following fixes up the completely botched attempt to save off
    the SCC for later setting of the scheduling result to all components.
    
            PR tree-optimization/127705
            * tree-vect-slp.cc (vect_schedule_scc): Fixup SCC copy.

Diff:
---
 gcc/tree-vect-slp.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/tree-vect-slp.cc b/gcc/tree-vect-slp.cc
index 142037ed0081..00ed4d3fec14 100644
--- a/gcc/tree-vect-slp.cc
+++ b/gcc/tree-vect-slp.cc
@@ -12794,7 +12794,8 @@ vect_schedule_scc (vec_info *vinfo, slp_tree node, 
slp_instance instance,
         iterate and schedule those that are ready.  */
       unsigned todo = stack.length () - last_idx;
       auto_vec<slp_tree, 4> saved_scc (todo);
-      memcpy (saved_scc.address (), stack.address ()[last_idx + 1],
+      saved_scc.quick_grow (todo);
+      memcpy (saved_scc.address (), &stack.address ()[last_idx],
              sizeof (slp_tree) * todo);
       do
        {

Reply via email to