[LLVMdev] Is infinite empty loop dead code?

陳韋任 (Wei-Ren Chen) chenwj at iis.sinica.edu.tw
Tue Nov 13 23:46:15 PST 2012


On Wed, Nov 14, 2012 at 03:32:53PM +0800, 陳韋任 (Wei-Ren Chen) wrote:
> On Tue, Nov 13, 2012 at 11:23:02PM -0800, Shuxin Yang wrote:
> > Hi, All:
> > 
> >      Is it legal to delete empty infinite loop like this : "while(1) {}"?
> > It is interesting that both llvm and gcc keep the loop, however Open64 
> > delete it.
> 
>   I think it's illegal to delete such infinite loop, perhapes you should
> file a bug report to open64. That's my 2 cents.

  The reason I think it's illegal is because if you remove it, then the
behavior is different. One with infinite empty loop will run infinitely,
the other w/o infinite empty loop will exit immediately. That's my
point.

Regards,
chenwj

-- 
Wei-Ren Chen (陳韋任)
Computer Systems Lab, Institute of Information Science,
Academia Sinica, Taiwan (R.O.C.)
Tel:886-2-2788-3799 #1667
Homepage: http://people.cs.nctu.edu.tw/~chenwj




More information about the llvm-dev mailing list