From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23223 invoked by alias); 30 May 2014 08:15:03 -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 23206 invoked by uid 89); 30 May 2014 08:15:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 30 May 2014 08:15:01 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1WqHxn-0004H9-8I from Tom_deVries@mentor.com ; Fri, 30 May 2014 01:14:55 -0700 Received: from SVR-IES-FEM-01.mgc.mentorg.com ([137.202.0.104]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Fri, 30 May 2014 01:14:55 -0700 Received: from [127.0.0.1] (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.2.247.3; Fri, 30 May 2014 09:14:53 +0100 Message-ID: <53883DFB.6040204@mentor.com> Date: Fri, 30 May 2014 08:15:00 -0000 From: Tom de Vries User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Marcus Shawcroft CC: GCC Patches , James Greenhalgh Subject: [AARCH64, PATCH] Fix ICE in aarch64_float_const_representable_p Content-Type: multipart/mixed; boundary="------------070306030406040607040205" X-SW-Source: 2014-05/txt/msg02583.txt.bz2 --------------070306030406040607040205 Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 8bit Content-length: 3251 Marcus, when building for aarch64-linux-gnu with --enable-checking=yes,rtl, I run into the following error: ... In file included from src/libgcc/libgcc2.c:56:0: src/libgcc/libgcc2.c: In function ‘__floattisf’: src/libgcc/libgcc2.h:200:20: internal compiler error: RTL check: expected code 'const_double' and not mode 'VOID', have code 'const_double' and mode 'VOID' in aarch64_float_const_representable_p, at config/aarch64/aarch64.c:8481 #define __NDW(a,b) __ ## a ## ti ## b ^ src/libgcc/libgcc2.h:293:21: note: in expansion of macro ‘__NDW’ #define __floatdisf __NDW(float,sf) ^ src/libgcc/libgcc2.c:1569:14: note: in expansion of macro ‘__floatdisf’ #define FUNC __floatdisf ^ src/libgcc/libgcc2.c:1579:1: note: in expansion of macro ‘FUNC’ FUNC (DWtype u) ^ 0xc1a278 rtl_check_failed_code_mode(rtx_def const*, rtx_code, machine_mode, bool, char const*, int, char const*) src/gcc/rtl.c:833 0x1062b7b aarch64_float_const_representable_p(rtx_def*) src/gcc/config/aarch64/aarch64.c:8481 0x1052ae2 aarch64_rtx_costs src/gcc/config/aarch64/aarch64.c:5003 0x1059a9c aarch64_rtx_costs_wrapper src/gcc/config/aarch64/aarch64.c:5804 0xc38f1a rtx_cost(rtx_def*, rtx_code, int, bool) src/gcc/rtlanal.c:3878 0xb159a9 avoid_expensive_constant src/gcc/optabs.c:1389 0xb15ca9 expand_binop_directly src/gcc/optabs.c:1441 0xb161e7 expand_binop(machine_mode, optab_tag, rtx_def*, rtx_def*, rtx_def*, int, optab_methods) src/gcc/optabs.c:1568 0x87f27f expand_expr_real_2(separate_ops*, rtx_def*, machine_mode, expand_modifier) src/gcc/expr.c:9200 0x87fe4b expand_expr_real_1(tree_node*, rtx_def*, machine_mode, expand_modifier, rtx_def**, bool) src/gcc/expr.c:9388 0x879534 expand_expr_real(tree_node*, rtx_def*, machine_mode, expand_modifier, rtx_def**, bool) src/gcc/expr.c:7921 0x79a720 expand_normal src/gcc/expr.h:471 0x79cdb3 do_jump_by_parts_greater src/gcc/dojump.c:741 0x79b682 do_jump_1(tree_code, tree_node*, tree_node*, rtx_def*, rtx_def*, int) src/gcc/dojump.c:280 0x79a8ce jumpifnot_1(tree_code, tree_node*, tree_node*, rtx_def*, int) src/gcc/dojump.c:138 0x700de4 expand_gimple_cond src/gcc/cfgexpand.c:2145 0x70ed7f expand_gimple_basic_block src/gcc/cfgexpand.c:5063 0x71189c execute src/gcc/cfgexpand.c:5803 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See for instructions. ... We assert here during REAL_VALUE_FROM_CONST_DOUBLE because x has VOIDmode, which means it has integer rather than floating point type: ... bool aarch64_float_const_representable_p (rtx x) { /* This represents our current view of how many bits make up the mantissa. */ int point_pos = 2 * HOST_BITS_PER_WIDE_INT - 1; int exponent; unsigned HOST_WIDE_INT mantissa, mask; REAL_VALUE_TYPE r, m; bool fail; if (!CONST_DOUBLE_P (x)) return false; REAL_VALUE_FROM_CONST_DOUBLE (r, x); ... Attached patch fixes the ICE by handling the case that x is VOIDmode, and allows me to complete the build. OK for trunk if build and test succeeds? I think the call site in aarch64_rtx_costs may need a separate fix. Thanks, - Tom --------------070306030406040607040205 Content-Type: text/x-patch; name="0007-Fix-ICE-in-aarch64_float_const_representable_p.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0007-Fix-ICE-in-aarch64_float_const_representable_p.patch" Content-length: 687 2014-05-30 Tom de Vries * config/aarch64/aarch64.c (aarch64_float_const_representable_p): Handle case that x has VOIDmode. --- gcc/config/aarch64/aarch64.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 4ece0c6..ce0e7dc 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -8478,6 +8478,9 @@ aarch64_float_const_representable_p (rtx x) if (!CONST_DOUBLE_P (x)) return false; + if (GET_MODE (x) == VOIDmode) + return false; + REAL_VALUE_FROM_CONST_DOUBLE (r, x); /* We cannot represent infinities, NaNs or +/-zero. We won't -- 1.9.1 --------------070306030406040607040205--