public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Hazard Detection
@ 2006-12-12 14:37 zneda
  2006-12-12 18:31 ` Meissner, Michael
  0 siblings, 1 reply; 5+ messages in thread
From: zneda @ 2006-12-12 14:37 UTC (permalink / raw)
  To: gnu, gcc-help; +Cc: neda.zf

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)


^ permalink raw reply	[flat|nested] 5+ messages in thread
* Hazard Detection
@ 2006-12-12 14:52 zneda
  0 siblings, 0 replies; 5+ messages in thread
From: zneda @ 2006-12-12 14:52 UTC (permalink / raw)
  To: gcc-help; +Cc: neda.zf



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)

^ permalink raw reply	[flat|nested] 5+ messages in thread
* Hazard Detection
@ 2006-12-12 14:56 zneda
  0 siblings, 0 replies; 5+ messages in thread
From: zneda @ 2006-12-12 14:56 UTC (permalink / raw)
  To: gcc-help; +Cc: neda.zf



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)

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-12-12 23:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-12-12 14:37 Hazard Detection zneda
2006-12-12 18:31 ` Meissner, Michael
2006-12-12 23:22   ` Ian Lance Taylor
2006-12-12 14:52 zneda
2006-12-12 14:56 zneda

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).