Intel Fortran 8, bug with trimmed string arguments

From: Pierre Asselin (pa_at_see.signature.invalid)
Date: 03/31/04


Date: Wed, 31 Mar 2004 17:58:43 +0000 (UTC)

Found this apparent bug in the Intel Fortran compiler for Linux when
trying to pass a TRIMmed string as an actual argument. The workaround
is easy enough, just don't do that.

<rant>
    I wasted a couple of hours trying to submit this bug anonymously
    through the Intel web site. I do not wish to register for a
    support account, nor do I want to click "accept" on legal
    boilerplate that I don't understand. I'm just evaluating the
    compiler, I found a probable bug, I want to let Intel know, I
    don't care if they fix it or not and I don't need to hear from
    them.
</rant>

I figured I wouldd just cut'n paste the typescript here. At least
Steve will see it. I just edited the binary garbage near the bottom
to \x escapes.

----------------------------------------------------------------------
Script started on Wed Mar 31 11:57:54 2004
sh-2.05$ cat /proc/version
Linux version 2.4.7-10 (bhcompile@stripples.devel.redhat.com) (gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-98)) #1 Thu Sep 6 16:46:36 EDT 2001
sh-2.05$ rpm -qa | grep glibc
glibc-2.2.4-13
glibc-devel-2.2.4-13
glibc-common-2.2.4-13
sh-2.05$ gcc -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
gcc version 2.96 20000731 (Red Hat Linux 7.2 2.96-108.7.2)
sh-2.05$ rpm -qf $(which ifort)
intel-ifort8-8.0-40
sh-2.05$ echo; cat badstrings.f90; echo

module trivial
contains
  function my_copy(str) result(s)
  implicit none
  character(*), intent(in):: str
  character(len(str)) s
  s= str
  return
  end function my_copy
end module trivial

program boom
  use trivial
  implicit none
  print "('This works: ''',a,'''')", my_copy('coucou')
  print "('this fails: ''',a,'''')", my_copy(trim('coucou'))
end program boom

sh-2.05$ ifort badstrings.f90
sh-2.05$ ./a.out
This works: 'coucou'
this fails: 'd\xf9\xff\xbf^F^@'
sh-2.05$ exit
exit

Script done on Wed Mar 31 11:59:01 2004
----------------------------------------------------------------------

-- 
pa at panix dot com


Relevant Pages

  • Re: 8088 vs. 80c88?
    ... I was always under the impression that when Intel moved to a CMOS ... ignored (bug) in the old 8088s, and was honored in the ... If I run this on my 5160 with "80c88" printed on the chip, ... fix the bug before moving to a CMOS manufacturing process? ...
    (comp.lang.asm.x86)
  • Re: [Bug #13819] system freeze when switching to console
    ... Intel graphics people DID ABSOLUTELY NOTHING about it during ... Reinette had a list of three commits that he used to be able to ... Ling on the cc for his regression reports because of the bisection. ... upstream bug is ...
    (Linux-Kernel)
  • Re: Assembly procedure of mutex wont compile
    ... bug in the Intel assembler reader. ... That might not be a bug, but simply because that is the main operation ... calling convension or optimization settings from breaking assembler code. ... allowed by the Intel syntax, but unfortunately this is one of the ...
    (comp.lang.pascal.misc)
  • Re: Array size by module variables
    ... The code below cause a Segmentation fault using the intel fortran ... It looks like a compiler bug. ... It's disappointing that the Intel compiler has been around for some time now, and yet shows no sign of asymptoting toward being bug free. ...
    (comp.lang.fortran)
  • Re: Computer time - Developer time - User time?
    ... >| this bug is corrected it should not happen to company like ... but it wasn't created by Intel. ... trivial Typo may make a big error. ... made while writing, as well RosAsm Disassembler, as ...
    (alt.lang.asm)