This is the mail archive of the gcc@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]

Invalid shortcut in calculate_global_regs_live


There's a (sadly giant) testcase which fails on the ia64 with some
modifications I've made to the compiler.  I've been tracking it down
through flow, and I think I've found what's wrong.

When we reconsider a block, we first compute the union of all the live
registers at the start of its successors.  This becomes the new value of
the live_at_end set.  We try to apply a shortcut to avoid calling
propagate_block again: if regs were only added to the live_at_end set
since the last iteration, we can simply add those to the old live_at_start
set we had calculated in the last iteration.  In that case we clear the
"rescan" variable to indicate that propagate_block doesn't need to be run.

This appears to be incorrect in the presence of conditional execution.
If the block conditionally kills a register, there's no "right" value
for the local_set regset; i.e. we can't apply the shortcut.

Disabling the shortcut makes my testcase compile properly.

Of course we don't really want to simply delete the shortcut - it's
probably quite a big help in reducing compile times.  I'm currently
thinking about fixing it by keeping track of conditionally set registers
for every block, and then only applying the shortcut if intersection of
the set of new live registers at the end and the set of conditionally
set regs is empty.

Does anyone have a better idea?


Bernd


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