Is this well defined code?

I'm still slightly confused after reading this topic. Is the following C++ expression *d++ = ~(*d); well defined? Yes, I know compound expressions like this are ugly.. I didn't write it.

I see a slight difference in the generated assembly when I compare it to:

*d = ~(*d);
d++;

Assembly:

*d++ = ~(*d);
0x83384    LDR           R3,[R0 ,4]        <, R1 , 1
0x8338c    MVN           R3, R3
0x83390    STR           R3,[R0 ],4

vs

*d = ~(*d);
d++;
0x83384   LDR           R3,[R0 ]
0x83388   ADD           R1 , R1 , 1
0x8338c   MVN           R3, R3
0x83390   STR           R3,[R0 ],4

Thanks!

10
задан Community 23 May 2017 в 01:51
поделиться