This is the mail archive of the gcc@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: fix for PR 4447: is this really correct?


I wrote:
> > Mark approved, assuming the usual testing requirements are met.

Mike Stump writes:
> :-(

Note that this is already in the trunk, and I'm temporarily withdrawing
my request to put this into 3.0.3 until we understand the consequences
better.  I overcame the temptation to slip it in anyway. :-)

> > I've now verified that this fix doesn't break any C++ or libstdc++
> > tests (other tests aren't relevant since this only affects cc1plus).
> 
> If I understand the fix, it is worse than not having it, as it hides a
> real bug?

Well, there is a bug that is being hidden, but that's not the same as
saying that it's worse than not having the fix.  The problem is that
there's no way to work around this ICE without degrading performance
in my application (attempting to speed up a class library that does
fixed-point arithmetic).

> > But I am now not sure that this fix is quite correct, though it does
> > improve things.
> 
> I think the ICE is preferable, as otherwise you have to explain that
> you have to break the ABI, which is worse.

I'd prefer to have neither the ICE nor the ABI breakage, but I'd prefer
the latter to the former.

> > on Solaris gives
> 
> > 0000000000 T foo(T<true, 3>, T<true, 4>)
> > 0000000000 T T<(true)&&(true), ((3)+(4))-(operator int((true)&&(true)))> func<true, true, 3, 4>(T<true, 3>, T<true, 4>)
> 
> Ick!  Looks like a bug.

Yes.  Maybe it's possible to fix the bug by applying a constant-folding
operation to template arguments before the mangler is called.

> > Comments?  I may still want this for 3.0.3, because it does make
> > some cases that ICE'd before work correctly
> 
> Is that working correctly?  I don't think so.  From an, I don't care
> about the abi, yes, it works fine, but from an, gosh, what do you mean
> you totally broke the abi, I thought you said you weren't going to do
> that, it looks like absolute horror.

News flash: 3.1 will have a couple of minor ABI bug fixes, so it seems
that we're already in a position to break the ABI, despite our promise.
The cases in question are corner cases, so they may not have a substantial
effect, but they exist.

In this case, the generated symbol will be exactly the symbol that is
called, so even if the bug is fixed I think that a 3.0 <-> 3.1+fix
link will work.



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