From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30596 invoked by alias); 16 Jun 2010 11:36:01 -0000 Received: (qmail 30524 invoked by uid 48); 16 Jun 2010 11:35:47 -0000 Date: Wed, 16 Jun 2010 11:36:00 -0000 Message-ID: <20100616113547.30523.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c/44555] Pointer evalutions, is that expected ? In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "rguenth at gcc dot gnu dot org" 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-06/txt/msg01698.txt.bz2 ------- 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