wide-int, fortran

Mike Stump mikestump@comcast.net
Thu Jan 2 03:49:00 GMT 2014

On Nov 23, 2013, at 12:16 PM, Steve Kargl <sgk@troutmask.apl.washington.edu> wrote:
> On Sat, Nov 23, 2013 at 11:21:21AM -0800, Mike Stump wrote:
>> Richi has asked the we break the wide-int patch so that the individual port and front end maintainers can review their parts without have to go through the entire patch.    This patch covers the fortran front end.
>> Ok?
>> +  *logical = wi::eq_p (t, 0) ? 0 : 1;
> I can't find the meaning of :: in n1256.pdf.  What does this do?
> Also, given the complete lack of a description of what this
> patch does and no pointer to a discussion of what this
> patch does, and no description of its benefit to gfortran,
> I vote "no".

I don't like the notion that one person says yes, and one says no, and then we ignore the no, and use the yes to approve a patch.  Can the fortran come up with a final unified answer…  Thanks.

The quoted code above merely tests to see if t is equal to 0, and set *logical to 0 is it is 0 and 1 if it's not.

wi::eq_p is read in English as, does equality hold in the wide-int sense of equality?

mpz::eq_p would mean then, does equality hold in the mpz sense of equality?

tree::eq_p would mean then, does equality hold in the tree sense of equality?

If you interested in the lower layer answer, wi::eq_p()  calls a function, whose name is wi::eq_p, with the given arguments, just like foo() calls foo, with the given arguments.

operator +(1, 2), for example, calls a function whose name is operator +, with the two arguments 1 and 2.  In C++ names, if you will, can be arbitrarily composed and grouped using types (classes) and namespaces.  classes are composition of 0 or more other types (think struct in C), and namespaces are not.  wi, is such a namespace and relates to a concept called wide int, inside that concept, there is a concept of equality; however, there is no data with wi, it isn't a class (a struct).  In normal C, it would be spelled wi_eq_p () as C doesn't (yet) have a grouping feature.

As for the patch, it is a simple bug fix to fix a few ICEs and wrong code generation bugs present in gcc.  Without it, gcc ICEs and produces wrong code, with it, it doesn't.  The bugs are usually in the 2*HWI and larger sizes (64 bits for 32 hosts and 128 bit for 64 bit hosts). The benefit to fortran would be support for more correct code gen and a lessoning of ICEs on valid code.


More information about the Gcc-patches mailing list