According to Kevin A. Foss:
Thanks for uploading this, it appears to fix a lot of stuff that I have been waiting to try. However I had to do a lot of patching to the makefiles to get it to compile under EMX -- it looks like the RTS had a lot of changes :) .
Hmm ... I was sure that I had included your EMX patches into `config/emx' - including `dostage1.cmd' which was in `..' (the GCC source directory).
I'm afraid that in all of the patching I did, I may have missed something, or else read(ln) has been seriously broken [...]
Indeed. (The second one.) Thanks for the test program; a patch to fix it follows below. (I usually only use strings of variable length; that's why I didn't find the error myself.)
(BTW, does a port of the `patch' program to EMX exist? If so, we could replace the patched GCC source files in `config/emx' by a diff - just like we do for other platforms.)
Greetings,
Peter -- Peter Gerwinski, Essen, Germany, free physicist and programmer Maintainer GNU Pascal - http://home.pages.de/~GNU-Pascal/ - 1 Oct 1997 PGP key fingerprint: AC 6C 94 45 BE 28 A4 96 0E CC E9 12 47 25 82 75 Fight the SPAM! - http://maps.vix.com/
8< ---------------------------------------------------------------------------
Changes for gpc from gpc-971229.
Changes in files you can reconstruct with Bison, etags, makeinfo, and TeX have been omitted. Some of these files are updated just by building the compiler. You can update the rest of these files by executing this command
make TAGS info dvi -f Makefile.in
in the directory of GPC sources, provided the necessary tools (etags, makeinfo, TeX and texi2dvi) are installed.
To apply these diffs, go to the directory gpc-971229 and use the command
patch -p1
feeding it the following diffs as input. Then rename the directory to gpc.
diff -r -U3 -N -x *.o -x *.log -x *.old -x Makefile -x config.cache -x config.status -x gpc-version.c -x *parse.c -x *parse.h -x gpc-gperf.h -x TAGS -x gpc.?? -x gpc.??s -x gpc.aux -x g?c.info* -x gpc*.html -x *.dvi -x *.toc -x *.html -x INSTALL -x FPKvsGNU -x specs -x core -x version -x rts-version.c -x rts-config.h -x gpc -x gpc-cpp -x gpc1 -x libgpc.a -x config.h -x b[i,c]-* -x hconfig.h -x tconfig.h -x insn-*.[c,h] -x options.h -x specs.h -x stamp* -x tm.h -x gen* -x stage[1-4] -x include -x ?++* -x cc1 -x cccp -x cpp -x enquire -x float.h* -x gfloat.h* -x multilib.h -x lib*.a -x underscore.c -x xg?c -x xlimits.h -x site.exp -x *.bak -x *.swp -x gcc-2.7.2.2.patch -x *.aux -x *.cp -x *.cps -x *.ky -x *.kys -x *.gdt -x *.gpr -x *.gpi -x gpc-config.h -x *.orig gpc-971229/p/rts.c gpc/p/rts.c --- gpc-971229/p/rts.c Fri Dec 5 18:37:52 1997 +++ gpc/p/rts.c Tue Dec 30 13:13:13 1997 @@ -525,46 +525,48 @@ } break;
- case RECORD_TYPE: /* String schema */ - case ARRAY_TYPE: /* fixed length strings */ - switch (is_string_type (p, 1)) { - case 0: - error ("only packed arrays of char may be read from `text' files"); - continue; - case 1: - break; - case 2: - /* @@@ Should generate a runtime check for conformant arrays. - * (low index has to be 1 for arrays to be valid string-type) - */ - /* for now, just read them */ - break; - default: - abort (); - } + case RECORD_TYPE: /* String schema. */ + case ARRAY_TYPE: /* Fixed length string. */ + switch (is_string_type (p, 1)) + { + case 0: + error ("only packed arrays of char may be read from `text' files"); + continue; + case 1: + break; + case 2: + /* @@@ Should generate a runtime check for conformant arrays + * (low index has to be 1 for arrays to be valid string-type). + * + * For now, just read them. + */ + break; + default: + abort (); + }
if (PEDANTIC (E_O_PASCAL)) pedwarn ("ISO Pascal does not allow reading of strings from textfiles");
- /* run time system expects another argument - before max length: a pointer to int where - it stores the current length of the string - - If that is null_pointer, the string is a fixed length string. - - This needs to be an lvalue if not NULL_TREE. - */ if (is_variable_string_type (TREE_TYPE (p))) - string_curlen = build_unary_op (ADDR_EXPR, PASCAL_STRING_LENGTH (p), 0); + { + what = P_STRING; + /* The run time system expects another argument + * before max length: a pointer to int where + * it stores the current length of the string. + * + * This needs to be an lvalue. + */ + string_curlen = build_unary_op (ADDR_EXPR, PASCAL_STRING_LENGTH (p), 0); + } else - string_curlen = null_pointer_node; + what = P_FIXED_STRING;
/* The char store */ p = PASCAL_STRING_VALUE (p);
/* String max length */ string_length = pascal_array_type_nelts (TREE_TYPE (p)); - what = P_STRING; break; default : @@ -591,11 +593,11 @@ build_unary_op (ADDR_EXPR, p, 0))); allow_packed_var_parameters--; if (what == P_STRING) - arglist = chainon (arglist, - tree_cons (NULL_TREE, - string_curlen, - build_tree_list (NULL_TREE, - string_length))); + arglist = chainon (arglist, + build_tree_list (NULL_TREE, string_curlen)); + + arglist = chainon (arglist, + build_tree_list (NULL_TREE, string_length));
/* Mark that we have assigned a value to this variable. */