This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix PR18754: add early loop pass, 2nd try




On Fri, 21 Jan 2005, Richard Guenther wrote:

On Thu, 20 Jan 2005, Zdenek Dvorak wrote:

The right fix seems to be to add the second SRA pass in the middle of loop
optimizations (just immediately after cunroll).  You would also need to
schedule constant propagation pass there (which should just work)
and preferably also cfg_cleanup (the variation from tcb branch that
preserves loop structures).

Yes, I tried this - actually just adding SRA and redphi after cunroll, but this caused verify failures about not the right ssa form or so. So I guessed SRA may be not ready to preserve invariants the loop optimizers need.

you probably need to rerun the loop closed ssa form creation afterwards (rewrite_into_loop_closed_ssa).

Ok, tried this again (see proof of concept patch below). With -O2 -funroll-loops this solves the original testcase of PR18754, but fails on the C++ testcase verifying the ssa form:

scalar_loops.cpp: In function 'void foo(const Array<2>&, const
Array<2>&)':
scalar_loops.cpp:32: internal compiler error: tree check: expected
ssa_name, have var_decl in verify_ssa, at tree-ssa.c:690
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

Any ideas what is going wrong?  This doesn't change, if I remove
the rename_ssa_copies() call.

Thanks,
Richard.

rename_ssa_copies coalesces ssa variables, not renaming.
Since you don't have a valid ssa form at that point, it can't possibly work right :)


Call rewrite_into_ssa (false);

--Dan


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]