From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24404 invoked by alias); 17 Feb 2008 19:59:56 -0000 Received: (qmail 24283 invoked by alias); 17 Feb 2008 19:59:13 -0000 Date: Sun, 17 Feb 2008 19:59:00 -0000 Message-ID: <20080217195913.24282.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/35223] IBITS gives compiler error In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "sgk at troutmask dot apl dot washington dot edu" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-02/txt/msg01935.txt.bz2 ------- Comment #11 from sgk at troutmask dot apl dot washington dot edu 2008-02-17 19:59 ------- Subject: Re: IBITS gives compiler error On Sun, Feb 17, 2008 at 07:10:19PM -0000, jvdelisle at gcc dot gnu dot org wrote: > ------- Comment #9 from jvdelisle at gcc dot gnu dot org 2008-02-17 19:10 ------- > We do need to fix some things here. The runtime perhaps should catch the > invalid of pos + len > 32 for bit_size being 32. > (snip) > So I support removing the range check just for these bit manipulation > procedures. Yes, that is probably a good compromise, then let the middle-end deal with possible out of range values. One probably needs to check the expansion of i = -1 i = ibits(i,0,32) -fdump-tree-original shows i = -1; i = i >> 0 & ~(-1 << 32); for the above, which of course gives the user desired result of -1. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35223