------- Comment #2 from jakub at gcc dot gnu dot org 2010-02-17 13:56 ------- I guess lambda-code.c needs to be taught about debug stmts. This is actually more important than usual -fcompare-debug differences, here debug stmt actually prevent the optimization altogether. Without -g the loops are perfectly nested (perfect_nest_p succeeds), without it the debug stmt cause both perfect_nest_p and can_convert_to_perfect_nest to fail.
I guess best would be to ignore debug stmts in these functions, and do something about them in perfect_nestify and in lambda_loopnest_to_gcc_loopnest, but am not sure it will actually possible. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42917