From patchwork Sun May 15 19:34:34 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 95662 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 AD951B6EF0 for ; Mon, 16 May 2011 05:34:53 +1000 (EST) Received: (qmail 2488 invoked by alias); 15 May 2011 19:34:50 -0000 Received: (qmail 1935 invoked by uid 22791); 15 May 2011 19:34:49 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RFC_ABUSE_POST, TW_ZJ, T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-pz0-f47.google.com (HELO mail-pz0-f47.google.com) (209.85.210.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 15 May 2011 19:34:35 +0000 Received: by pzk36 with SMTP id 36so2083963pzk.20 for ; Sun, 15 May 2011 12:34:34 -0700 (PDT) MIME-Version: 1.0 Received: by 10.142.78.12 with SMTP id a12mr2401908wfb.268.1305488074640; Sun, 15 May 2011 12:34:34 -0700 (PDT) Received: by 10.143.158.12 with HTTP; Sun, 15 May 2011 12:34:34 -0700 (PDT) Date: Sun, 15 May 2011 21:34:34 +0200 Message-ID: Subject: [PATCH, i386]: standard_80387_constant_p can return negative values From: Uros Bizjak To: gcc-patches@gcc.gnu.org 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 Hello! 2011-05-15 Uros Bizjak * config/i386/i386.md (floating point move splitters): Fix usage of standard_80387_constant_p. * config/i386/i386.c (ix86_preferred_reload_class): Ditto. Tested on x86_64-pc-linux-gnu {,-m32}, committed to mainline SVN. Uros. Index: i386.md =================================================================== --- i386.md (revision 173773) +++ i386.md (working copy) @@ -3315,7 +3315,7 @@ } else if (FP_REG_P (r)) { - if (!standard_80387_constant_p (c)) + if (standard_80387_constant_p (c) < 1) FAIL; } else if (MMX_REG_P (r)) @@ -3347,7 +3347,7 @@ } else if (FP_REG_P (r)) { - if (!standard_80387_constant_p (c)) + if (standard_80387_constant_p (c) < 1) FAIL; } else if (MMX_REG_P (r)) Index: i386.c =================================================================== --- i386.c (revision 173771) +++ i386.c (working copy) @@ -28489,7 +28489,7 @@ ix86_preferred_reload_class (rtx x, reg_ zero above. We only want to wind up preferring 80387 registers if we plan on doing computation with them. */ if (TARGET_80387 - && standard_80387_constant_p (x)) + && standard_80387_constant_p (x) > 0) { /* Limit class to non-sse. */ if (regclass == FLOAT_SSE_REGS)