]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-optimization/110392 - ICE with predicate analysis
authorRichard Biener <rguenther@suse.de>
Mon, 26 Jun 2023 09:21:43 +0000 (11:21 +0200)
committerRichard Biener <rguenther@suse.de>
Mon, 26 Jun 2023 10:59:06 +0000 (12:59 +0200)
Feeding not optimized IL can result in predicate normalization
to simplify things so a predicate can get true or false.  The
following re-orders the early exit in that case to come after
simplification and normalization to take care of that.

PR tree-optimization/110392
* gimple-predicate-analysis.cc (uninit_analysis::is_use_guarded):
Do early exits on true/false predicate only after normalization.

gcc/gimple-predicate-analysis.cc

index 7f20f81ad863e087c905bca756ce455cc1efef9a..373163ba9c804c24b1524d20e210db0e2393e4cf 100644 (file)
@@ -2216,11 +2216,11 @@ uninit_analysis::is_use_guarded (gimple *use_stmt, basic_block use_bb,
     return false;
 
   use_preds.simplify (use_stmt, /*is_use=*/true);
+  use_preds.normalize (use_stmt, /*is_use=*/true);
   if (use_preds.is_false ())
     return true;
   if (use_preds.is_true ())
     return false;
-  use_preds.normalize (use_stmt, /*is_use=*/true);
 
   /* Try to prune the dead incoming phi edges.  */
   if (!overlap (phi, opnds, visited, use_preds))
@@ -2238,11 +2238,11 @@ uninit_analysis::is_use_guarded (gimple *use_stmt, basic_block use_bb,
        return false;
 
       m_phi_def_preds.simplify (phi);
+      m_phi_def_preds.normalize (phi);
       if (m_phi_def_preds.is_false ())
        return false;
       if (m_phi_def_preds.is_true ())
        return true;
-      m_phi_def_preds.normalize (phi);
     }
 
   /* Return true if the predicate guarding the valid definition (i.e.,