From patchwork Sat Jun 1 18:01:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 248086 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]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id D12E52C00AD for ; Sun, 2 Jun 2013 04:01:12 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:date:message-id:subject:from:to:content-type; q= dns; s=default; b=u6Vkg9tbdWzM9SGwMg5XX9bW4mN8oZDl44iv4UsVHNNM5k /gs2hOKtKKPWYWfMyU2T50uZl7axcM7moHikSFsC0wpOy1RoeINPtNkXXM358Hr/ kLQF36iVlSVCe5m6lnrBs08aHB0gmrEWkw1fGz036NQ8RP1qu0cSVOMF4RF18= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:date:message-id:subject:from:to:content-type; s= default; bh=cDD3/AUIWaqvNRvE0g0xB5Jt1tM=; b=xZ6it8qeErycAD1R+ZuA fvgWHgSVuRfzhUJRd9/zs2D12ZIRTMYo06SFVKBBLmXsTed6OTvwpG66y2e1PKsX 0bMkz16LLlhh1L0i0IcFY1c6VQWeiI9YR2n84gR+7eWsM5pm2TSzowJCvMFaIe5O 0kWgA/aLimTVCpH6vt7AmTI= Received: (qmail 26294 invoked by alias); 1 Jun 2013 18:01:06 -0000 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 Received: (qmail 26284 invoked by uid 89); 1 Jun 2013 18:01:06 -0000 X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, SPF_PASS, TW_ZJ autolearn=ham version=3.3.1 Received: from mail-pb0-f41.google.com (HELO mail-pb0-f41.google.com) (209.85.160.41) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Sat, 01 Jun 2013 18:01:05 +0000 Received: by mail-pb0-f41.google.com with SMTP id xb12so3824916pbc.14 for ; Sat, 01 Jun 2013 11:01:03 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.66.72.41 with SMTP id a9mr18739142pav.133.1370109663378; Sat, 01 Jun 2013 11:01:03 -0700 (PDT) Received: by 10.70.2.164 with HTTP; Sat, 1 Jun 2013 11:01:03 -0700 (PDT) Date: Sat, 1 Jun 2013 20:01:03 +0200 Message-ID: Subject: [PATCH, alpha]: Fix ICE with conditional moves using DFmode compare with zero. From: Uros Bizjak To: "gcc-patches@gcc.gnu.org" X-Virus-Found: No Hello! Attached patch fixes FAIL: c-c++-common/cilk-plus/AN/builtin_fn_mutating.c -O3 cilkplus failure on alpha [1]. The problem was triggered only with -O3, due to direct expansion of conditional move. The attached patch swaps all compares, modulo DImode compares with zero, in the same way as expansions of conditional branch and setcc patterns. 2013-06-01 Uros Bizjak * config/alpha/alpha.c (alpha_emit_conditional_move): Swap all GE, GT, GEU and GTU compares, modulo DImode compares with zero. OK for mainline and release branches? [1] http://gcc.gnu.org/ml/gcc-testresults/2013-05/msg02980.html Uros. Index: alpha.c =================================================================== --- alpha.c (revision 199439) +++ alpha.c (working copy) @@ -2700,12 +2700,12 @@ alpha_emit_conditional_move (rtx cmp, enum machine break; case GE: case GT: case GEU: case GTU: - /* These must be swapped. */ - if (op1 != CONST0_RTX (cmp_mode)) - { - code = swap_condition (code); - tem = op0, op0 = op1, op1 = tem; - } + /* These normally need swapping, but for integer zero we have + special patterns that recognize swapped operands. */ + if (cmp_mode == DImode && op1 == const0_rtx) + break; + code = swap_condition (code); + tem = op0, op0 = op1, op1 = tem; break; default: