From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31006 invoked by alias); 21 Dec 2004 20:50:17 -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 30972 invoked by uid 48); 21 Dec 2004 20:50:13 -0000 Date: Tue, 21 Dec 2004 20:50:00 -0000 Message-ID: <20041221205013.30971.qmail@sourceware.org> From: "schlie at comcast dot net" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20041019202143.18065.schlie@comcast.net> References: <20041019202143.18065.schlie@comcast.net> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug tree-optimization/18065] usual arithmetic conversion not applying correctly X-Bugzilla-Reason: CC X-SW-Source: 2004-12/txt/msg03107.txt.bz2 List-Id: ------- Additional Comments From schlie at comcast dot net 2004-12-21 20:50 ------- (although not the most elegant fix) This fixes the rest of the problem, as there's no reaon to default promote smaller than int sized integers to int, they will end up being promoted if required by the back-end if the target requires them to be (also should not need to litterally promote enum's and bool beyond the smallest int type with suffecient to represent it's value range): (called via default_conversion() to determine if an expression should be converted by default to int) *** In File: c-common.c *** bool c_promoting_integer_type_p (tree t) { switch (TREE_CODE (t)) { - case INTEGER_TYPE: - return (TYPE_MAIN_VARIANT (t) == char_type_node - || TYPE_MAIN_VARIANT (t) == signed_char_type_node - || TYPE_MAIN_VARIANT (t) == unsigned_char_type_node - || TYPE_MAIN_VARIANT (t) == short_integer_type_node - || TYPE_MAIN_VARIANT (t) == short_unsigned_type_node - || TYPE_PRECISION (t) < TYPE_PRECISION (integer_type_node)); pws--*/ - case ENUMERAL_TYPE: /* ??? Technically all enumerations not larger than an int promote to an int. But this is used along code paths that only want to notice a size change. */ return TYPE_PRECISION (t) < TYPE_PRECISION (integer_type_node); case BOOLEAN_TYPE: return 1; default: return 0; } } *** end *** -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18065