From 6c47e47db58a72fa83ef6628e00b0ef520d5bb6e Mon Sep 17 00:00:00 2001 From: tobi Date: Tue, 7 Feb 2006 23:52:37 +0000 Subject: libgfortran/ 2006-02-07 Dale Ranta PR fortran/25577 * intrinsics/mvbits.c: Shift '(TYPE)1' type when building 'lenmask'. testsuite/ 2006-02-07 Tobias Schlueter PR fortran/25577 * gfortran.dg/mvbits_1.f90: New. Also fixed Dirk Mueller's preceding ChangeLog entry. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@110728 138bc75d-0d04-0410-961f-82ee72b054a4 --- libgfortran/ChangeLog | 5 +++++ libgfortran/intrinsics/mvbits.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'libgfortran') diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index a48b5d80068..8517787a1a7 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,8 @@ +2006-02-07 Dale Ranta + + PR fortran/25577 + * intrinsics/mvbits.c: Shift '(TYPE)1' type when building 'lenmask'. + 2006-02-07 Rainer Emrich * intrinsics/c99_functions.c: Work around incompatible diff --git a/libgfortran/intrinsics/mvbits.c b/libgfortran/intrinsics/mvbits.c index 6bfb5cad85b..a452fc98b3f 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)); -- cgit v1.2.1