Closed ryofurue closed 3 years ago
There's a couple files missing when I tried to reproduce this locally:
fix-track-partials-00.f90:106: Error: Can't open included file 'extend_arr.inc'
Could you post them too?
The internal compiler error is very likely an upstream issue, but I'll try reproduce and confirm that first (since the GCC formula does indeed point to this issue tracker as the first port of call).
Thank you for your prompt response!
The internal compiler error is very likely an upstream issue
Right. I wondered why Homebrew wants to hear about an internal compiler error . . .
Can't open included file 'extend_arr.inc'
My bad! Here they are:
$ cat extend_arr.inc
! This is a template. Supply lines !@@@@
! If idx > size(arr), extend arr so that it can accomodate
! at least idx elements in total.
! If idx <= size(arr), do nothing.
!@@@@ subroutine extend_arr_T(arr, idx, mes)
!@@@@ type(T), allocatable, intent(inout):: arr(:)
!@@@@ type(T), allocatable:: tmp(:)
integer, intent(in) :: idx
character(*), intent(in), optional :: mes
integer, parameter:: ndefault = 128
integer:: n, nnew
if (.not.allocated(arr)) then
allocate(arr(ndefault))
if (present(mes)) &
write(*,"(*(1X,g0))") trim(mes)//": initial allocation", ndefault
end if
do
n = size(arr)
if (idx <= n) return
allocate(tmp(n))
tmp = arr
deallocate(arr)
nnew = n*2
allocate(arr(nnew))
arr(1:n) = tmp
deallocate(tmp)
if (present(mes)) &
write(*,"(*(1X,g0))") trim(mes)//":", n, "to", nnew
end do
!@@@@ end subroutine extend_arr_T
$
$ cat shrink_arr.inc
! This is a template. Supply lines !@@@@
!@@@@ subroutine shrink_arr_T(arr, idx, mes)
!@@@@ type(T), allocatable, intent(inout):: arr(:)
!@@@@ type(T), allocatable:: tmp(:)
integer, intent(in) :: idx
character(*), intent(in), optional :: mes
integer:: n
if (.not.allocated(arr)) then
if (present(mes)) &
write(*,"(*(1X,g0))") trim(mes)//": not allocated. Doing nothing."
return
end if
if (idx <= 0) then
deallocate(arr)
allocate(arr(0))
if (present(mes)) &
write(*,"(*(1X,g0))") trim(mes)//": shrunk to 0 ."
return
end if
n = size(arr)
allocate(tmp(idx))
tmp = arr(1:idx)
deallocate(arr)
allocate(arr(1:idx))
arr = tmp
deallocate(tmp)
if (present(mes)) &
write(*,"(*(1X,g0))") trim(mes)//": shrunk from", n, "to", idx
!@@@@ end subroutine shrunk_arr_T
$
Thanks! I'm able to reproduce the issue on Ubuntu's GCC as well.
I recommend opening an upstream issue about this: https://gcc.gnu.org/bugs/. You can mention that it's reproducible with both Homebrew and Ubuntu's GCC.
I wondered why Homebrew wants to hear about an internal compiler error . . .
I think it's just in case we ship our own modificiations/patches, and it's those changes which have broken things. In reality, the patches we do on macOS are minimal and almost always have already been submitted upstream first. There's even times we don't have any patches at all.
Apple Silicon (arm64) is different. That GCC build is heavily modified (based on a fork) to support Apple Silicon and issues with that should definitely not go upstream. But that doesn't apply here since we're talking about x86_64
.
To maximise the likelihood that your bug report is addressed, you might want to reduce the error into a minimal working example.
brew gist-logs <formula>
link ORbrew config
ANDbrew doctor
outputbrew gist-logs gcc
says "Error: No logs."brew config
HOMEBREW_VERSION: 3.0.5 ORIGIN: https://github.com/Homebrew/brew HEAD: 8b677c0ddd5f96b5521c1b353a9ca07dfe57b80e Last commit: 16 hours ago Core tap ORIGIN: https://github.com/Homebrew/homebrew-core Core tap HEAD: 6d37897a2fae25bf3ce7ca012be597618805f7d6 Core tap last commit: 6 hours ago Core tap branch: master HOMEBREW_PREFIX: /usr/local HOMEBREW_CASK_OPTS: [] HOMEBREW_DISPLAY: /private/tmp/com.apple.launchd.47wXew6Nqa/org.xquartz:0 HOMEBREW_MAKE_JOBS: 8 Homebrew Ruby: 2.6.3 => /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3_2/bin/ruby CPU: octa-core 64-bit kabylake Clang: 12.0 build 1200 Git: 2.30.2 => /usr/local/bin/git Curl: 7.64.1 => /usr/bin/curl macOS: 11.2.3-x86_64 CLT: 12.4.0.0.1.1610135815 Xcode: N/A XQuartz: 2.7.11 => /opt/X11brew doctor
Your system is ready to brew.brew doctor
above contains no "Warning" lines.What were you trying to do (and why)?
I'm trying to compile a Fortran program.
What happened (include all command output)?
An "internal compiler error" occurs:
The dollar symbol above is the command prompt.
What did you expect to happen?
N/A
Step-by-step reproduction instructions (by running
brew
commands)gfortran
comes with Homebrew'sgcc
package. The step-by-step instructions are included in the "What happened" section of this report.I don't know how to attach my Fortran source programs. So, I'll paste all of them.