From patchwork Sat Aug 31 13:18:30 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 271527 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 "www.sourceware.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by ozlabs.org (Postfix) with ESMTPS id DCE0B2C0098 for ; Sat, 31 Aug 2013 23:18:41 +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=PX9xOar1xXDQKpsP2eJGHAHiwG4wznAUOvA5dHNXrKV7EN k44dvPzh0R6tjJ1eJ8ur1VmOGXXxy8C5mw8OoJxJvH8oZoTnVHoOOicFwo5wIUS5 +EvMIxvwf7vrZQQnVdSglcB3PpkDcjaDM+0CdElF+Y679iPRdi0bAMnqy9QzQ= 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=xpwn1d/LwZ3/oRfzj+EHhEJ/Sjc=; b=qz4P1NoGYnPtoySM20Sn PaDWcFyYuIdoN0BWTHH00qk5ZvfqJZIRWMyg4WsGxqa5VoY58AxMUEYZ6tN9bvDK qNKysNXa2R28LqMQHFlTPhQDMVN6LDrQTd+2YFajJ9vSS5pCoJ24JTV0dvHcYueE 5cbGD90EqSEAn3RNC7UbsqU= Received: (qmail 23636 invoked by alias); 31 Aug 2013 13:18:34 -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 23626 invoked by uid 89); 31 Aug 2013 13:18:33 -0000 Received: from mail-oa0-f47.google.com (HELO mail-oa0-f47.google.com) (209.85.219.47) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Sat, 31 Aug 2013 13:18:33 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, NO_RELAYS autolearn=ham version=3.3.2 X-HELO: mail-oa0-f47.google.com Received: by mail-oa0-f47.google.com with SMTP id g12so3467150oah.20 for ; Sat, 31 Aug 2013 06:18:31 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.182.81.41 with SMTP id w9mr10534469obx.18.1377955111031; Sat, 31 Aug 2013 06:18:31 -0700 (PDT) Received: by 10.182.137.136 with HTTP; Sat, 31 Aug 2013 06:18:30 -0700 (PDT) Date: Sat, 31 Aug 2013 15:18:30 +0200 Message-ID: Subject: [PATCH, alpha]: Fix recent gfortran.dg/pr32533.f90 test failure From: Uros Bizjak To: "gcc-patches@gcc.gnu.org" Hello! The compilation emitted following sequence for cmove with unsigned compare, resulting in gfortran.dg/pr32533.f90 runtime failure [1]: (insn 70 69 71 (set (reg:DI 143) (leu:DI (reg:DI 139) (const_int 18 [0x12]))) -1 (nil)) (insn 71 70 72 (set (reg:DF 144) (eq:DF (subreg:DF (reg:DI 143) 0) (const_double:DF 0.0 [0x0.0p+0]))) -1 (nil)) (insn 72 71 73 (set (reg:DF 137 [ D.934 ]) (if_then_else:DF (eq (reg:DF 144) (const_double:DF 0.0 [0x0.0p+0])) (reg:DF 137 [ D.934 ]) (reg:DF 140))) -1 (nil)) where (insn 71) trapped with denormal operand FP exception. The problem was in alpha_emit_conditional_move, where fixup code didn't trigger for "code" variable, changed in "if (FLOAT_MODE_P (cmp_mode) != FLOAT_MODE_P (mode))" part. Since cmove insns don't trap on compare, the compare of (insn 71) should be put inside cmove itself. Attached patch updates "cmp" RTX for "code" changes, resulting in: (insn 70 69 71 (set (reg:DI 143) (leu:DI (reg:DI 139) (const_int 18 [0x12]))) -1 (nil)) (insn 71 70 72 (set (reg:DF 137 [ D.934 ]) (if_then_else:DF (ne (subreg:DF (reg:DI 143) 0) (const_double:DF 0.0 [0x0.0p+0])) (reg:DF 137 [ D.934 ]) (reg:DF 140))) -1 (nil)) 2013-08-31 Uros Bizjak * config/alpha/alpha.c (alpha_emit_conditional_move): Update "cmp" RTX before signed_comparison_operator check to account for "code" changes. Patch was tested on alphaev68-pc-linux-gnu and committed to mainline. [1] http://gcc.gnu.org/ml/gcc-testresults/2013-08/msg02997.html Uros. Index: config/alpha/alpha.c =================================================================== --- config/alpha/alpha.c (revision 202125) +++ config/alpha/alpha.c (working copy) @@ -2659,6 +2659,7 @@ alpha_emit_conditional_move (rtx cmp, enum machine cmp_mode = cmp_mode == DImode ? DFmode : DImode; op0 = gen_lowpart (cmp_mode, tem); op1 = CONST0_RTX (cmp_mode); + cmp = gen_rtx_fmt_ee (code, VOIDmode, op0, op1); local_fast_math = 1; }