[Open64-devel] WHIRL question

2010-09-29 Thread C. Bergström
(forwarding this question) This code j = --i + i--; Is transformed into this (pseudo)WHIRL: STID(i) - ADD - LDID(i) ; this is the side \ INTCONST(-1); effect of the --i expression STID(preg_I4) - LDID(i)

Re: [Open64-devel] WHIRL question

2010-09-29 Thread Gilmore, Doug
I suspect that the translation is done in a way that that ensures correctness. The temp is not needed in your example, but it is needed for: j = i-- + i-- Doug -Original Message- From: C. Bergström [mailto:cbergst...@pathscale.com] Sent: Wednesday, September 29, 2010 7:15 AM To:

Re: [Open64-devel] WHIRL question

2010-09-29 Thread Chandrasekhar Murthy
I think it might have been done to handle the case where i is volatile. It might also be needed for code dealing with auto decrement coupled with pointer dereferencing and the computing of pointer involves an expression having side effects. Murthy -Original Message- From: Gilmore, Doug