Re: spinlock variable protection

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2015-01-30 16:52 GMT+03:00 buyitian <buyitian@xxxxxxxxx>:
>>
> Please check the assembly code to double confirm the GCC behavior.
> Why will GCC change the order as what you mentioned? Only assembly code can tell you.

It does not change at the moment. I think it can change it.

Because from line
  ret = hdl->count;
until line
  return ret;
there is no access to either ret or hdl->count. So it is reasonable to
optimizer to think that their values are the same and eliminate
unneeded variable.

-- 
With best regards,
Matwey V. Kornilov
http://blog.matwey.name
xmpp://0x2207@xxxxxxxxx

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies




[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux