[Bug middle-end/59448] Code generation doesn't respect C11 address-dependency

2022-01-14 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59448 --- Comment #26 from Andrew Pinski --- http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0750r1.html

[Bug middle-end/59448] Code generation doesn't respect C11 address-dependency

2022-01-14 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59448 Andrew Pinski changed: What|Removed |Added Keywords||wrong-code Target Milestone|---

[Bug middle-end/59448] Code generation doesn't respect C11 address-dependency

2016-01-21 Thread torvald at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59448 torvald at gcc dot gnu.org changed: What|Removed |Added Status|NEW |RESOLVED Resolution|

[Bug middle-end/59448] Code generation doesn't respect C11 address-dependency

2015-01-14 Thread amacleod at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59448 --- Comment #24 from Andrew Macleod --- Author: amacleod Date: Wed Jan 14 13:58:35 2015 New Revision: 219601 URL: https://gcc.gnu.org/viewcvs?rev=219601&root=gcc&view=rev Log: 2015-01-14 Andrew MacLeod PR middle-end/59448 * builtins

[Bug middle-end/59448] Code generation doesn't respect C11 address-dependency

2014-11-24 Thread filter-gcc at preshing dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59448 --- Comment #23 from preshing --- Hi, I went ahead and verified this bug using a cross-compiler built from GCC 4.9.2 sources. The bug indeed exists and happens when compiling for AArch64, but not PowerPC. Andrew's patch fixes it (changing the fi

[Bug middle-end/59448] Code generation doesn't respect C11 address-dependency

2014-10-30 Thread filter-gcc at preshing dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59448 preshing changed: What|Removed |Added CC||filter-gcc at preshing dot com --- Comment #2

[Bug middle-end/59448] Code generation doesn't respect C11 address-dependency

2014-10-30 Thread torvald at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59448 --- Comment #21 from torvald at gcc dot gnu.org --- (In reply to torvald from comment #17) > (In reply to Andrew Macleod from comment #15) > > So have we concluded that we should promote memory_order_consume to > > memory_order_acquire for now?

[Bug middle-end/59448] Code generation doesn't respect C11 address-dependency

2014-10-29 Thread torvald at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59448 --- Comment #20 from torvald at gcc dot gnu.org --- (In reply to jos...@codesourcery.com from comment #19) > * carries_dependency is about increasing optimization, not decreasing it. > If it affects when barriers are added, it does so by allowin

[Bug middle-end/59448] Code generation doesn't respect C11 address-dependency

2014-10-28 Thread joseph at codesourcery dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59448 --- Comment #19 from joseph at codesourcery dot com --- On Tue, 28 Oct 2014, torvald at gcc dot gnu.org wrote: > Alternatively, we could try to be conservative and add an acquire barrier > before the function body if any parameter of the functio

[Bug middle-end/59448] Code generation doesn't respect C11 address-dependency

2014-10-28 Thread t.p.northover at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59448 --- Comment #18 from Tim Northover --- > I am not aware of any shipping compiler that would actually try to preserve > dependencies, and nobody else mentioned any during the discussion of this > topic in ISO C++ SG1. In case the data point is

[Bug middle-end/59448] Code generation doesn't respect C11 address-dependency

2014-10-28 Thread torvald at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59448 --- Comment #17 from torvald at gcc dot gnu.org --- (In reply to Andrew Macleod from comment #15) > So have we concluded that we should promote memory_order_consume to > memory_order_acquire for now? I also think that this is the best way forwa

[Bug middle-end/59448] Code generation doesn't respect C11 address-dependency

2014-10-28 Thread joseph at codesourcery dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59448 --- Comment #16 from joseph at codesourcery dot com --- My view is promote consume to acquire until the standards committees and formal model people have sorted out what to do with it.

[Bug middle-end/59448] Code generation doesn't respect C11 address-dependency

2014-10-28 Thread amacleod at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59448 --- Comment #15 from Andrew Macleod --- Created attachment 33831 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33831&action=edit promote memory order consume to acquire So have we concluded that we should promote memory_order_consume to m

[Bug middle-end/59448] Code generation doesn't respect C11 address-dependency

2014-10-28 Thread ramana at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59448 Ramana Radhakrishnan changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed|

[Bug middle-end/59448] Code generation doesn't respect C11 address-dependency

2014-02-17 Thread algrant at acm dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59448 --- Comment #13 from algrant at acm dot org --- I see what you mean - there is a race if threadB reads the data when the flag is not set, i.e. in the case when the read value is never used. Moving the read of data after the test (as in the fragment

[Bug middle-end/59448] Code generation doesn't respect C11 address-dependency

2014-02-17 Thread torvald at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59448 --- Comment #12 from torvald at gcc dot gnu.org --- (In reply to algrant from comment #11) > Where do you get that this is racy if the access to data is not atomic? In threadB(), you do: f = flag.load(std::memory_order_consume);

[Bug middle-end/59448] Code generation doesn't respect C11 address-dependency

2014-02-17 Thread algrant at acm dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59448 --- Comment #11 from algrant at acm dot org --- Where do you get that this is racy if the access to data is not atomic? By design, release/acquire and release/consume sequences don't require wholesale changes to the way the data payload (in the ge

[Bug middle-end/59448] Code generation doesn't respect C11 address-dependency

2014-01-23 Thread torvald at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59448 torvald at gcc dot gnu.org changed: What|Removed |Added CC||rth at gcc dot gnu.org --- Co

[Bug middle-end/59448] Code generation doesn't respect C11 address-dependency

2014-01-20 Thread joseph at codesourcery dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59448 --- Comment #9 from joseph at codesourcery dot com --- Thanks for the testcase. At this point I think we need Andrew MacLeod or Torvald Riegel to review it and assess what should happen where to fix this (both for direct uses of the atomic buil

[Bug middle-end/59448] Code generation doesn't respect C11 address-dependency

2014-01-20 Thread algrant at acm dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59448 --- Comment #8 from algrant at acm dot org --- I don't see how f can not be 0 or 1 here, but to make this even more clear that there is no UB, define flag this way: static std::atomic flag(0); and calculate the address this way: d = *(&d

[Bug middle-end/59448] Code generation doesn't respect C11 address-dependency

2014-01-20 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59448 --- Comment #7 from Andrew Pinski --- >*(&data + f - f); This could be undefined behavior if f is not 0 or 1.

[Bug middle-end/59448] Code generation doesn't respect C11 address-dependency

2014-01-20 Thread algrant at acm dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59448 --- Comment #6 from algrant at acm dot org --- Here is a complete C++11 test case. The code generated for the two loads in thread B doesn't maintain the required ordering: ... ldrbw1, [x0] uxtbw1, w1 adrp

[Bug middle-end/59448] Code generation doesn't respect C11 address-dependency

2013-12-16 Thread joseph at codesourcery dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59448 --- Comment #5 from joseph at codesourcery dot com --- On Thu, 12 Dec 2013, algrant at acm dot org wrote: > demonstrates the same lack of ordering. You suggest that this might > be a problem with the atomic built-ins - and yes, if this had been

[Bug middle-end/59448] Code generation doesn't respect C11 address-dependency

2013-12-12 Thread algrant at acm dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59448 --- Comment #4 from algrant at acm dot org --- So using g++, #include int f1(std::atomic const *p, std::atomic const *q) { int flag = p->load(std::memory_order_consume); return flag ? (q + flag - flag)->load(std::memory_order_relaxe