This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
When looking at an Ada PR, I stumbled upon the equivalent of the following C code:
unsigned char x; volatile unsigned char y;
void f () { x |= 16; y |= 32; }
With trunk/i686, the following code is generated (-O3 -fomit-frame-pointer):
f: movzbl y, %eax orb $16, x orl $32, %eax movb %al, y ret
I cannot see a reason not to use "orb $32,y" here instead of a three steps read/modify/write operation. Is this only a missed optimization? (in which case I will open a PR)
Are you sure it is an optimization, the timing on these things is very subtle. What evidence do you have that there is a missed optimization here?
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |