[Bug 228007] math/lapack: switch to flang

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Mon May 7 18:21:37 UTC 2018


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=228007

--- Comment #20 from sgk at troutmask.apl.washington.edu ---
(In reply to robert.ayrapetyan from comment #19)
>
> From the other side, making flang a default compiler on
> certain ports should not break anything, e.g. here is
> armadillo built against mix of flang\gfortran:

Are you sure?  After hacking devel/flang to install.
Simple testing by trying to compile and compile and
run programs from gfortran's testsuite I have found

% cd gfortran.fortran-torture/compile
implicit_1.f90
F90-S-0000-Internal compiler error. create_ref:IM_BASE op#2 not based
  sym     302 (implicit_1.f90: 22)
F90-S-0000-Internal compiler error. size_of: attempt to size assumed
  size character       0  (implicit_1.f90: 31)
  0 inform,   0 warnings,   2 severes, 0 fatal for foo

% cd ../execute
Wrong code generated for data_3.f90, dep_fails.f90, der_io.f90,
  entry_6.f90, forall_3.f90, forall_5.f90, forall_6.f90,
  forall_7.f90, getarg_1.f90, intrinsic_nearest.f90,
  intrinsic_pack.f90, intrinsic_sign.f90, where18.f90,
  where_7.f90, and where_8.f90

This might be a gfortran extension, but I suspect a bug in flang.
entry_2.f90
F90-S-0045-Data type of entry point e4 disagrees with function
f3 (entry_2.f90: 22)
F90-S-0045-Data type of entry point e3 disagrees with function
f3 (entry_2.f90: 21)
  0 inform,   0 warnings,   2 severes, 0 fatal for f3

Code generation bugs
entry_4.f90
/tmp/entry_4-b1e98a.ll:167:14: error: expected '=' after instruction id
        ret void %18, !dbg !35

entry_7.f90
/tmp/entry_7-7901bf.ll:83:52: error: pointers to void are invalid -
  use i8* instead
        %35 = bitcast i64* %__master_entry_rslt346 to void*

entry_8.f90
/tmp/entry_8-25b70f.ll:87:14: error: expected '=' after instruction id
        ret void %24, !dbg !32
                    ^
forall_1.f90
F90-F-0000-Internal compiler error. make_same_idx: illegal forall       2 
(forall_1.f90: 59)

There isn't an internal procedure in this program.  This is a 
bogus error message.
intrinsic_associated.f90
F90-W-0155-END statement for internal procedure should be END SUBROUTINE
(intrinsic_associated.f90: 125)
  0 inform,   1 warnings,   0 severes, 0 fatal for associated_2

Flang does not support the TRAILZ intrinsic
intrinsic_trailz.f90
F90-S-0038-Symbol, trailz, has not been explicitly declared
(intrinsic_trailz.f90
)
  0 inform,   0 warnings,   1 severes, 0 fatal for test_trailz


BTW, FreeBSD's bugzilla is probably a poor place to have a discussion
concerning potential problems with flang.

PS: for those interested more thorough testing see

https://groups.google.com/forum/#!searchin/comp.lang.fortran/flang%7Csort:date/comp.lang.fortran/AIHRQ2kJv3c/0BhngsA-BAAJ

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-fortran mailing list