This is the mail archive of the gcc-help@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]
Other format: [Raw text]

Hazard Detection



Hi

I have a question: I compiled a program with ?gcc
-mips1 ,
Compiler generate this list of instructions:
 ?
... ? ? ? ? ? ? ? .... ? ?
? ? ? ? ? ...
 ?10b71c: ?
?87a20018 ? ? ?lh ? ? ?
?v0,24(sp)
 ?10b720: ? ?00000000 ? ?
nop
 ?10b724: ? ?144000b9 ? ? bnez ?
?v0,10ba0c
 ?10b728: ? ?0015ac03 ? ?
?sra ? ? ?s5,s5,0x10
 ? ... ? ?
? ? ? ? ? .... ? ? ? ? ?
? ? ...

but by a small change, some times in
variables, (using same compiler
switches) compiler don't insert
?nop between load and branch and generates
this sequence of
instructions:
 ? ... ? ? ? ? ? ?
? .... ? ? ? ? ? ? ? ...

?10b754: ? ?87a20018 ? ? lh ? ? ?
? v0,24(sp)
 ?10b758: ? ?144000b9 ? ?
bnez ? ? v0,10ba40
 ?10b75c: ? ?0015ac03
? ? ?sra ? ? ? s5,s5,0x10
 ? ...
? ? ? ? ? ? ? .... ? ? ?
? ? ? ? ...

would you please tell me the
reason?

why doesn't compiler detect hazard always?

Thanks in advanced.

Neda Zolfaghari (zneda@aut.ac.ir)


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