From patchwork Thu Jul 21 07:39:45 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 106012 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 63EC2B6F64 for ; Thu, 21 Jul 2011 17:40:09 +1000 (EST) Received: (qmail 18649 invoked by alias); 21 Jul 2011 07:40:05 -0000 Received: (qmail 18634 invoked by uid 22791); 21 Jul 2011 07:40:03 -0000 X-SWARE-Spam-Status: No, hits=-7.1 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 21 Jul 2011 07:39:47 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p6L7dlHv023948 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 21 Jul 2011 03:39:47 -0400 Received: from tyan-ft48-01.lab.bos.redhat.com (tyan-ft48-01.lab.bos.redhat.com [10.16.42.4]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p6L7dkeJ011222 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 21 Jul 2011 03:39:46 -0400 Received: from tyan-ft48-01.lab.bos.redhat.com (localhost.localdomain [127.0.0.1]) by tyan-ft48-01.lab.bos.redhat.com (8.14.4/8.14.4) with ESMTP id p6L7djwt021145 for ; Thu, 21 Jul 2011 09:39:45 +0200 Received: (from jakub@localhost) by tyan-ft48-01.lab.bos.redhat.com (8.14.4/8.14.4/Submit) id p6L7dj2f021143 for gcc-patches@gcc.gnu.org; Thu, 21 Jul 2011 09:39:45 +0200 Date: Thu, 21 Jul 2011 09:39:45 +0200 From: Jakub Jelinek To: gcc-patches@gcc.gnu.org Subject: [4.4 PATCH] Fix another signed 1 bit comparison issue (PR middle-end/48973) Message-ID: <20110721073945.GL2687@tyan-ft48-01.lab.bos.redhat.com> Reply-To: Jakub Jelinek MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Hi! The 4.4 expr.c is significantly different from 4.5 that the PR48973 backport wasn't trivial, and apparently I've missed another place - on the 4.4 branch the new pr48973-{1,2}.c tests fail on s390{,x}-linux. The following patch fixes it, ok for 4.4 branch? 2011-07-21 Jakub Jelinek PR middle-end/48973 * expr.c (expand_expr_real_1) : If the comparison has a single bit signed type, use constm1_rtx instead of const1_rtx for true value. Jakub --- gcc/expr.c (revision 176517) +++ gcc/expr.c (working copy) @@ -9171,7 +9171,9 @@ expand_expr_real_1 (tree exp, rtx target jumpifnot (exp, op1, -1); if (target) - emit_move_insn (target, const1_rtx); + emit_move_insn (target, + TYPE_PRECISION (type) == 1 && !TYPE_UNSIGNED (type) + ? constm1_rtx : const1_rtx); emit_label (op1); return ignore ? const0_rtx : target;