[LLVMbugs] [Bug 9754] New: GCC frontend generates symbols that are not (but likely needed to be) resolved in backend

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Apr 19 14:51:07 PDT 2011


http://llvm.org/bugs/show_bug.cgi?id=9754

           Summary: GCC frontend generates symbols that are not (but
                    likely needed to be) resolved in backend
           Product: dragonegg
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: New Bugs
        AssignedTo: baldrick at free.fr
        ReportedBy: maemarcus at gmail.com
                CC: llvmbugs at cs.uiuc.edu


===============================
Consider the following example:
===============================

program builtin

integer :: i

do i = 1, 10
  print *, EXP(CMPLX(0.0E+0, ATAN(FLOAT(i))))
enddo

end program builtin

=====================================================
Note code uses complex exponent on fp data.
Now, gcc will succeed to compile and dragonegg fails:
=====================================================

[marcusmae at T61p builtin]$ make
dragonegg-gfortran-orig builtin.f90 -o builtin.gcc
dragonegg-gfortran-orig -fplugin=/opt/llvm/dragonegg/lib64/dragonegg.so
builtin.f90 -o builtin.dragonegg
/tmp/ccLVkP8P.o: In function `MAIN__':
builtin.f90:(.text+0x1b0): undefined reference to `cexpif'
collect2: ld returned 1 exit status
make: *** [dragonegg] Error 1

=========================================================================
The reason of dragonegg failure is presence of cexpif symbol, that is not
defined anywhere and is completely internal to gfortran:
=========================================================================

gcc/builtins.def:DEF_GCC_BUILTIN        (BUILT_IN_CEXPIF, "cexpif",
BT_FN_COMPLEX_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING)

gcc/fortran/f95-lang.c:      gfc_define_builtin ("__builtin_cexpif",
func_float_cfloat,

===========================================================================
I don't understand how, but gfortran eliminates this symbol from generated
object file, while in case of dragonegg it can be found in object and ruins
linking:
===========================================================================

[marcusmae at T61p builtin]$ nm builtin.gcc | grep cexpif

[marcusmae at T61p builtin]$ dragonegg-gfortran-orig -c
-fplugin=/opt/llvm/dragonegg/lib64/dragonegg.so builtin.f90
[marcusmae at T61p builtin]$ nm builtin.o | grep cexpif
                 U cexpif

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list