daniel tian wrote:
Hi Dr. Uday Khedker:
Happy New Year!
I met hazard problem. And I have debuged this error for a few
days. I wrote DFA to avoid load hazard, but still it exists. I wonder
whether in default the command './cc1 hazard.c' doesn't compile the
file with DFA. And in default without any optimization there is no
'NOP' instruction after the 'LOAD' instruction.
DFA pipeline hazard recognizer is used in GCC insn scheduler and the
scheduler never inserts nop to avoid pipeline hazards (most
architectures use locks to resolve conflicts and adding nops would only
worsen insn cache locality). Insertion of nops is usually implemented
in assembler for architectures without the locks or in
machine-dependent parts of GCC compiler. You could look at machine
dependent files of VLIW processors (like FRV or Itanium) to see how it
can be made.
I saw analogous question on gcc mailing lists, you could use them too.