Code generation problem with optimizations enabled

Jim Wilson wilson@codesourcery.com
Thu May 14 03:54:00 GMT 2009


Jamie Prescott wrote:
> Thank you Paolo, I'll take a look at it.
> Is there a reason why the fcmp insn was dropped with such implementation?

The code that optimizes away redundant cc0 compares is in final.c, in 
final_scan_insn().  It is about line 2310 in my tree, near the comment 
"Check for redundant test and compare instructions".  Try stepping 
through that code to see what is going on.  Maybe you are setting 
cc_status.value1 but not cc_status.value2?

In any case, as Paolo mentioned, you are better off not using cc0.  cc0 
should only be used if you have no other choice.  And even then, you 
still probably shouldn't use it.  Every couple of years someone tries to 
eliminate the cc0 code, and eventually someone will succeed.

Jim



More information about the Gcc mailing list