On Fri, 2023-10-27 at 12:48 -0700, Andrew Pinski wrote:
> Hi David and others,
>   I am in the process of improving phi-opt and moving what was
> handled
> in value_replacement to match-and-simplify and ran into a few
> failures
> in the analyzer testsuite.
> For an example c-c++-common/analyzer/inlining-3-multiline.c (and
> c-c++-common/analyzer/inlining-3.c) now fails due to optimizing away
> the if statement in get_input_file_name so it just returns its
> argument and we don't get a comparison against NULL any more.

> 
> Should we change the testcase to avoid this transformation or should
> we avoid this transformation early on during optimization phases? Or
> something else like move analyzer earlier before phiopt?

The analyzer runs relatively late, and moving it would be a major task.
 
The intent of those testcases is to verify that the analyzer can
provide the user with a sufficiently readable execution path (the path
of execution events that triggers a problem) i.e. that we can
reconstruct things in the face of inlining.

Those conditionals are intended as examples of control-flow logic that
we'd want to display to the user.

Hence it's probably best to disable your new optimization on these
testcases (presumably by adding "-fdisable-tree-phiopt1"), so that we
keep that control flow logic.

Does that make sense?

Dave

Reply via email to