https://gcc.gnu.org/g:2e1dfaad2ae7f11e1ea16f5f419d82d6cbd50c3d

commit r16-3373-g2e1dfaad2ae7f11e1ea16f5f419d82d6cbd50c3d
Author: Andrew Pinski <andrew.pin...@oss.qualcomm.com>
Date:   Tue Aug 19 14:52:18 2025 -0700

    LIM: Manually put uninit decl into ssa
    
    When working on PR121279, I noticed that lim
    would create an uninitialized decl and marking
    it with supression for uninitialization warning.
    This is fine but then into ssa would just call
    get_or_create_ssa_default_def on that new decl which
    could in theory take some extra compile time to figure
    that out.
    Plus when doing the rewriting for undefinedness, there
    would now be a VCE around the decl. This means the ssa
    name is kept around and not propagated in some cases.
    So instead this patch manually calls get_or_create_ssa_default_def
    to get the "uninitalized" ssa name for this decl and
    no longer needs the write into ssa nor for undefined ness.
    
    Bootstrapped and tested on x86_64-linux-gnu.
    
    gcc/ChangeLog:
    
            * tree-ssa-loop-im.cc (execute_sm): Call
            get_or_create_ssa_default_def for the new uninitialized
            decl.
    
    Signed-off-by: Andrew Pinski <andrew.pin...@oss.qualcomm.com>

Diff:
---
 gcc/tree-ssa-loop-im.cc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gcc/tree-ssa-loop-im.cc b/gcc/tree-ssa-loop-im.cc
index aee419aa5b1e..0340857058bb 100644
--- a/gcc/tree-ssa-loop-im.cc
+++ b/gcc/tree-ssa-loop-im.cc
@@ -2355,6 +2355,7 @@ execute_sm (class loop *loop, im_mem_ref *ref,
         loop entry as not to be warned for.  */
       tree uninit = create_tmp_reg (TREE_TYPE (aux->tmp_var));
       suppress_warning (uninit, OPT_Wuninitialized);
+      uninit = get_or_create_ssa_default_def (cfun, uninit);
       load = gimple_build_assign (aux->tmp_var, uninit);
     }
   lim_data = init_lim_data (load);

Reply via email to