From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27772 invoked by alias); 14 Sep 2010 07:06:29 -0000 Received: (qmail 27665 invoked by uid 48); 14 Sep 2010 07:06:15 -0000 Date: Tue, 14 Sep 2010 07:06:00 -0000 Message-ID: <20100914070615.27664.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug tree-optimization/18065] usual arithmetic conversion not applying correctly In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "abnikant dot singh at atmel 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-09/txt/msg01599.txt.bz2 ------- Comment #34 from abnikant dot singh at atmel dot com 2010-09-14 07:06 ------- Yeah, this is happening because of the type promotion in gcc/c-common.c in the function c_promoting_integer_type_p. See this: /* Nonzero if the type T promotes to int. This is (nearly) the integral promotions defined in ISO C99 6.3.1.1/2. */ bool c_promoting_integer_type_p (const_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)); 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; } } So by commenting the case INTEGER_TYPE, we will get the call to _divmodqi4, but I don't think this is the right thing to do. -- abnikant dot singh at atmel dot com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |abnikant dot singh at atmel | |dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18065