https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89430
--- Comment #8 from Jiangning Liu ---
It is related to https://gcc.gnu.org/ml/gcc-patches/2015-11/msg02998.html
Bernd's patch is an overkill.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89430
--- Comment #7 from Jiangning Liu ---
To avoid "readonly" issue, try this case,
unsigned test(unsigned k, unsigned b) {
unsigned a[2];
if (b < a[k]) {
a[k] = b;
}
return a[0]+a[2];
}
Variable a is
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89430
--- Comment #6 from Jiangning Liu ---
(In reply to Richard Biener from comment #5)
> (In reply to Jiangning Liu from comment #4)
> > >We need to be careful with loads
> > >or stores, for instance a load might not trap, while a store would
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89430
--- Comment #5 from Richard Biener ---
(In reply to Jiangning Liu from comment #4)
> >We need to be careful with loads
> >or stores, for instance a load might not trap, while a store would,
> >so if we see a dominating read access thi
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89430
--- Comment #4 from Jiangning Liu ---
>We need to be careful with loads
>or stores, for instance a load might not trap, while a store would,
>so if we see a dominating read access this doesn't mean that a later
>write access would
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89430
Richard Biener changed:
What|Removed |Added
Target||arm
Status|UNCONFIRMED
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89430
--- Comment #2 from Andrew Pinski ---
related to PR 54935.
I think there are other related recorded bugs too but I can't find them right
now.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89430
--- Comment #1 from Andrew Pinski ---
This transformation is not valid for the C11/C++11 memory model.