This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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]

Re: Kind of constants in generic intrinsics


On Sat, Dec 17, 2005 at 03:02:18AM +0100, Tobias Schl?ter wrote:
> Steve Kargl wrote:
> > This is essential what gfortran is doing. -fdump-parse-tree shows
> > 
> >       ASSIGN MAIN__:a 4294967295
> >       ASSIGN MAIN__:b 4294967295_8
> 
> FWIW this is wrong.  This should be
>  ASSIGN MAIN__:a -1
>  ASSIGN MAIN__:b -1_8
> as the bit sequence resulting from NOT(0) should be converted back to default
> integer, i.e. -1_4 before any further arithmetic is done during constant
> folding (NB this can't be right because 4294967295 is not a valid value for an
> INTEGER*4).  We seem to be missing a call to twos_complement() in
> gfc_simplify_not, and probably in the simplification of other bit operation
> intrinsics, too.
> 

I have a one line patch that fixes this.  Thanks for the hint, Tobi.

-- 
Steve


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