Re: Pointers and Optimization
- From: Daniel Carrera <daniel@xxxxxxxxx>
- Date: Thu, 31 Mar 2011 16:36:17 +0200
On 03/31/2011 04:29 PM, Arjen Markus wrote:
If, in my example, you leave out the target attribute to a, c can not
point to it and therefore any optimisation wrt a is okay.
(A clever compiler might be able to see this when c is not pointing to
a, but I doubt it will be able to in more realistic cases with a lot
more code)
Are you saying that in a non-trivial case, a Fortran compiler would be able to optimize this:
real :: a, b, d
real, pointer :: ptr
d = a + 1
... lots of code ...
call foo( ptr )
b = 2 * a
While in C/C++ it would not, because basically everything is "target"?
Daniel.
.
- Follow-Ups:
- Re: Pointers and Optimization
- From: Arjen Markus
- Re: Pointers and Optimization
- References:
- Pointers and Optimization
- From: Daniel Carrera
- Re: Pointers and Optimization
- From: Tobias Burnus
- Re: Pointers and Optimization
- From: Daniel Carrera
- Re: Pointers and Optimization
- From: Tobias Burnus
- Re: Pointers and Optimization
- From: m_b_metcalf
- Re: Pointers and Optimization
- From: Daniel Carrera
- Re: Pointers and Optimization
- From: m_b_metcalf
- Re: Pointers and Optimization
- From: Daniel Carrera
- Re: Pointers and Optimization
- From: Arjen Markus
- Re: Pointers and Optimization
- From: Daniel Carrera
- Re: Pointers and Optimization
- From: Arjen Markus
- Pointers and Optimization
- Prev by Date: Re: Pointers and Optimization
- Next by Date: Re: Pointers and Optimization
- Previous by thread: Re: Pointers and Optimization
- Next by thread: Re: Pointers and Optimization
- Index(es):