home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.compilers      Compiler construction, theory, etc. (Mod      2,753 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 2,087 of 2,753   
   Amker.Cheng to All   
   How to eliminate redundant constant move   
   31 Oct 11 17:53:46   
   
   From: amker.cheng@gmail.com   
      
   Hi,   
   I found following intermediate codes are generated in gcc   
      
   rx <- 0   
   ...   
   use rx   
   ...   
   ry <- 0   
   use ry   
   ...   
      
   It's normally a result of const propagation.   
   After register allocation, It is likely rx/ry get allocated into   
   different hard registers.   
   Thus in final codes, there would be a redundant "move 0" instruction.   
      
   The story even stands for Os compiling, so the question is:   
   Is there any optimization technique dedicates to this kind of case?   
   Or is it normally handled by other optimizations as sub task?   
      
   Thanks very much.   
   --   
   Best Regards.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca