https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113106

--- Comment #4 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to Richard Biener from comment #3)
> The situation with address-spaces isn't valid as we need to preserve the
> second load because it's volatile.  I think we simply refuse to combine
> volatile loads out of caution in the first case.

int __seg_gs b;
return *(volatile __seg_gs int *) &b + b;

But the above is the same w.r.t to volatile as:

int a;
return *(volatile int *) &a + a;

?

BTW: I also checked with clang, and it creates expected code in all cases.

Reply via email to