public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "abnikant dot singh at atmel dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/18065] usual arithmetic conversion not applying correctly
Date: Tue, 14 Sep 2010 07:06:00 -0000	[thread overview]
Message-ID: <20100914070615.27664.qmail@sourceware.org> (raw)
In-Reply-To: <bug-18065-9497@http.gcc.gnu.org/bugzilla/>



------- 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


       reply	other threads:[~2010-09-14  7:06 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-18065-9497@http.gcc.gnu.org/bugzilla/>
2010-09-14  7:06 ` abnikant dot singh at atmel dot com [this message]
2010-09-14  7:13 ` abnikant dot singh at atmel dot com
     [not found] <bug-18065-4@http.gcc.gnu.org/bugzilla/>
2012-05-24 14:03 ` peter777778 at hotmail dot co.uk
2012-05-24 14:04 ` peter777778 at hotmail dot co.uk
2012-05-24 14:05 ` peter777778 at hotmail dot co.uk
2012-05-24 14:23 ` peter777778 at hotmail dot co.uk
2004-10-19 20:22 [Bug c/18065] New: wrong built-in functions selected schlie at comcast dot net
2004-10-20 22:31 ` [Bug tree-optimization/18065] usual arithmetic conversion not applying correctly pinskia at gcc dot gnu dot org
2004-10-20 22:42 ` jsm at polyomino dot org dot uk
2004-10-20 23:03 ` jsm at polyomino dot org dot uk
2004-10-20 23:28 ` schlie at comcast dot net
2004-10-21  1:04 ` schlie at comcast dot net
2004-10-21  1:28 ` schlie at comcast dot net
2004-10-21 12:47 ` bangerth at dealii dot org
2004-12-21 20:50 ` schlie at comcast dot net
2005-01-16  1:39 ` pinskia at gcc dot gnu dot org
2005-01-16  7:17 ` schlie at comcast dot net
2005-01-16 17:39 ` schlie at comcast dot net

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100914070615.27664.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).