On Wed, Feb 12, 2014 at 05:04:38PM +0000, Iyer, Balaji V wrote:
> I looked at the test code you send me (cf3.cc) at -O1 and it is removing
> all the lines you have shown above. Yes, I would imagine -O0 to have code
> that can be redundant or unnecessary. Some of it could be the artifact of
> internal code insertion. But isn't the main job of the instruction
> scheduler to remove all these redundant work? Besides, it is just a
> function call. The compiler at -O2, -O and -O3 removes the chunk of code
> that you mentioned.
As I said, just change the testcase so that the operator isn't inline, and
suddenly even -O3 will not be able to remove the call.
Jakub