> If you always want DMD never to bounds check for specific code, you just
> can write "a.ptr[index]" instead of "a[index]" (when a is an array).
> That's because array.ptr returns a pointer to the first element, and
> using [] on a pointer works exactly like C pointer math. The good thing
> ab
#ponce wrote:
Stewart Gordon Wrote:
My recollection of reading the spec is that a D compiler is allowed to
optimise by assuming no pointer aliasing. But I can't remember at the
moment where I read this.
I don't know if this is neat or nasty for a compiler to do so.
OT : Is there a DMD swi
#ponce wrote:
OT : Is there a DMD switch to disable bound check exceptions ? This way I
wouldn't have to rely on pointers so much.
Why do you want to do that? Sounds like a case of trying to fix the
wrong problem.
Stewart.
#ponce wrote:
Stewart Gordon Wrote:
My recollection of reading the spec is that a D compiler is allowed to
optimise by assuming no pointer aliasing. But I can't remember at the
moment where I read this.
I don't know if this is neat or nasty for a compiler to do so.
OT : Is there a DMD swi
Stewart Gordon Wrote:
> My recollection of reading the spec is that a D compiler is allowed to
> optimise by assuming no pointer aliasing. But I can't remember at the
> moment where I read this.
I don't know if this is neat or nasty for a compiler to do so.
OT : Is there a DMD switch to disab
#ponce Wrote:
> Stewart Gordon Wrote:
> > My recollection of reading the spec is that a D compiler is allowed to
> > optimise by assuming no pointer aliasing. But I can't remember at the
> > moment where I read this.
>
> I don't know if this is neat or nasty for a compiler to do so.
>
> OT :
#ponce wrote:
I'm currently using a lot of pointers to perform heavy computation
Has D the equivalent for C's restrict ? More generally, how does D
cope with the aliasing of pointers ? I think it's crucial for the
code optimizer.
My recollection of reading the spec is that a D compiler is al
#ponce:
> I'm currently using a lot of pointers to perform heavy computation Has D the
> equivalent for C's restrict ? More generally, how does D cope with the
> aliasing of pointers ? I think it's crucial for the code optimizer.<
DMD probably just doesn't perform such optimizations. LLVM that'
On Sat, Sep 5, 2009 at 3:49 AM, #ponce wrote:
> I'm currently using a lot of pointers to perform heavy computation
>
> Has D the equivalent for C's restrict ? More generally, how does D cope with
> the aliasing of pointers ? I think it's crucial for the code optimizer.
It doesn't.