From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 92615 invoked by alias); 23 Nov 2015 23:09:26 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 92596 invoked by uid 89); 23 Nov 2015 23:09:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-lf0-f41.google.com Received: from mail-lf0-f41.google.com (HELO mail-lf0-f41.google.com) (209.85.215.41) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 23 Nov 2015 23:09:24 +0000 Received: by lfaz4 with SMTP id z4so123087733lfa.0 for ; Mon, 23 Nov 2015 15:09:21 -0800 (PST) X-Received: by 10.25.1.205 with SMTP id 196mr9753424lfb.21.1448320161278; Mon, 23 Nov 2015 15:09:21 -0800 (PST) Received: from [192.168.123.200] ([77.41.78.126]) by smtp.googlemail.com with ESMTPSA id e9sm2169675lbs.13.2015.11.23.15.09.20 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 23 Nov 2015 15:09:20 -0800 (PST) Message-ID: <56539C9F.9000903@gmail.com> Date: Mon, 23 Nov 2015 23:20:00 -0000 From: Mikhail Maltsev User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.8.0 MIME-Version: 1.0 To: gcc-patches mailing list , Uros Bizjak , Jeff Law Subject: [PATCH, i386] PR68497. Fix ICE with -fno-checking Content-Type: multipart/mixed; boundary="------------020802080509080409060703" X-IsSubscribed: yes X-SW-Source: 2015-11/txt/msg02807.txt.bz2 This is a multi-part message in MIME format. --------------020802080509080409060703 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-length: 603 Hi! The attached patch fixes a problem introduced in r229567: the assertion gcc_assert (is_sse); is checked if flag_checking is false, and this causes an ICE when compiling with -fno-checking. Bootstrapped and regtested on x86_64-pc-linux-gnu. OK for trunk? -- Regards, Mikhail Maltsev gcc/ChangeLog: 2015-11-23 Mikhail Maltsev PR target/68497 * config/i386/i386.c (output_387_binary_op): Fix assertion for -fno-checking case. gcc/testsuite/ChangeLog: 2015-11-23 Mikhail Maltsev PR target/68497 * gcc.target/i386/pr68497.c: New test. --------------020802080509080409060703 Content-Type: text/x-patch; name="pr68497.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="pr68497.patch" Content-length: 1715 diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 83749d5..23dbb3a 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -17675,18 +17675,20 @@ output_387_binary_op (rtx insn, rtx *operands) /* Even if we do not want to check the inputs, this documents input constraints. Which helps in understanding the following code. */ - if (flag_checking - && STACK_REG_P (operands[0]) - && ((REG_P (operands[1]) - && REGNO (operands[0]) == REGNO (operands[1]) - && (STACK_REG_P (operands[2]) || MEM_P (operands[2]))) - || (REG_P (operands[2]) - && REGNO (operands[0]) == REGNO (operands[2]) - && (STACK_REG_P (operands[1]) || MEM_P (operands[1])))) - && (STACK_TOP_P (operands[1]) || STACK_TOP_P (operands[2]))) - ; /* ok */ - else - gcc_checking_assert (is_sse); + if (flag_checking) + { + if (STACK_REG_P (operands[0]) + && ((REG_P (operands[1]) + && REGNO (operands[0]) == REGNO (operands[1]) + && (STACK_REG_P (operands[2]) || MEM_P (operands[2]))) + || (REG_P (operands[2]) + && REGNO (operands[0]) == REGNO (operands[2]) + && (STACK_REG_P (operands[1]) || MEM_P (operands[1])))) + && (STACK_TOP_P (operands[1]) || STACK_TOP_P (operands[2]))) + ; /* ok */ + else + gcc_assert (is_sse); + } switch (GET_CODE (operands[3])) { diff --git a/gcc/testsuite/gcc.target/i386/pr68497.c b/gcc/testsuite/gcc.target/i386/pr68497.c new file mode 100644 index 0000000..0135cda --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr68497.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-options "-fno-checking" } */ + +long double +foo (long double x, long double y) +{ + return x + y; +} --------------020802080509080409060703--