tree-optimization/105012 - fix ICE from local DSE of if-conversion

The following guards dse_classify_store with the same condition as
the DSE pass does - availability of a virtual definition.  For
the PR we run into the fortran frontend generating a clobber for
a FUNCTION_DECL lhs which is ignored by the operand scanner and has
no virtual operands assigned.  Apart from fixing the frontend the
following fixes the ICE by adjusting if-conversion.

2022-03-22  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/105012
	* tree-if-conv.cc (ifcvt_local_dce): Only call
	dse_classify_store when we have a VDEF.
This commit is contained in:
Richard Biener 2022-03-22 12:28:30 +01:00
parent ef0e11ac88
commit 08f263e703

View file

@ -3145,7 +3145,7 @@ ifcvt_local_dce (class loop *loop)
gimple_stmt_iterator gsiprev = gsi;
gsi_prev (&gsiprev);
stmt = gsi_stmt (gsi);
if (gimple_store_p (stmt))
if (gimple_store_p (stmt) && gimple_vdef (stmt))
{
tree lhs = gimple_get_lhs (stmt);
ao_ref write;