configure erroneously detects eh_frame misoptimization

2017-09-19 Thread Steven Taschuk
The behaviour of echo for arguments containing the two-character
substring `\0` varies among implementations: in coreutils echo,
and in the builtins of ash, bash, busybox sh, csh, and fish, the two
characters `\0` are emitted literally; the builtins of tcsh and zsh
emit a null character and continue rendering the rest of the string;
dash's builtin terminates the string early.

Ubuntu since 6.10 uses dash as /bin/sh, so on such systems,
configure misdiagnoses the assembler as unable to optimize eh_frame
sections correctly, yielding ultimately an unnecessary use of
`--traditional-format` in the driver's invocation of the assembler.

diff -ru gcc-4.2.1-orig/gcc/configure gcc-4.2.1/gcc/configure
--- gcc-4.2.1-orig/gcc/configure2007-01-01 22:44:31.0 -0500
+++ gcc-4.2.1/gcc/configure 2017-09-19 06:50:48.546060400 -0400
@@ -14076,7 +14076,8 @@
 .LSCIE1:
.4byte  0x0
.byte   0x1
-   .ascii "z\0"
+   .ascii "z"
+   .byte   0x0
.byte   0x1
.byte   0x78
.byte   0x1a


Re: configure erroneously detects eh_frame misoptimization

2017-09-21 Thread Steven Taschuk
Quoth Andrew Pinski:
> Please https://gcc.gnu.org/contribute.html for some more information
> on the all of the requirements when it comes to submitting a patch.

Thanks for the pointers.

Testing the change against the trunk, I find that the problem no
longer exists, because printf is used instead of echo when the shell
is other than bash and zsh.  Is it worth making the change anyway?
If so, I'll prepare a submission meeting the requirements.

-- 
Steven Taschukhttp://www.amotlpaa.org/
"Our analysis begins with two outrageous benchmarks."
  -- "Implementation strategies for continuations", Clinger et al.