This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/59448] Code generation doesn't respect C11 address-dependency
- From: "torvald at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 29 Oct 2014 09:04:44 +0000
- Subject: [Bug middle-end/59448] Code generation doesn't respect C11 address-dependency
- Auto-submitted: auto-generated
- References: <bug-59448-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59448
--- Comment #20 from torvald at gcc dot gnu.org ---
(In reply to joseph@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 allowing some
> barriers to be omitted that would otherwise be required.
That's not quite true, unfortunately, AFAIU. I agree that generally,
attributes are supposed to be "ignorable" -- but in the case of
carries_dependency, C++11 explicitly requires that all declarations of a
function either have the attribute or none has (see 7.6.4p2). This is because
you need that to actually exploit the attribute; it's a contract between
callers and callees. If a compiler does try to preserve dependencies (or not
across function boundaries), then ignoring the attribute is fine. But if there
should be a compiler out there that doesn't, and GCC-generated code is supposed
to link to that other compiler's code, then we need to do something to make
this work.