On Mon, Jun 04, 2018 at 06:05:59PM -0400, Michael Meissner wrote: > > > This > > > allows templates to work again with those types (the template code aborts > > > if > > > you have two distinct types use the same mangling). However, overloaded > > > types > > > won't work, but I suspect these days people use templates over overloaded > > > functions. I fixed up the test case for this (pr85657.C) so that it only > > > tests > > > for templates. > > > > If tests fail, do not delete the test. If we have a problem, we have > > a problem, and it needs to be fixed (not necessarily today of course, > > and there is xfail for long-standing problems). > > This is a fundamental detail of the current changes. There is no way it can > be > 'fixed'. > > If __float128/__ibm128 each use the long double type internally when long > double uses that representation, then you cannot have overloaded functions > that > use the two types. > > I.e. > > class foo { > // ... > long double arith (long double); > __float128 arith (__float128); > __ibm128 arith (__ibm128); > } > > In the previous changes that the test was written for, we had 3 types within > the compiler. We had a __float128 type, we had a long double type, and we had > an __ibm128 type. We had different manglings for each of the different types. > > Now that we only have two types, you can't have explicit overloading of the > same type. You can have templates, because only one version of the template > is > created for the two types.
You can still have overloads, just not two between the same type. So you can have both __ibm128 and __ieee128. > The test in question was new and written when I did the previous changes. It > is not a long standing problem. The test was explicitly written to make sure > all three types were different. Since we now have only two types, we need to > adjust the test. The test currently ICEs. That needs to be fixed. > > > +/* Generate old manged name, not new name. */ > > > +static bool old_mangling; > > > > As Andreas said, this is not a good name. Please at least mention for > > what type this old mangling is. > > I will consider this. Thanks. Naming is hard :-( > > I wonder how hard it would be to alias the long double type to either > > __ibm128 or __ieee128, instead of the other way around? This would > > simplify code a lot. Esp. if we can do the same thing for the modes, > > too. > > It depends on whether other parts of the compiler already have links to long > double before the hook in rs6000.c gets called. I frankly don't see it as > simplifying the code. Not even if we can also get rid of TFmode as separate mode? Segher