Hello all,
gpc seems to be very friendly with gcc-3.3.x, gpc testsuite is completely OK with it.
How deep is change between gcc-3.3 and gcc-3.4 ?
I don't study structure of gcc-3.4 thoroughly for the present, but i see that the build logic were changed.
Configure scripts are now called by main Makefile after a little base configuration. Etc.
Did you someone any research on it ?
Thanks, David
David Kredba wrote:
gpc seems to be very friendly with gcc-3.3.x, gpc testsuite is completely OK with it.
There are some problems with system specific predefines. Currently they're at best kludged. The effects are more or less severe, depending on the platform.
How deep is change between gcc-3.3 and gcc-3.4 ?
I don't study structure of gcc-3.4 thoroughly for the present, but i see that the build logic were changed.
Configure scripts are now called by main Makefile after a little base configuration. Etc.
Did you someone any research on it ?
Waldek did, and he also noticed the build issue. We'll need to do some work here, but I haven't had the time to look into it yet.
Frank
Frank Heckenbach wrote:
David Kredba wrote:
gpc seems to be very friendly with gcc-3.3.x, gpc testsuite is completely OK with it.
There are some problems with system specific predefines. Currently they're at best kludged. The effects are more or less severe, depending on the platform.
How deep is change between gcc-3.3 and gcc-3.4 ?
I don't study structure of gcc-3.4 thoroughly for the present, but i see that the build logic were changed.
Configure scripts are now called by main Makefile after a little base configuration. Etc.
Did you someone any research on it ?
Waldek did, and he also noticed the build issue. We'll need to do some work here, but I haven't had the time to look into it yet.
GCC-3.4 has been released. Any news on these issues ?
Regards,
Adriaan van Os
Adriaan van Os wrote:
GCC-3.4 has been released. Any news on these issues ?
There are experimental patches on my gpc Web page. The last time I checked patched gpc worked quite well on i386 Linux (all tests passed) and on AMD64 (two tests failed). Matthias Klose tried some other Linux platforms -- on MIPS build failed the other have similar results as 3.3.
Waldek Hebisch writes:
Adriaan van Os wrote:
GCC-3.4 has been released. Any news on these issues ?
There are experimental patches on my gpc Web page. The last time I checked patched gpc worked quite well on i386 Linux (all tests passed) and on AMD64 (two tests failed). Matthias Klose tried some other Linux platforms -- on MIPS build failed the other have similar results as 3.3.
alpha, hppa, i386, ia64, arm, m68k, mips, mipsel, powerpc, sparc
even mips did build. You can find the sources and patches (all in the debian/patches subdirectory) at
http://packages.debian.org/experimental/devel/gpc-2.1-3.4
Thanks to Waldek,
Matthias
Waldek Hebisch wrote:
Adriaan van Os wrote:
GCC-3.4 has been released. Any news on these issues ?
There are experimental patches on my gpc Web page. The last time I checked patched gpc worked quite well on i386 Linux (all tests passed) and on AMD64 (two tests failed). Matthias Klose tried some other Linux platforms -- on MIPS build failed the other have similar results as 3.3.
Thanks for the patches. With some offsets, the diffs apply all.
When building gpc-20030830 with gcc-3.4, I get the following error:
rm -f ../../libgpc.a ar rc ../../libgpc.a rts.o file.o rts-va.o rtsc.o string.o error.o string2.o time.o random.o filename.o files.o getopt.o numtodec.o sets.o heap.o math.o endian.o move.o init.o gpc.o if ; then ranlib -c ../../libgpc.a; else true; fi /bin/sh: -c: line 1: syntax error near unexpected token `;' /bin/sh: -c: line 1: `if ; then ranlib -c ../../libgpc.a; else true; fi' make[2]: [../../libgpc.a] Error 2 (ignored) ../../gpc-3.4.0/gcc/p/script/mkdir-p p/utils srcdir=`cd ../../gpc-3.4.0/gcc && pwd` && cd ./p/utils && make -f "$srcdir/p/utils/Makefile" SHELL="/bin/sh" PC="`if [ x"powerpc-apple-darwin" = x"powerpc-apple-darwin" ]; then echo ./xgpc -B./' '; else echo gcc | sed 's, *$,,;s,^([^ ]*[/][^/]*)gcc,\1gpc,;s/^gcc$/gpc/;s/$/ /' ; fi | sed -e 's,(-[BI])([^/][^:]),\1../../\2,g;s,^([^/][^:]*/),../../\1,'` -I../rts" CFLAGS="-g -O2" PFLAGS="" exeext="" INSTALL_PROGRAM="/usr/bin/install -c" INSTALL_DATA="/usr/bin/install -c -m 644" BUILD="powerpc-apple-darwin" HOST="powerpc-apple-darwin" GCC_DIR="$srcdir" all ../.././xgpc -B../.././ -I../rts -W -Wall -Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -g -O2 --executable-path=. --unit-path=/Users/adriaan/gnu/gcc-3.4-stuff/gpc-3.4.0/gcc/p/rts --unit-path=/Users/adriaan/gnu/gcc-3.4-stuff/gpc-3.4.0/gcc/p/units --print-needed-options "/Users/adriaan/gnu/gcc-3.4-stuff/gpc-3.4.0/gcc/p/utils/binobj.pas" 2> "needed-options" || true if grep -v '^--' "needed-options" > /dev/null; then echo "needed-options: `cat "needed-options"`" >&2; rm -f "needed-options"; false; else true; fi ../.././xgpc -B../.././ -I../rts --automake --executable-file-name -W -Wall -Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -g -O2 --executable-path=. --unit-path=/Users/adriaan/gnu/gcc-3.4-stuff/gpc-3.4.0/gcc/p/rts --unit-path=/Users/adriaan/gnu/gcc-3.4-stuff/gpc-3.4.0/gcc/p/units `cat needed-options` "/Users/adriaan/gnu/gcc-3.4-stuff/gpc-3.4.0/gcc/p/utils/binobj.pas" /usr/bin/ld: archive: ../.././libgpc.a has no table of contents, add one with ranlib(1) (can't load from it) collect2: ld returned 1 exit status make[2]: *** [binobj] Error 1 make[1]: *** [pascal.utils] Error 2 make: *** [all-gcc] Error 2
Regards,
Adriaan van Os
With regards to a previous conversation about the BSI standard test suite, for both ISO 7185 and extended Pascal.
I received a letter from Prospero on that matter. Apparently Prospero no longer has access to the test suite, which is only in the hands of the BSI.
Kind of a shame, I know. I don't think it is even possible to purchase it any longer, although I will check.
Adriaan van Os wrote:
Thanks for the patches. With some offsets, the diffs apply all.
When building gpc-20030830 with gcc-3.4, I get the following error:
<snip>
"/Users/adriaan/gnu/gcc-3.4-stuff/gpc-3.4.0/gcc/p/utils/binobj.pas" /usr/bin/ld: archive: ../.././libgpc.a has no table of contents, add one with ranlib(1) (can't load from it) collect2: ld returned 1 exit status make[2]: *** [binobj] Error 1 make[1]: *** [pascal.utils] Error 2 make: *** [all-gcc] Error 2
Try the following patch (if you want just remake you have to remove libgpc.a):
--- gpc-20030830.pp/p/rts/Makefile.in 2004-04-23 18:30:16.000000000 +0200 +++ gpc-20030830/p/rts/Makefile.in 2004-04-23 18:28:56.000000000 +0200 @@ -170,7 +170,7 @@ $(GPCLIB): $(OBJS) -rm -f $(GPCLIB) $(AR) $(AR_FLAGS) $(GPCLIB) $(OBJS) - -if $(RANLIB_TEST); then $(RANLIB) $(GPCLIB); else true; fi + -$(RANLIB) $(GPCLIB)
# That's a way to do an `if' that even a stupid make understands ... sharedlib. sharedlib.no sharedlib.@with_shared$(DUMMY)@:
Waldek Hebisch wrote:
Try the following patch (if you want just remake you have to remove libgpc.a):
Thanks, this works and brings me a step further.
../.././xgpc -B../.././ -I../rts --automake --executable-file-name -W -Wall -Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -g -O2 --executable-path=. --unit-path=/Users/adriaan/gnu/gcc-3.4-stuff/gpc-3.4.0/gcc/p/rts --unit-path=/Users/adriaan/gnu/gcc-3.4-stuff/gpc-3.4.0/gcc/p/units `cat needed-options` -I. -I "/Users/adriaan/gnu/gcc-3.4-stuff/gpc-3.4.0/gcc/p" "/Users/adriaan/gnu/gcc-3.4-stuff/gpc-3.4.0/gcc/p/utils/gpidump.pas" /Users/adriaan/gnu/gcc-3.4-stuff/gpc-3.4.0/gcc/p/units/stringutils.pas: In function `QuoteStringInternal': /Users/adriaan/gnu/gcc-3.4-stuff/gpc-3.4.0/gcc/p/units/ stringutils.pas:328: error: could not split insn (insn:TI 375 58 376 (set (reg:SI 30 r30 [138]) (const_int 4294967295 [0xffffffff])) 309 {*movsi_internal1} (insn_list:REG_DEP_ANTI 52 (nil)) (expr_list:REG_EQUIV (const_int 4294967295 [0xffffffff]) (nil))) /Users/adriaan/gnu/gcc-3.4-stuff/gpc-3.4.0/gcc/p/units/ stringutils.pas:328: internal compiler error: in final_scan_insn, at final.c:2429 Please submit a full bug report, with preprocessed source if appropriate. See URL:http://gcc.gnu.org/bugs.html for instructions. gpc1: ../.././xgpc exited with status 1 make[2]: *** [gpidump] Error 1 make[1]: *** [pascal.utils] Error 2 make: *** [all-gcc] Error 2
Regards,
Adriaan van Os
Adriaan van Os writes:
Waldek Hebisch wrote:
Try the following patch (if you want just remake you have to remove libgpc.a):
Thanks, this works and brings me a step further.
../.././xgpc -B../.././ -I../rts --automake --executable-file-name -W -Wall -Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -g -O2 --executable-path=. --unit-path=/Users/adriaan/gnu/gcc-3.4-stuff/gpc-3.4.0/gcc/p/rts --unit-path=/Users/adriaan/gnu/gcc-3.4-stuff/gpc-3.4.0/gcc/p/units `cat needed-options` -I. -I "/Users/adriaan/gnu/gcc-3.4-stuff/gpc-3.4.0/gcc/p" "/Users/adriaan/gnu/gcc-3.4-stuff/gpc-3.4.0/gcc/p/utils/gpidump.pas" /Users/adriaan/gnu/gcc-3.4-stuff/gpc-3.4.0/gcc/p/units/stringutils.pas: In function `QuoteStringInternal': /Users/adriaan/gnu/gcc-3.4-stuff/gpc-3.4.0/gcc/p/units/ stringutils.pas:328: error: could not split insn (insn:TI 375 58 376 (set (reg:SI 30 r30 [138]) (const_int 4294967295 [0xffffffff])) 309 {*movsi_internal1} (insn_list:REG_DEP_ANTI 52 (nil)) (expr_list:REG_EQUIV (const_int 4294967295 [0xffffffff]) (nil))) /Users/adriaan/gnu/gcc-3.4-stuff/gpc-3.4.0/gcc/p/units/ stringutils.pas:328: internal compiler error: in final_scan_insn, at final.c:2429 Please submit a full bug report, with preprocessed source if appropriate. See URL:http://gcc.gnu.org/bugs.html for instructions. gpc1: ../.././xgpc exited with status 1 make[2]: *** [gpidump] Error 1 make[1]: *** [pascal.utils] Error 2 make: *** [all-gcc] Error 2
Matthias Klose wrote:
Thanks for the link, but this leads to the following error:
gcc -c -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -DHAVE_CONFIG_H -I. -I. -I../../gpc-3.4.0/gcc -I../../gpc-3.4.0/gcc/. -I../../gpc-3.4.0/gcc/../include -I../intl ../../gpc-3.4.0/gcc/expr.c -o expr.o ../../gpc-3.4.0/gcc/expr.c:5150:40: macro "GEN_INT" passed 2 arguments, but takes just 1 ../../gpc-3.4.0/gcc/expr.c: In function `store_constructor': ../../gpc-3.4.0/gcc/expr.c:5150: error: `GEN_INT' undeclared (first use in this function) ../../gpc-3.4.0/gcc/expr.c:5150: error: (Each undeclared identifier is reported only once ../../gpc-3.4.0/gcc/expr.c:5150: error: for each function it appears in.) make[1]: *** [expr.o] Error 1 make: *** [all-gcc] Error 2
Regards,
Adriaan van Os
Matthias Klose wrote:
Thanks for the link, but this leads to the following error:
gcc -c -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -DHAVE_CONFIG_H -I. -I. -I../../gpc-3.4.0/gcc -I../../gpc-3.4.0/gcc/. -I../../gpc-3.4.0/gcc/../include -I../intl ../../gpc-3.4.0/gcc/expr.c -o expr.o ../../gpc-3.4.0/gcc/expr.c:5150:40: macro "GEN_INT" passed 2 arguments, but takes just 1 ../../gpc-3.4.0/gcc/expr.c: In function `store_constructor': ../../gpc-3.4.0/gcc/expr.c:5150: error: `GEN_INT' undeclared (first use in this function) ../../gpc-3.4.0/gcc/expr.c:5150: error: (Each undeclared identifier is reported only once ../../gpc-3.4.0/gcc/expr.c:5150: error: for each function it appears in.) make[1]: *** [expr.o] Error 1 make: *** [all-gcc] Error 2
Oops, my fault.
Regards,
Adriaan van Os
Matthias Klose wrote:
Thanks Matthias. I have updated the backed patch.
Matthias Klose wrote:
Thanks, the compiler now builds, but -O3 seems to be broken.
[G4:~/gnu/testgpc/adriaan] adriaan% gpc -v Reading specs from /Developer/Pascal/gpc340d1/lib/gcc/powerpc-apple-darwin/3.4.0/specs Configured with: ../gpc-3.4.0/configure --enable-languages=pascal,c --prefix=/Developer/Pascal/gpc340d1 --enable-threads=posix --target=powerpc-apple-darwin --host=powerpc-apple-darwin Thread model: posix gpc version 20030830, based on gcc-3.4.0
[G4:~/gnu/testgpc/adriaan] adriaan% gpc -O2 hello.pas [G4:~/gnu/testgpc/adriaan] adriaan% gpc -O3 hello.pas /var/tmp//cckDXLbh.s:111:FATAL:Symbol L_pascal_main_program$stub already defined.
Waldek Hebisch wrote:
I also applied the "update16.diff" patches. Was that OK ?
Regards,
Adriaan van Os
Matthias Klose wrote:
Thanks, the compiler now builds, but -O3 seems to be broken.
[G4:~/gnu/testgpc/adriaan] adriaan% gpc -v Reading specs from /Developer/Pascal/gpc340d1/lib/gcc/powerpc-apple-darwin/3.4.0/specs Configured with: ../gpc-3.4.0/configure --enable-languages=pascal,c --prefix=/Developer/Pascal/gpc340d1 --enable-threads=posix --target=powerpc-apple-darwin --host=powerpc-apple-darwin Thread model: posix gpc version 20030830, based on gcc-3.4.0
[G4:~/gnu/testgpc/adriaan] adriaan% gpc -O2 hello.pas [G4:~/gnu/testgpc/adriaan] adriaan% gpc -O3 hello.pas /var/tmp//cckDXLbh.s:111:FATAL:Symbol L_pascal_main_program$stub already defined.
Waldek Hebisch wrote:
I also applied the "update16.diff" patches. Was that OK ?
Sorry, "update16.diff" contains experimental name mangler patches. If that couses a problem I would like to know (I just checked, for null program cross compiler with that patch applied gives me the same assembly output). However, ATM mangler stuff evolves quickly and introduces serious incompatibilities, so it is not intended for wider use (in few days I shold have stable version).
I the meantime I marked mangler patch more clearily.
Anyway, I would like to see assembler output (what gpc -S -O3 produces) -- the output from cross-compiler at first glance looks OK.
Adriaan van Os wrote:
Waldek Hebisch wrote:
Anyway, I would like to see assembler output (what gpc -S -O3 produces) -- the output from cross-compiler at first glance looks OK.
Hello.s is included.
AFAIKS Darwin backend is doing something very strange when inlining Pascal initialization routines (tries to call them like external ones).
If problem is limited to initialization (as a little experiment suggest), then the following patch is w good workaround. It forbids inlining initialization routines -- such inlining is useless anyway.
--- gpc-20030830/p/declarations.c.pp Sat Apr 24 19:28:04 2004 +++ gpc-20030830/p/declarations.c Sat Apr 24 19:28:46 2004 @@ -2521,6 +2521,7 @@ if (!DECL_LANG_SPECIFIC (decl)) DECL_LANG_SPECIFIC (decl) = allocate_decl_lang_specific (); TREE_STATIC (decl) = 1; + DECL_UNINLINABLE (decl) = 1; DECL_ARGUMENTS (decl) = args; DECL_RESULT (decl) = build_decl (RESULT_DECL, NULL_TREE, result); announce_function (decl);
Waldek Hebisch wrote:
AFAIKS Darwin backend is doing something very strange when inlining Pascal initialization routines (tries to call them like external ones).
Do you think we should report this to the gcc list ?
If problem is limited to initialization (as a little experiment suggest), then the following patch is w good workaround. It forbids inlining initialization routines -- such inlining is useless anyway.
Thanks for the patch. It does solve the problem.
By the way, after building and installing I have to run ranlib on libgpc.a.
[G4:~/gnu/testgpc/adriaan] adriaan% gpc hello.pas /usr/bin/ld: table of contents for archive: /Developer/Pascal/gpc340d2/lib/gcc/powerpc-apple-darwin/3.4.0/libgpc.a is out of date; rerun ranlib(1) (can't load from it) collect2: ld returned 1 exit status [G4:~/gnu/testgpc/adriaan] adriaan% ranlib /Developer/Pascal/gpc340d2/lib/gcc/powerpc-apple-darwin/3.4.0/libgpc.a [G4:~/gnu/testgpc/adriaan] adriaan% gpc hello.pas [G4:~/gnu/testgpc/adriaan] adriaan% gpc -O3 hello.pas [G4:~/gnu/testgpc/adriaan] adriaan% gpc -g -O3 hello.pas
I am now running the testsuite to see if there are any more problems.
Regards,
Adriaan van Os
Adriaan van Os wrote:
Waldek Hebisch wrote:
AFAIKS Darwin backend is doing something very strange when inlining Pascal initialization routines (tries to call them like external ones).
Do you think we should report this to the gcc list ?
No. I think this our fault in how we call them. I think Waldek's change (with `#ifdef EGCS97') is alright (I might even consider it a fix, not only a workaround).
It might be quite possible to really allow inlining of initialization routines, but there's really no point, and it might just confuse matters.
Frank
I am now running the testsuite to see if there are any more problems.
No problems with the testsuite, except known ones: nlgpp2.pas and fproc.pas (nonlocal goto's) and systemtest.pas (malloc bug in Darwin).
<snip> TEST fproc.pas: /var/tmp//ccdFaUpQ.s:unknown:Can't emit reloc {- symbol "LSJR11"} @ file address 800. /var/tmp//ccdFaUpQ.s:unknown:Can't emit reloc {- symbol "LSJR11"} @ file address 796. /var/tmp//ccdFaUpQ.s:unknown:Undefined local symbol L3$pb failed <snip> TEST nlgpp2.pas: /var/tmp//cc4oD0DK.s:unknown:Can't emit reloc {- symbol "LSJR11"} @ file address 1056. /var/tmp//cc4oD0DK.s:unknown:Can't emit reloc {- symbol "LSJR11"} @ file address 1052. /var/tmp//cc4oD0DK.s:unknown:Undefined local symbol L3$pb failed
Same problem on powerpc-apple-darwin with Ada, see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10129. To be solved (...) in gcc-3.4, see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13093.
Running the testsuite with EXTRA_PFLAGS=--longjmp-all-nonlocal-labels works around the nonlocal goto failures, but used to cause an "Undefined local symbol L3$pb". This has now been fixed in gcc-3.4.
Regards,
Adriaan van Os