From: Jorge D'Elia <jdelia@intec.unl.edu.ar>
To: Gfortran List <fortran@gcc.gnu.org>
Subject: beta gfortran 14.x.y (using -march=native and intrinsic repeat) gives a signal SIGILL
Date: Fri, 11 Aug 2023 09:34:57 -0300 (ART) [thread overview]
Message-ID: <1302200217.1817.1691757297462.JavaMail.zimbra@intec.unl.edu.ar> (raw)
Dear GFortran developers,
With the beta gfortran 14.x.y versions we are noticing some runtime
errors in a production code.
One type of runtime errors is related to the concurrent use of the
intrinsic "repeat" when the source code is compiled with the
flag -march=native, please, see below:
$ cat test.f90
program test
implicit none
integer , parameter :: iin = kind (1)
integer (iin), parameter :: pp = 32
character (len=pp) :: cc
cc (1:pp) = repeat (" ",pp)
write (*,*)" cc : " // cc
end program test
$ gfortran --version
GNU Fortran (GCC) 14.0.0 20230808 (experimental)
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
a) Compiling with the flag -mtune=native only, without -march=native, the test is ok:
$ gfortran -mtune=native -fcheck=all -std=f2018 -Wall -Werror -Wextra -Og -o test.exe test.f90
$ test.exe
cc :
b) However, compiling with the flag -march=native:
$ gfortran -march=native -fcheck=all -std=f2018 -Wall -Werror -Wextra -Og -o test.exe test.f90
$ test.exe
Program received signal SIGILL: Illegal instruction.
Backtrace for this error:
#0 0x14fae277fb1f in ???
#1 0x4011ad in ???
#2 0x401272 in ???
#3 0x14fae276a50f in ???
#4 0x14fae276a5c8 in ???
#5 0x4010c4 in ???
#6 0xffffffffffffffff in ???
Illegal instruction (core dumped)
On the other hand, compiling with the system version (GNU Fortran (GCC)
12.3.1 20230508 (Red Hat 12.3.1-1)) or replacing the intrinsic repeat
with:
do kk = 1, pp
cc (kk:kk) = " "
end do
both tests are ok. The error occurs on any of Intel or AMD computers,
e.g. in the present case:
$ lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Address sizes: 46 bits physical, 48 bits virtual
Byte Order: Little Endian
CPU(s): 6
On-line CPU(s) list: 0-5
Vendor ID: GenuineIntel
Model name: Intel(R) Core(TM) i7-3930K CPU @ 3.20GHz
CPU family: 6
Model: 45
Thread(s) per core: 1
Core(s) per socket: 6
Socket(s): 1
Stepping: 7
BogoMIPS: 6400.22
Caches (sum of all):
L1d: 192 KiB (6 instances)
L1i: 192 KiB (6 instances)
L2: 1.5 MiB (6 instances)
L3: 12 MiB (1 instance)
NUMA:
NUMA node(s): 1
NUMA node0 CPU(s): 0-5
By the way, I do not know if the -march=native flag or the intrinsic
repeat would be of deprecated use (or not)...
Regards.
Jorge.
--
CIMEC (UNL-CONICET), cimec.conicet.gov.ar, www.cimec.org.ar
Predio CONICET-Santa Fe, Colec. Ruta Nac. 168,
Paraje El Pozo, 3000, Santa Fe, ARGENTINA.
Tel +54-342-4511594/95 ext 7062, fax: +54-342-4511169
next reply other threads:[~2023-08-11 12:28 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-11 12:34 Jorge D'Elia [this message]
2023-08-11 16:21 ` Jerry D
2023-08-11 16:55 ` Paul Richard Thomas
2023-08-11 17:42 ` Jorge D'Elia
2023-08-12 6:56 ` Paul Richard Thomas
2023-08-12 13:41 ` Jorge D'Elia
2023-08-12 16:05 ` Steve Kargl
2023-08-12 17:21 ` Jerry D
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1302200217.1817.1691757297462.JavaMail.zimbra@intec.unl.edu.ar \
--to=jdelia@intec.unl.edu.ar \
--cc=fortran@gcc.gnu.org \
--cc=jdelia@cimec.unl.edu.ar \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).