I'm working on a series of profile-driven optimes with gcc-3.4.3. I need profile information available for the PRE phase (implemented in gcc with gcse.c and lcm.c).
However, gcc-3.4.3 does not provide profile information that early in the compile, so I moved the call to `rest_of_handle_branch_prob()' (which in turns calls branch_prob() which annotates the CFG with profile information from gcda files) to above `rest_of_handle_gcse()'. For the most part, I seem to get good information. However, on certain SPEC CPU 2000 benchmarks, the compiler stops with `counter mismatch' errors and `counter contains illegal value' (typically negative value) errors. I really need correct profile information before PRE. By moving rest_of_handle_branch_prob() just before rest_of_handle_gcse() have I violated some critical assumptions which is causing the profile information to be occasionally corrupted ? David P.