This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/35223] IBITS gives compiler error
- From: "sgk at troutmask dot apl dot washington dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Feb 2008 19:59:13 -0000
- Subject: [Bug fortran/35223] IBITS gives compiler error
- References: <bug-35223-15443@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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