Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.42!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-1.proxad.net!198.186.194.247.MISMATCH!news-out.readnews.com!transit3.readnews.com!nx02.iad01.newshosting.com!newshosting.com!216.196.98.142.MISMATCH!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!news.iecc.com!lnews.iecc.com!nerds-end From: mac Newsgroups: comp.compilers Subject: Re: How to eliminate redundant constant move instructions Date: Thu, 3 Nov 2011 02:20:40 +0000 (UTC) Organization: A noiseless patient Spider Lines: 16 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <11-11-017@comp.compilers> References: <11-11-002@comp.compilers> NNTP-Posting-Host: lnews.iecc.com X-Trace: gal.iecc.com 1320288301 6065 64.57.183.34 (3 Nov 2011 02:45:01 GMT) X-Complaints-To: abuse@iecc.com NNTP-Posting-Date: Thu, 3 Nov 2011 02:45:01 +0000 (UTC) Keywords: optimize Posted-Date: 02 Nov 2011 22:45:01 EDT X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com Xref: x330-a1.tempe.blueboxinc.net comp.compilers:319 >> I found following intermediate codes are generated in gcc >> >> rx <- 0 >> ... >> use rx >> ... >> ry <- 0 >> use ry >> ... This may be "rematerialization", which probably has other names. Sometimes it's better to re-compute a common value than to tie up a register. This may well be true for a constant 0 if there are few registers (x86-32).