diff options
author | Tobias Schlüter <tobi@gcc.gnu.org> | 2006-02-08 00:52:37 +0100 |
---|---|---|
committer | Tobias Schlüter <tobi@gcc.gnu.org> | 2006-02-08 00:52:37 +0100 |
commit | 43ff4e9aa3075d4eab3c74b4bc510a9cde17c313 (patch) | |
tree | c0cfce55af07acbfb42d18f9f151fc9d70659377 /libgfortran/intrinsics/mvbits.c | |
parent | 23fca1f58766f4095fb3f889433de3f5552681f1 (diff) | |
download | gcc-43ff4e9aa3075d4eab3c74b4bc510a9cde17c313.zip gcc-43ff4e9aa3075d4eab3c74b4bc510a9cde17c313.tar.gz gcc-43ff4e9aa3075d4eab3c74b4bc510a9cde17c313.tar.bz2 |
re PR libfortran/25577 (gfortran routine mvbits returns wrong answer.)
libgfortran/
2006-02-07 Dale Ranta <dir@lanl.gov>
PR fortran/25577
* intrinsics/mvbits.c: Shift '(TYPE)1' type when building 'lenmask'.
testsuite/
2006-02-07 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
PR fortran/25577
* gfortran.dg/mvbits_1.f90: New.
Also fixed Dirk Mueller's preceding ChangeLog entry.
From-SVN: r110728
Diffstat (limited to 'libgfortran/intrinsics/mvbits.c')
-rw-r--r-- | libgfortran/intrinsics/mvbits.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libgfortran/intrinsics/mvbits.c b/libgfortran/intrinsics/mvbits.c index 6bfb5ca..a452fc9 100644 --- a/libgfortran/intrinsics/mvbits.c +++ b/libgfortran/intrinsics/mvbits.c @@ -1,5 +1,5 @@ /* Implementation of the MVBITS intrinsic - Copyright (C) 2004 Free Software Foundation, Inc. + Copyright (C) 2004, 2006 Free Software Foundation, Inc. Contributed by Tobias Schlüter This file is part of the GNU Fortran 95 runtime library (libgfortran). @@ -48,7 +48,7 @@ SUB_NAME (const TYPE *from, const GFC_INTEGER_4 *frompos, { TYPE oldbits, newbits, lenmask; - lenmask = (*len == sizeof (TYPE)*8) ? ~(TYPE)0 : (1 << *len) - 1; + lenmask = (*len == sizeof (TYPE)*8) ? ~(TYPE)0 : ((TYPE)1 << *len) - 1; newbits = (((UTYPE)(*from) >> *frompos) & lenmask) << *topos; oldbits = *to & (~(lenmask << *topos)); |