public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/44555] Pointer evalutions, is that expected ?
Date: Wed, 16 Jun 2010 11:36:00 -0000	[thread overview]
Message-ID: <20100616113547.30523.qmail@sourceware.org> (raw)
In-Reply-To: <bug-44555-19333@http.gcc.gnu.org/bugzilla/>



------- Comment #7 from rguenth at gcc dot gnu dot org  2010-06-16 11:35 -------
Obvious patch, removing the premature (and bogus) optimization:

Index: c-common.c
===================================================================
--- c-common.c  (revision 160826)
+++ c-common.c  (working copy)
@@ -3825,23 +3825,7 @@ c_common_truthvalue_conversion (location
                        inner);
            return truthvalue_true_node;
          }
-
-       /* If we still have a decl, it is possible for its address to
-          be NULL, so we cannot optimize.  */
-       if (DECL_P (inner))
-         {
-           gcc_assert (DECL_WEAK (inner));
-           break;
-         }
-
-       if (TREE_SIDE_EFFECTS (inner))
-         {
-           expr = build2 (COMPOUND_EXPR, truthvalue_type_node,
-                          inner, truthvalue_true_node);
-           goto ret;
-         }
-       else
-         return truthvalue_true_node;
+       break;
       }

     case COMPLEX_EXPR:


-- 


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


  parent reply	other threads:[~2010-06-16 11:36 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-16  9:18 [Bug c/44555] New: " zilvinas dot valinskas at gmail dot com
2010-06-16  9:35 ` [Bug c/44555] " schwab at linux-m68k dot org
2010-06-16 10:29 ` zilvinas dot valinskas at gmail dot com
2010-06-16 10:44 ` redi at gcc dot gnu dot org
2010-06-16 10:53 ` schwab at linux-m68k dot org
2010-06-16 11:23 ` rguenth at gcc dot gnu dot org
2010-06-16 11:31 ` rguenth at gcc dot gnu dot org
2010-06-16 11:36 ` rguenth at gcc dot gnu dot org [this message]
2010-06-16 14:11 ` rguenth at gcc dot gnu dot org
2010-06-16 14:13 ` [Bug c/44555] [4.3/4.4/4.5 Regression] " rguenth at gcc dot gnu dot org
2010-06-24 21:43 ` rguenth at gcc dot gnu dot org
2010-06-25 10:36 ` rguenth at gcc dot gnu dot org
2010-07-27 13:08 ` [Bug c/44555] [4.3/4.4 " rguenth at gcc dot gnu dot org
2010-08-11 13:00 ` [Bug c/44555] [4.3 " rguenth at gcc dot gnu dot org
2010-08-11 13:00 ` rguenth at gcc dot gnu dot 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=20100616113547.30523.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).