[gcc r15-1669] tree-optimization/115493 - complete previous fix

Richard Biener rguenth@gcc.gnu.org
Thu Jun 27 05:53:42 GMT 2024


https://gcc.gnu.org/g:b7ba0670a768e76e87e04cfd6a72c28c35333b54

commit r15-1669-gb7ba0670a768e76e87e04cfd6a72c28c35333b54
Author: Richard Biener <rguenther@suse.de>
Date:   Wed Jun 26 19:11:04 2024 +0200

    tree-optimization/115493 - complete previous fix
    
    The following fixes the 2nd occurance of new_temp missed with the
    previous fix.
    
            PR tree-optimization/115493
            * tree-vect-loop.cc (vect_create_epilog_for_reduction): Use
            first scalar result.

Diff:
---
 gcc/tree-vect-loop.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc
index 347dac97e49..6f32867f85a 100644
--- a/gcc/tree-vect-loop.cc
+++ b/gcc/tree-vect-loop.cc
@@ -6849,7 +6849,7 @@ vect_create_epilog_for_reduction (loop_vec_info loop_vinfo,
 	  tree initial_def = reduc_info->reduc_initial_values[0];
 	  tree tmp = make_ssa_name (new_scalar_dest);
 	  epilog_stmt = gimple_build_assign (tmp, COND_EXPR, zcompare,
-					     initial_def, new_temp);
+					     initial_def, scalar_results[0]);
 	  gsi_insert_before (&exit_gsi, epilog_stmt, GSI_SAME_STMT);
 	  scalar_results[0] = tmp;
 	}


More information about the Gcc-cvs mailing list