This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
configure --enable-checking=foo,bar buglet - patch installed
- To: gcc-patches at gcc dot gnu dot org
- Subject: configure --enable-checking=foo,bar buglet - patch installed
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Date: Mon, 19 Jun 2000 13:42:41 -0400 (EDT)
When running configure --enable-checking=foo,bar (i.e. with
parameters) I get an error from sed on solaris2.7:
> sed: Unrecognized command: 1
This happened in a sed command which looked like "sed 1,12d". The
problem was that IFS at that point (erroneously) had a comma in it so
the shell invoked "sed 1 12d".
The reason IFS had a comma in it had to do with how enable-checking
parameter processing was being done. There was a place where IFS was
cached in $ac_save_IFS while a comma was inserted into IFS to split up
the parameters. However it was done as one shell command setting
multiple variables.
> ac_save_IFS="$IFS" IFS="$IFS,"
I don't know what relevant standards say about what order to process
in the above case, but solaris sh does it right-to-left whereas sh
(bash) on x86-linux does it left-to-right. (That cause the problem to
be masked on systems where bash is /bin/sh.) On solaris, ac_save_IFS
gets processed second and thus contains the temporary value of IFS
with a comma.
To avoid this, I simply inserted a semi-colon to enforce left-to-right
processing. While in there, I fixed the --help doc to reflect the new
default for plain "--enable-checking" with no parameters.
Below is the patch I installed.
--Kaveh
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/egcs/gcc/ChangeLog,v
retrieving revision 1.6930
diff -u -p -r1.6930 ChangeLog
--- ChangeLog 2000/06/19 01:40:31 1.6930
+++ ChangeLog 2000/06/19 17:22:00
@@ -1,3 +1,8 @@
+2000-06-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * configure.in (--enable-checking): Update --help doc to reflect
+ new defaults. Ensure $ac_save_IFS is set before $IFS is changed.
+
Sun Jun 18 21:42:15 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* gcse.c (insert_insn_end_bb): Always put after NOTE_INSN_BASIC_BLOCK.
Index: configure.in
===================================================================
RCS file: /cvs/gcc/egcs/gcc/configure.in,v
retrieving revision 1.392
diff -u -p -r1.392 configure.in
--- configure.in 2000/06/14 15:27:58 1.392
+++ configure.in 2000/06/19 17:22:03
@@ -182,7 +182,7 @@ AC_ARG_ENABLE(checking,
enable expensive run-time checks. With LIST,
enable only specific categories of checks.
Categories are: misc,tree,rtl,gc,gcac; default
- is misc,tree,rtl],
+ is misc,tree,gc],
[ac_checking=
ac_tree_checking=
ac_rtl_checking=
@@ -191,7 +191,7 @@ ac_gc_always_collect=
case "${enableval}" in
yes) ac_checking=1 ; ac_tree_checking=1 ; ac_gc_checking=1 ;;
no) ;;
-*) IFS="${IFS= }"; ac_save_IFS="$IFS" IFS="$IFS,"
+*) IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="$IFS,"
set fnord $enableval; shift
IFS="$ac_save_IFS"
for check