From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3870 invoked by alias); 23 Sep 2004 01:37:03 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 3846 invoked by alias); 23 Sep 2004 01:37:02 -0000 Date: Thu, 23 Sep 2004 01:37:00 -0000 Message-ID: <20040923013702.3845.qmail@sourceware.org> From: "mark at codesourcery dot com" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20040217171044.14179.debora.j.estey@lmco.com> References: <20040217171044.14179.debora.j.estey@lmco.com> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/14179] [3.3/3.4/4.0 Regression] out of memory X-Bugzilla-Reason: CC X-SW-Source: 2004-09/txt/msg02691.txt.bz2 List-Id: ------- Additional Comments From mark at codesourcery dot com 2004-09-23 01:37 ------- Subject: Re: [3.3/3.4/4.0 Regression] out of memory giovannibajo at libero dot it wrote: >>The most common case is probably that the "from" >>and "to" types are the same. So, you could try having >>implicit_conversion do "if same_type_p (to, from) && !class_type return >>identity conversion". (Might even be better just to check pointer >>equality of "to" and "from", so as to avoid the cost of same_type_p if >>they are *not* the same.) That would short-circuit a lot of the work, >>and might win for other test cases as well, because you save not only on >>digest_init, but with function calls like: >> void f(int); >> void g() { f(3); } >> >> > >Yes, but the problem is that also default promotions are very common: > >void f(char); >void g() { f(3); } > >and this is what we need to short-circuit for the testcase to start saving >memory. I tried something like: > > if (INTEGRAL_TYPE_P (to) && INTEGRAL_TYPE_P (from) > && same_type_p (type_promotes_to (to), type_promotes_to (from))) > return ocp_convert (to, expr, CONV_IMPLICIT, flags); > >but I'm not sure about those type_promotes_to, plus it segfaults for some >reason I'm investigating... > > I don't know about the segfault, but I'd worry that you might not win much once the tests get that complex, at least for code other than this one test case. Giant arrays with huge initializers are not the typical case, thankfully. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14179