public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/42633] New: hinting gcc that restricted pointer dont alias with members of structs
@ 2010-01-06 13:01 torbenh at gmx dot de
2010-01-06 13:11 ` [Bug c++/42633] " torbenh at gmx dot de
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: torbenh at gmx dot de @ 2010-01-06 13:01 UTC (permalink / raw)
To: gcc-bugs
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/42633] hinting gcc that restricted pointer dont alias with members of structs
2010-01-06 13:01 [Bug c++/42633] New: hinting gcc that restricted pointer dont alias with members of structs torbenh at gmx dot de
@ 2010-01-06 13:11 ` torbenh at gmx dot de
2010-01-06 13:20 ` torbenh at gmx dot de
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ messages in thread
From: torbenh at gmx dot de @ 2010-01-06 13:11 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from torbenh at gmx dot de 2010-01-06 13:10 -------
Created an attachment (id=19484)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19484&action=view)
test case which doesnt optimize properly
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42633
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/42633] hinting gcc that restricted pointer dont alias with members of structs
2010-01-06 13:01 [Bug c++/42633] New: hinting gcc that restricted pointer dont alias with members of structs torbenh at gmx dot de
2010-01-06 13:11 ` [Bug c++/42633] " torbenh at gmx dot de
@ 2010-01-06 13:20 ` torbenh at gmx dot de
2010-01-06 13:57 ` rguenth at gcc dot gnu dot org
2010-01-06 17:42 ` torbenh at gmx dot de
3 siblings, 0 replies; 7+ messages in thread
From: torbenh at gmx dot de @ 2010-01-06 13:20 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from torbenh at gmx dot de 2010-01-06 13:19 -------
the generated x86_64 asm: _Z11fill_bufferPfm: .LFB3: testq %rsi, %rsi
je .L4 xorl %eax, %eax movss .LC0(%rip), %xmm2
.p2align 4,,10 .p2align 3 .L3: movss ramp(%rip), %xmm1 movaps
%xmm1, %xmm0 addss %xmm2, %xmm0 movss %xmm0, ramp(%rip) movss
%xmm1, (%rdi,%rax,4) addq $1, %rax cmpq %rax, %rsi ja
.L3 .L4: rep ret while gcc patched with -fnoalias generates:
_Z11fill_bufferPfm: .LFB1: .cfi_startproc .cfi_personality
0x3,__gxx_personality_v0 testq %rsi, %rsi je .L4 movss
ramp(%rip), %xmm0 xorl %eax, %eax movss .LC0(%rip), %xmm1
.p2align 4,,10 .p2align 3 .L3: movss %xmm0, (%rdi,%rax,4) addq
$1, %rax addss %xmm1, %xmm0 cmpq %rax, %rsi ja .L3
movss %xmm0, ramp(%rip) .L4: rep ret
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42633
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/42633] hinting gcc that restricted pointer dont alias with members of structs
2010-01-06 13:01 [Bug c++/42633] New: hinting gcc that restricted pointer dont alias with members of structs torbenh at gmx dot de
2010-01-06 13:11 ` [Bug c++/42633] " torbenh at gmx dot de
2010-01-06 13:20 ` torbenh at gmx dot de
@ 2010-01-06 13:57 ` rguenth at gcc dot gnu dot org
2010-01-06 17:42 ` torbenh at gmx dot de
3 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-01-06 13:57 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from rguenth at gcc dot gnu dot org 2010-01-06 13:57 -------
Mine.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |rguenth at gcc dot gnu dot
|dot org |org
Status|UNCONFIRMED |ASSIGNED
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2010-01-06 13:57:05
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42633
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/42633] hinting gcc that restricted pointer dont alias with members of structs
2010-01-06 13:01 [Bug c++/42633] New: hinting gcc that restricted pointer dont alias with members of structs torbenh at gmx dot de
` (2 preceding siblings ...)
2010-01-06 13:57 ` rguenth at gcc dot gnu dot org
@ 2010-01-06 17:42 ` torbenh at gmx dot de
3 siblings, 0 replies; 7+ messages in thread
From: torbenh at gmx dot de @ 2010-01-06 17:42 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from torbenh at gmx dot de 2010-01-06 17:42 -------
Created an attachment (id=19487)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19487&action=view)
patch to add the attribute
i am not sure about the decl_req, type_req, fn_type_req values.
maybe its true, false, false
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42633
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/42633] hinting gcc that restricted pointer dont alias with members of structs
[not found] <bug-42633-4@http.gcc.gnu.org/bugzilla/>
2020-03-31 20:36 ` eyalroz at technion dot ac.il
@ 2020-04-01 6:54 ` rguenth at gcc dot gnu.org
1 sibling, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-04-01 6:54 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42633
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to fail| |4.6.4
Known to work| |4.7.0
Resolution|--- |FIXED
Status|ASSIGNED |RESOLVED
--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
It's already fixed, since GCC 4.7.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/42633] hinting gcc that restricted pointer dont alias with members of structs
[not found] <bug-42633-4@http.gcc.gnu.org/bugzilla/>
@ 2020-03-31 20:36 ` eyalroz at technion dot ac.il
2020-04-01 6:54 ` rguenth at gcc dot gnu.org
1 sibling, 0 replies; 7+ messages in thread
From: eyalroz at technion dot ac.il @ 2020-03-31 20:36 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42633
Eyal Rozenberg <eyalroz at technion dot ac.il> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |eyalroz at technion dot ac.il
--- Comment #5 from Eyal Rozenberg <eyalroz at technion dot ac.il> ---
This bug is marked assigned, and there's a patch, but 10 years have passed.
Torben, Richard - ping.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2020-04-01 6:54 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-06 13:01 [Bug c++/42633] New: hinting gcc that restricted pointer dont alias with members of structs torbenh at gmx dot de
2010-01-06 13:11 ` [Bug c++/42633] " torbenh at gmx dot de
2010-01-06 13:20 ` torbenh at gmx dot de
2010-01-06 13:57 ` rguenth at gcc dot gnu dot org
2010-01-06 17:42 ` torbenh at gmx dot de
[not found] <bug-42633-4@http.gcc.gnu.org/bugzilla/>
2020-03-31 20:36 ` eyalroz at technion dot ac.il
2020-04-01 6:54 ` rguenth at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).