public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/47538] [4.6 Regression] GNU Scientific Library miscompiled by gcc 4.6
Date: Mon, 31 Jan 2011 10:16:00 -0000	[thread overview]
Message-ID: <bug-47538-4-COBKcvLArX@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-47538-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47538

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org
          Component|c                           |tree-optimization

--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-01-31 09:30:30 UTC ---
Ugh.  The problem seems to be that the middle-end considers sizetype and size_t
to be compatible types, thus we have x = y + 1; and similar stmts where x and 1
has sizetype type, but y has size_t.  tree-ssa-ccp.c (but similarly other
places e.g. in tree.c) ignore TYPE_UNSIGNED on sizetype, assuming it is 0, so
my fix in tree-ssa-ccp.c results in different value of uns on such stmts.

--- gcc/tree-ssa.c.jj   2011-01-15 11:26:42.000000000 +0100
+++ gcc/tree-ssa.c      2011-01-31 10:16:30.319433380 +0100
@@ -1276,6 +1276,12 @@ useless_type_conversion_p (tree outer_ty
          || TYPE_PRECISION (inner_type) != TYPE_PRECISION (outer_type))
        return false;

+      if ((TREE_CODE (inner_type) == INTEGER_TYPE
+          && TYPE_IS_SIZETYPE (inner_type))
+         != (TREE_CODE (outer_type) == INTEGER_TYPE
+             && TYPE_IS_SIZETYPE (outer_type)))
+       return false;
+
       /* We don't need to preserve changes in the types minimum or
         maximum value in general as these do not generate code
         unless the types precisions are different.  */

seems to fix the miscompilation, but I'm afraid could have pretty substantial
result on IL size.  Why do we need something so ill-designed as sizetype?  Just
for Ada?


  parent reply	other threads:[~2011-01-31  9:31 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-30  2:03 [Bug c/47538] New: " howarth at nitro dot med.uc.edu
2011-01-30  2:07 ` [Bug c/47538] " howarth at nitro dot med.uc.edu
2011-01-30  2:48 ` howarth at nitro dot med.uc.edu
2011-01-30  3:05 ` howarth at nitro dot med.uc.edu
2011-01-30  3:10 ` howarth at nitro dot med.uc.edu
2011-01-30  9:39 ` howarth at nitro dot med.uc.edu
2011-01-30 18:20 ` [Bug c/47538] [4.6 Regression] " hjl.tools at gmail dot com
2011-01-30 22:03 ` hjl.tools at gmail dot com
2011-01-31 10:16 ` jakub at gcc dot gnu.org [this message]
2011-01-31 10:29 ` [Bug tree-optimization/47538] " ebotcazou at gcc dot gnu.org
2011-01-31 10:45 ` jakub at gcc dot gnu.org
2011-01-31 10:53 ` rguenth at gcc dot gnu.org
2011-01-31 12:50 ` jakub at gcc dot gnu.org
2011-01-31 13:18 ` rguenth at gcc dot gnu.org
2011-01-31 13:24 ` rguenth at gcc dot gnu.org
2011-01-31 13:29 ` rguenth at gcc dot gnu.org
2011-01-31 15:57 ` howarth at nitro dot med.uc.edu
2011-01-31 17:07 ` jakub at gcc dot gnu.org
2011-01-31 17:23 ` jakub at gcc dot gnu.org
2011-02-02 18:31 ` dnovillo at gcc dot gnu.org

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=bug-47538-4-COBKcvLArX@http.gcc.gnu.org/bugzilla/ \
    --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).