Translation of multidimensional arrays
Zdenek Dvorak
rakdver@atrey.karlin.mff.cuni.cz
Mon May 15 19:43:00 GMT 2006
Hello,
> > > 3) Maintaining type consistency and proper alias information gets harder.
> > > Especially when you include modules and inlining. Currently we use the
> > > same type_t[0...<unknown>] for pretty much everything and TBAA assumes
> > > they can all alias. There are probably complications where we have two
> > > representations or temporary copies of an array (eg. with function
> > > arguments).
> >
> > I have thought about this as well; I think in most cases you can avoid
> > having two representations of the array live at the same time
>
> I'm not convinced by any argument that involves not being "live at the same
> time". Doesn't that just make it harder to find the bug when some
> optimization pass rearranges the code and makes them live at the same time.
what should be the problem, then? They do not share the same location
then, and thus they cannot alias. Even if alias analysis gets it wrong and
claims they do, it cannot cause any problems (except for missing some
optimizations).
You can only potentially run into problems when you would have two arrays of
different shape sharing the same location; this may happen for array
sections and assumed shape/size arrays, so one has to be a bit careful
in these cases; but reallocatable arrays should not cause problems.
Zdenek
More information about the Fortran
mailing list