IBM/Absoft bug on Mac OS-X

From: David Sagan (dcs16_at_cornell.dot.edu)
Date: 03/07/05


Date: Mon, 07 Mar 2005 10:02:46 -0500

Hello:

I have run across a bug using the IBM and Absoft compilers (the latest
versions) on Mac OS-X (10.3) and I am wondering whether anyone else
knows anything about this. To see the bug consider the following test
files:

!-------------------------------
! This is a file: test_mod.f

module test_mod

type my_struct
   integer :: iii = 27
endtype
type (my_struct), save :: my

contains

subroutine test_in_mod
   print *, 'In Module:', my%iii
end subroutine

end module
!-------------------------------

!-------------------------------
! This is a file: test.f

program test
   use test_mod
   implicit none
   print *, 'In Main:', my%iii
! call test_in_mod
end program
!-------------------------------

The bug appears when test_mod.f is put in a library and test.f is linked
against it:

mc66:~/Bmad/bmad_dist/bug_lib_ibm> xlf90 -c test_mod.f
** test_mod === End of Compilation 1 ===
1501-510 Compilation successful for file test_mod.f.

mc66:~/Bmad/bmad_dist/bug_lib_ibm> ar -r libtest_mod.a test_mod.o

mc66:~/Bmad/bmad_dist/bug_lib_ibm> ranlib libtest_mod.a

mc66:~/Bmad/bmad_dist/bug_lib_ibm> xlf90 test.f -L. -ltest_mod
** test === End of Compilation 1 ===
1501-510 Compilation successful for file test.f.

mc66:~/Bmad/bmad_dist/bug_lib_ibm> ./a.out
  In Main: 0

This is wrong. Uncommenting out the "call test_in_mod" makes the program
produce the correct result. Someone in my lab suspects that it is due to
the ld loader. Anyone have any information on this?

               -- Thanks, David



Relevant Pages

  • Re: VS2005 major development bug
    ... Crashing during compilation would mean then compiler to throw an ICE, but that's surely not the case. ... But I don't want to be pedantic and this has nothing to do with the problem / bug we are discussing in this thread about. ... Managed C++ was to make the pimpl class a nested class of the ref class and pass a pointer of the ref class to the pimpl class. ... A nested class seems not to be allowed anymore to access private members of a managed class. ...
    (microsoft.public.dotnet.languages.vc)
  • Re: statically compiled files left over after a make world
    ... The bug did ... bootstrap the compilation of the various loadable modules. ... would gain the attacker nothing more than he could gain by simply ...
    (FreeBSD-Security)
  • Re: Signed zeros: is this a bug?
    ... Looks to me like you've found a bug with the parser/compiler: ... appear within the same "unit of compilation" (expression, function, ... errant "peephole optimizer" pass which tries to roll multiple ...
    (comp.lang.python)
  • Re: Warning on migrating to ATMega8515 - eeprom problem
    ... >> Yes, probably a bug, but it is questionable if it is serious. ... >> It is generally a good practice to avoid relying on reset values. ... Conditional compilation is one way. ... You can thus run the compiled result of the same source code on both CPUs ...
    (comp.arch.embedded)
  • Re: CVF bug ?
    ... | I The same bug exists for ordinary allocatable arrays. ... | allocate ) ... CVF gets all your examples right. ...
    (comp.lang.fortran)