Closed apelloni closed 8 months ago
Thank you for your report! I have confirmed the same FORM runtime error with GCC 13.2.0.
I am not sure whether GCC 13 finds a pitfall in the FORM code (e.g., legal optimization with undefined behaviour) or it is just a bug of GCC, but it seems that making c
volatile somehow removes the issue:
diff --git a/sources/names.c b/sources/names.c
index fd01e89..9ae586f 100644
--- a/sources/names.c
+++ b/sources/names.c
@@ -1666,7 +1666,8 @@ static int nwarntab = 1;
int DoTable(UBYTE *s, int par)
{
GETIDENTITY
- UBYTE *name, *p, *inp, c;
+ UBYTE *name, *p, *inp;
+ volatile UBYTE c;
int i, j, k, sparseflag = 0, rflag = 0, checkflag = 0;
int error = 0, ret, oldcbufnum, oldEside;
WORD funnum, type, *OldWork, *w, *ww, *t, *tt, *flags1, oldnumrhs,oldnumlhs;
Maybe we need C (and/or GCC) experts...
Posted a related question on StackOverflow.
To summarize the discussion on StackOverflow, this is a GCC 13 bug and will be fixed in 13.3.0. So, I close this issue.
Meanwhile, we must not forget to run make check
(test_Issue135_3
catches this issue).
I've run make check
but didn't show any error.
I've looked into the check files and saw that check-help.sh
calls for ruby
which I didn't have installed.
Now I can also see the failed check.
Thanks for looking into it.
I was building (t)form on my machine which is currently using
gcc (GCC) 13.2.1 20230801
and found an error. The compilation is completed without any issues (except some warnings see form_build_gcc13.log)Most programs run just fine, but I get an error with tables. By running
I get
I've tried to build
form-5.0.0
,form-4.3.1
,form-4.3.0
but the issue is consistent.It all disappear when I compile with
gcc-12 (GCC) 12.3.0
by runningCC=gcc-12 CXX=g++-12 ./configure
Then the program runs as expected.I've also tried to enable debugging but then
vorm
runs without issues. So I've tried to compile with a lower optimization level and I found that-O2
and-O3
are the ones producing the issueI'm unsure if this is a problem in the
gcc
compiler or something being exposed only at this level. It could also be that the version I'm using is not completely stable. I also didn't have the opportunity to try to reproduce it on another machineI'm attaching also the output from
make form
using bothgcc-12
andgcc-13
: form_build_gcc13.log form_build_gcc12.log