This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/35223] IBITS gives compiler error



------- 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.

Also from my read of the standard the ibits is extracting bits from (in this
case) a 32 bit integer interpreted as unsigned since it just looks at bits and
the result is plugging the resulting 32 bits back into a signed 32 bit word. 
The key to this is interpreting the plugging back in to treat the receiving
words sign bit as one of those 32 bits or not.

"This model is valid only in the context of the use of such an object as the
argument or result of one of the bit manipulation procedures."

I think Steve has a good point.  I also think that the result is type integer
with a sequence of bits fitting the model of 13.3 mapped into the model for
13.4 if used in a numerical context, in this case WRITEing an integer.

So I support removing the range check just for these bit manipulation
procedures.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35223


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]