This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] [autovect patch] Implement vectorization hints


Hello,

> On Feb 27, 2005, at 1:22 PM, Zdenek Dvorak wrote:
> 
> >In particular the node that you take in the
> >vect_pragma_lookup function may have been moved there by some code
> >motion optimization from elsewhere.
> 
> That should not change info about node's source location (unless it is 
> generated by compiler).

exactly.  So you will use information about  the original location,
thus applying the pragma to a wrong loop, thus causing a
misscompilation.

> >Or the loop itself could be created
> >by some optimization (jump threading may do it sometimes).
> 
> In such cases user can not give any hints :)

But he could give a hint to another loop, which now by simply mapping
the source locations applies to this new loop, again causing a
misscompilation.

> >And these
> >are just those that occured to me, I am fairly sure there are more.
> 
> I do not disagree. This is not straight forward, but unless plan is to 
> attach pragma info with loop structures,

This would be probably the best solution, although also not without problems.

> I do not see any other very 
> straight forward alternative. As soon as one says,
>     User can put #pragma blah before the loop to give compiler hints...
> "before" brings in lot of edge cases.

There's not that much problem with formulation.  Simply the statements
and line numbers may get swapped a lot during the optimizations, and
basing any information on them (especially the type of information that
is likely to cause problems if mistakenly attributed to a wrong object)
is very risky.

Zdenek


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]