https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96859
--- Comment #8 from Steve Kargl <sgk at troutmask dot apl.washington.edu> --- On Tue, Sep 01, 2020 at 12:52:49PM +0000, jakub at gcc dot gnu.org wrote: > > --- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> --- > I think this boils down to: > program foo > print *, int(o'1234567',2), int(o'1234567',4) > end program foo > I believe ifort prints > 14711 342391 > while gfortran prints > -18057 342391 > Since 01234567 in C is 0x53977, after that is cast to 16-bit integer that > should be 0x3977 and thus 14711. > The Fortran standard states how the BOZ string of bits is padded or truncated if it contains too few or too many bits. See F2018, 16.3.3. Also no that the handling of the sign bit is processor dependent. -- Steve