On Fri, Mar 31, 2017 at 1:50 PM, Richard Biener <[email protected]> wrote:
> That looks like a workaround rather than the correct fix. Who sets .MEM? It
> should assign the proper def.
>
Moving the auto_profile pass above several other passes fixes the problem.
The minimal change to fix the problem is by disabling these two passes:
--- a/gcc/passes.def
+++ b/gcc/passes.def
@@ -86,14 +86,12 @@ along with GCC; see the file COPYING3. If not see
NEXT_PASS (pass_ccp, false /* nonzero_p */);
/* After CCP we rewrite no longer addressed locals into SSA
form if possible. */
- NEXT_PASS (pass_forwprop);
NEXT_PASS (pass_early_thread_jumps);
NEXT_PASS (pass_sra_early);
/* pass_build_ealias is a dummy pass that ensures that we
execute TODO_rebuild_alias at this point. */
NEXT_PASS (pass_build_ealias);
NEXT_PASS (pass_fre);
- NEXT_PASS (pass_early_vrp);
NEXT_PASS (pass_merge_phi);
NEXT_PASS (pass_dse);
NEXT_PASS (pass_cd_dce);
It seems to me that early_vrp is the one changing the IR in an inconsistent way.