1 Dec 2003 03:20
[PATCH] PR opt/12628: Call reg_scan before jump bypassing
Roger Sayle <roger <at> eyesopen.com>
2003-12-01 02:20:25 GMT
2003-12-01 02:20:25 GMT
The following patch is my proposed fix for PR optimization/12628 which is an ICE-on-valid caused by an obscure combination of compiler flags. The jump bypassing pass calls init_alias_analysis assuming that register information is currently correct. Unfortunately, with the options "-O2 -fno-expensive-optimizations -fno-rerun-loop-opt" reg_scan isn't called after either GCSE nor loop. This then leads to the ICE in init_alias_analysis. The proposed (and least invasive) solution is for toplev.c's rest_of_handle_jump_bypass to call reg_scan itself as it needs aliasing information. This is consistent with most other uses of reg_scan in toplev.c where it's called immediately before the pass that requires it, for example, the CSE passes. Alas this policy is not entirely consistent, with GCSE relying on reg_scan being called at the end of addressof. It would be more consistent to move reg_scan from the end of addressof to the beginning of GCSE, but this could potentially expose a similar failure caused by another obscure set of compiler flags. Longer term, it would be nice if, like the CFG, we maintained a set of flags indicating whether these data structures were valid following an optimization pass. This would save us from recalculating information that hasn't changed. Unfortunately, calling reg_scan performs a traversal of the RTL insn stream, so we can expect a minor slow-down from this change :<. It isn't clear whether GCSE or loop preserve the "reg_scan" information, so this change is safe even when the user hasn't specified wierd command line options. However,(Continue reading)
RSS Feed