From patchwork Thu Jun 20 18:11:29 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 253054 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 88BDA2C007B for ; Fri, 21 Jun 2013 04:11:51 +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=cSzPrKTxSGAisHaSk3kgD4IHCZnoTVDd0g9PSPBhG6A9Fe KFb/Y9ojHyRsKRmM3OB4LLP4yYdyZ+5w1ddJk1omYeWeNDcz8XXQgyuOFLxVk4z3 ilDQpskUWq+xcS9FYA8kigN9NoeDqewtLIHs2krCTr9pGL/aIy5bDuNI6065w= 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=wgsGqfbMqNg11Bm8Oa+fnLS/YDM=; b=rKNBYusZrUMVHWkH8Hia Q/WiESm7ef2i6ZXNZqHmVXHiGeDELFMkIQxU8Ds+5yOS71LAYv68XaazAnkvJj7n kPXTu59uNrvcEo5I204HO21ITpU8+xXjL8R1qOtNfQaKsbj+kyWEgfdxngWwhTqx C/1HkeX+Yiv+J90A/QHg9cw= Received: (qmail 4689 invoked by alias); 20 Jun 2013 18:11:46 -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 4658 invoked by uid 89); 20 Jun 2013 18:11:45 -0000 X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, SPF_PASS, TW_AV, TW_MV, TW_VZ, TW_ZJ autolearn=ham version=3.3.1 Received: from mail-ob0-f182.google.com (HELO mail-ob0-f182.google.com) (209.85.214.182) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Thu, 20 Jun 2013 18:11:31 +0000 Received: by mail-ob0-f182.google.com with SMTP id va7so7477978obc.41 for ; Thu, 20 Jun 2013 11:11:29 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.60.52.67 with SMTP id r3mr4938261oeo.25.1371751889764; Thu, 20 Jun 2013 11:11:29 -0700 (PDT) Received: by 10.182.52.234 with HTTP; Thu, 20 Jun 2013 11:11:29 -0700 (PDT) Date: Thu, 20 Jun 2013 20:11:29 +0200 Message-ID: Subject: [PATCH, i386]: Fix PR57655, ICE: in create_pre_exit, at mode-switching.c:418 From: Uros Bizjak To: "gcc-patches@gcc.gnu.org" X-Virus-Found: No Hello! x86_64 ABI mandates long double returns in x87 register, so it is invalid to use --mno-fp-ret-in-387. It just happened that vzeroupper insertion mode-switching pass tripped on invalid register usage. 2013-06-20 Uros Bizjak PR target/57655 * config/i386/i386.c (construct_container): Report error if long double is used with disabled x87 float returns. testsuite/ChangeLog: 2013-06-20 Uros Bizjak PR target/57655 * gcc.target/i386/pr57655.c: New test. Patch was tested on x86_64-pc-linux-gnu {,-m32} and was committed to mainline SVN. The patch will be backported to all release branches. Uros. Index: config/i386/i386.c =================================================================== --- config/i386/i386.c (revision 200247) +++ config/i386/i386.c (working copy) @@ -6498,7 +6498,7 @@ construct_container (enum machine_mode mode, enum /* Likewise, error if the ABI requires us to return values in the x87 registers and the user specified -mno-80387. */ - if (!TARGET_80387 && in_return) + if (!TARGET_FLOAT_RETURNS_IN_80387 && in_return) for (i = 0; i < n; i++) if (regclass[i] == X86_64_X87_CLASS || regclass[i] == X86_64_X87UP_CLASS Index: testsuite/gcc.target/i386/pr57655.c =================================================================== --- testsuite/gcc.target/i386/pr57655.c (revision 0) +++ testsuite/gcc.target/i386/pr57655.c (working copy) @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-options "-mavx -mvzeroupper -mno-fp-ret-in-387" } + +/* { dg-error "x87 register return with x87 disabled" "" { target { ! ia32 } } 8 } */ + +long double +foo (long double x) +{ + return __builtin_ilogbl (x); +}