This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/42633] New: hinting gcc that restricted pointer dont alias with members of structs
- From: "torbenh at gmx dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Jan 2010 13:01:40 -0000
- Subject: [Bug c++/42633] New: hinting gcc that restricted pointer dont alias with members of structs
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
there is currently no way to hint gcc that a restricted pointer
doesnt alias with a member of a struct.
quoting Richard Guenther on this:
------------------------------------------------------------------------------
Yes, in this case you can fix it by making ramp static. Otherwise its address
may be takein in another translation unit. For Fortran we have the
DECL_RESTRICTED_P which we could expose to other languages via an attribute.
It tells that a decl is not aliased by restrict qualified pointers, so
struct Ramp {
float phase;
inline float process() { return phase+}
} ramp __attribute__((restrict));
void fill_buffer( float * __restrict buf, size_t nframes )
{
for( size_t i=0; i<nframes; i++ )
buf[i] = ramp.process();
}
-------------------------------------------------------------------------
--
Summary: hinting gcc that restricted pointer dont alias with
members of structs
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: enhancement
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: torbenh at gmx dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42633