From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19267 invoked by alias); 3 Aug 2007 14:45:20 -0000 Received: (qmail 19162 invoked by uid 22791); 3 Aug 2007 14:45:19 -0000 X-Spam-Check-By: sourceware.org Received: from nz-out-0506.google.com (HELO nz-out-0506.google.com) (64.233.162.225) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 03 Aug 2007 14:45:16 +0000 Received: by nz-out-0506.google.com with SMTP id s1so368049nze for ; Fri, 03 Aug 2007 07:45:15 -0700 (PDT) Received: by 10.142.107.1 with SMTP id f1mr137148wfc.1186152314544; Fri, 03 Aug 2007 07:45:14 -0700 (PDT) Received: by 10.142.99.11 with HTTP; Fri, 3 Aug 2007 07:45:09 -0700 (PDT) Message-ID: Date: Fri, 03 Aug 2007 14:45:00 -0000 From: "Andrew Pinski" To: gcc-patches Subject: [PATCH] FIx PR midde-end/32935 ICE in emit_move_insn due to fold producing type mismatch with negative and fp MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_79986_4606867.1186152309515" X-IsSubscribed: yes 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 X-SW-Source: 2007-08/txt/msg00180.txt.bz2 ------=_Part_79986_4606867.1186152309515 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline Content-length: 647 Hi, The problem here is that fold strips off the floating point extensions but then does not convert the negative expression back to the original type which causes a type mismatch. This causes either an ICE with the extra checking Richard Guenther added or an ICE in emit_move_insn. This patch here adds a fold_convert to convert to the correct type after the negate expression. OK? Bootstrapped and tested on i686-apple-darwin8.10 with no regressions. Thanks, Andrew Pinski * fold-convert.c (fold_negate_expr ): Convert back to the correct type the negate expression. * gfortran.fortran-torture/compile/complex_1.f90: New test ------=_Part_79986_4606867.1186152309515 Content-Type: text/plain; name="fixpr32935.diff.txt" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="fixpr32935.diff.txt" X-Attachment-Id: f_c9d34v Content-length: 1074 SW5kZXg6IGZvbGQtY29uc3QuYwo9PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0t LSBmb2xkLWNvbnN0LmMJKHJldmlzaW9uIDEyNzE3NikKKysrIGZvbGQtY29u c3QuYwkod29ya2luZyBjb3B5KQpAQCAtMTM4Miw3ICsxMzgyLDcgQEAgZm9s ZF9uZWdhdGVfZXhwciAodHJlZSB0KQogCXsKIAkgIHRlbSA9IHN0cmlwX2Zs b2F0X2V4dGVuc2lvbnMgKHQpOwogCSAgaWYgKHRlbSAhPSB0ICYmIG5lZ2F0 ZV9leHByX3AgKHRlbSkpCi0JICAgIHJldHVybiBuZWdhdGVfZXhwciAodGVt KTsKKwkgICAgcmV0dXJuIGZvbGRfY29udmVydCAodHlwZSwgbmVnYXRlX2V4 cHIgKHRlbSkpOwogCX0KICAgICAgIGJyZWFrOwogCkluZGV4OiB0ZXN0c3Vp dGUvZ2ZvcnRyYW4uZm9ydHJhbi10b3J0dXJlL2NvbXBpbGUvY29tcGxleF8x LmY5MAo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSB0ZXN0c3VpdGUvZ2Zv cnRyYW4uZm9ydHJhbi10b3J0dXJlL2NvbXBpbGUvY29tcGxleF8xLmY5MAko cmV2aXNpb24gMCkKKysrIHRlc3RzdWl0ZS9nZm9ydHJhbi5mb3J0cmFuLXRv cnR1cmUvY29tcGlsZS9jb21wbGV4XzEuZjkwCShyZXZpc2lvbiAwKQpAQCAt MCwwICsxLDUgQEAKK3Byb2dyYW0gdGVzdF9nZm9ydHJhbjIKKyBDb21wbGV4 KDgpIDo6IGcsIHpoCisgUmVhbCg4KSAgICA6OiBnX3EKKyBnID0gICB6aCAt IHpoL2NtcGx4KDAuMF84LC1nX3EpCitlbmQK ------=_Part_79986_4606867.1186152309515--