From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17654 invoked by alias); 3 Feb 2015 13:01:16 -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 17633 invoked by uid 89); 3 Feb 2015 13:01:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pa0-f43.google.com Received: from mail-pa0-f43.google.com (HELO mail-pa0-f43.google.com) (209.85.220.43) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 03 Feb 2015 13:01:05 +0000 Received: by mail-pa0-f43.google.com with SMTP id eu11so96008811pac.2 for ; Tue, 03 Feb 2015 05:01:03 -0800 (PST) X-Received: by 10.66.218.104 with SMTP id pf8mr38189564pac.140.1422968463457; Tue, 03 Feb 2015 05:01:03 -0800 (PST) Received: from [192.168.2.74] (76-253-1-90.lightspeed.sntcca.sbcglobal.net. [76.253.1.90]) by mx.google.com with ESMTPSA id po4sm2151739pdb.85.2015.02.03.05.00.59 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 03 Feb 2015 05:01:02 -0800 (PST) References: <54D0B797.4030909@arm.com> Mime-Version: 1.0 (1.0) In-Reply-To: <54D0B797.4030909@arm.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Message-Id: <0B146B8C-56A8-4BA4-ABB6-98029F494F71@gmail.com> Cc: "gcc-patches@gcc.gnu.org" From: pinskia@gmail.com Subject: Re: [PATCH/AARCH64] Fix 64893: ICE with vget_lane_u32 with C++ front-end at -O0 Date: Tue, 03 Feb 2015 13:01:00 -0000 To: Alan Lawrence X-IsSubscribed: yes X-SW-Source: 2015-02/txt/msg00133.txt.bz2 > On Feb 3, 2015, at 3:57 AM, Alan Lawrence wrote: >=20 >=20 > Andrew Pinski wrote: >> While trying to build the GCC 5 with GCC 5, I ran into an ICE when >> building libcpp at -O0. The problem is the C++ front-end was not >> folding sizeof(a)/sizeof(a[0]) when passed to a function at -O0. The >> C++ front-end keeps around sizeof until the gimplifier and there is no >> way to fold the expressions that involve them. So to work around the >> issue we need to change __builtin_aarch64_im_lane_boundsi to accept an >> extra argument and change the first two arguments to size_t type so we >> don't get an extra cast there and do the division inside the compiler >> itself. >> Also we don't want to cause an ICE on any source code so I changed the >> assert to be a sorry if either of the two arguments are not integer >> constants. >=20 > TBH I think it _is_ appropriate to ICE rather than sorry, or even error, = if the size of the vector or vector elements are non-constant or zero. All = the calls to this __builtin are in gcc-specific headers, and if those are w= rong, then the error is in(ternal to) the compiler. (Of course if the lane = index is non-constant that is a programmer error.) We don't wish to support= the programmer writing direct calls to the builtin him/herself! Even if we don't support direct calls to it, it still should not ice. This = is gcc policy for a long time now. Iceing on any input is bad form and not= helpful to users. We can say in the error message that calling it direct i= s not supported and they should not do it.=20 Thanks, Andrew >=20 > --Alan >=20 >=20 >> OK? Bootstrapped and tested on aarch64-linux-gnu with no regressions >> and I was able to bootstrap without a modified libcpp. >> Thanks, >> Andrew Pinski >> ChangeLog: >> * config/aarch64/aarch64-builtins.c (aarch64_init_simd_builti= ns): >> Change the first argument type to size_type_node and add anot= her >> size_type_node. >> (aarch64_simd_expand_builtin): Handle the new argument to >> AARCH64_SIMD_BUILTIN_LANE_CHECK and don't ICE but rather >> print sorry out when the first two arguments are not >> integer constants. >> * config/aarch64/arm_neon.h (__AARCH64_LANE_CHECK): >> Pass the sizeof's directly to __builtin_aarch64_im_lane_bound= si. >> testsuite/ChangeLog: >> * c-c++-common/torture/aarch64-vect-lane-1.c: New testcase. >=20 >=20