From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27557 invoked by alias); 23 Feb 2010 00:30:05 -0000 Received: (qmail 27242 invoked by alias); 23 Feb 2010 00:29:52 -0000 Date: Tue, 23 Feb 2010 00:30:00 -0000 Message-ID: <20100223002952.27241.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c/43128] [4.5 Regression] c-c++-common/pr41779.c doesn't work In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "joseph at codesourcery dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-02/txt/msg02276.txt.bz2 ------- Comment #19 from joseph at codesourcery dot com 2010-02-23 00:29 ------- Subject: Re: [4.5 Regression] c-c++-common/pr41779.c doesn't work On Mon, 22 Feb 2010, manu at gcc dot gnu dot org wrote: > ------- Comment #18 from manu at gcc dot gnu dot org 2010-02-22 23:56 ------- > (In reply to comment #17) > > suggest having a c_ep_convert_and_check or similar function that handles > > excess precision: it would take the result type, the semantic result type > > (the type that gets used eventually to build an EXCESS_PRECISION_EXPR) and > > the value to convert. It would just call convert_and_check, ignoring the > > semantic type, *except* when the operand has integer type *and* the > > semantic type is non-NULL; in that case, it would first convert to the > > semantic type them to the result type. > > Wouldn't that change the normal result of promotion rules? No. The present logic is: convert (with convert_and_check) both operands to a common type, which may have excess precision; then, later, after producing the tree for the result of the operation, wrap that in an EXCESS_PRECISION_EXPR, using the semantic type, if there is a semantic type different from the type with excess precision. The proposed logic is the same, *except* that the conversion to a common type goes via the semantic type, *if* there is excess precision involved *and* the operand being converted had integer type. > Also, why call convert_and_check ignoring the semantic type and not just call > convert? The excess precision type should be large enough to not cause any > problem that needs checking. Yes, you could just use convert for the second conversion (semantic type to type with excess precision). -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43128