This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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: [1/4] [patch, middle-end] Make mpz_set/get_double_int functions non-static.


Hello,

> >now, this looks wrong to me.  I do not really want to argue whether it is
> >"useful function to export generally", however, obviously you need the
> >functionality at at least two places.  If you prefer, change the name of
> >the function/improve the comments to reflect your doubts (i.e., that it
> >does not really return bounds of the type, but rather minimum and
> >maximum value of the realization of the type), but just cloning the
> >function whenever you need it somewhere is IMHO not a good idea.
> 
> Ok, fair enough.  Do you have any suggestions for where this particular 
> function should go, if it's exported?  That was one of the reasons I did it 
> this way -- I couldn't find anything that seemed like a natural place for 
> it, and was hoping that if someone objected to the duplication, they'd have 
> a better suggestion.  :)
>
> (I suppose if nobody suggests a better alternative, I could put it in 
> tree.c with the other type-bounds functions.  It's rather unique in 
> returning mpz_t representations rather than double_ints or trees, though.)

that seems fine to me; I would not have much problems with keeping it
in tree-ssa-loop-niter.c, either.

> In particular, now that I've thought about it some more, I'm pretty sure 
> that using TYPE_MIN_VALUE and TYPE_MAX_VALUE here is the right thing to do 
> for mpz_get_double_int, which means that it shouldn't use this 
> get_type_bounds code at all.

I have looked at the other use of get_type_bounds, and it seems that
returning TYPE_MIN_VALUE and TYPE_MAX_VALUE would be the correct
behavior there as well.  Could you please change get_type_bounds
that way, when you are at it?

Zdenek


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