Build broken (was: [PATCH 02/11] Generate pass-instances.def)

David Malcolm dmalcolm@redhat.com
Wed Jul 31 15:58:00 GMT 2013


On Wed, 2013-07-31 at 11:36 +0200, Jan-Benedict Glaw wrote:
> On Wed, 2013-07-31 10:34:10 +0200, Jan-Benedict Glaw <jbglaw@lug-owl.de> wrote:
> > On Tue, 2013-07-30 20:50:27 -0400, David Malcolm <dmalcolm@redhat.com> wrote:
> > [...]
> > > Committed to trunk as r201359, having double-checked that it
> > > bootstrapped by itself on top of what had gone before, and that the
> > > testsuite results were unaffected by it (on x86_64-unknown-linux-gnu).
> > 
> > [...]
> > mawk -f ../../../../gcc/gcc/gen-pass-instances.awk \
> >           ../../../../gcc/gcc/passes.def > pass-instances.def
> [...]
> 
> > It seems this does only happen on one of the three running build
> > clients. That one is using `mawk' instead of `gawk', what the two
> > other builders (which are not affected) use.
> 
> The substr() was wrong, awk starts all its indices with 1, while the
> script used 0. gawk ignores this, mawk starts the substring at 1, but
> counts from 0 upwards.
> 
> Fixed as trivial:
> 
> 2013-07-31  Jan-Benedict Glaw  <jbglaw@owl.de>
> 
> 	* gen-pass-instances.awk: Fix offset of substr().

A thousand apologies, and thanks for fixing this - I guess I owe you a
$FAVORITE_BEVERAGE.  I had only tested with gawk (with and without -c)
and with busybox awk.  I've now installed mawk and nawk on my dev box.

Are that any other awks I should be testing with - and is this
information captured somewhere for reference?

I've verified that gawk, gawk -c, mawk, nawk and busybox awk all
generate the same output on your version (r201364)  thusly in bash:

$ for AWK in gawk "gawk -c" mawk nawk "busybox awk" ; \
    do \
      $AWK -f gen-pass-instances.awk.new passes.def \
        > "pass-instances-new-$AWK.def" ; \
    done

$ md5sum pass-instances-new-*
e7d0f2c2ab4f2e83fbd032f222d66530  pass-instances-new-busybox awk.def
e7d0f2c2ab4f2e83fbd032f222d66530  pass-instances-new-gawk -c.def
e7d0f2c2ab4f2e83fbd032f222d66530  pass-instances-new-gawk.def
e7d0f2c2ab4f2e83fbd032f222d66530  pass-instances-new-mawk.def
e7d0f2c2ab4f2e83fbd032f222d66530  pass-instances-new-nawk.def

However, having said that, with my original version (as of r201359), I
get the same results as with your version:

$ md5sum gen-pass-instances.awk.*
6dcc4e2de8241f1811435013da44b757  gen-pass-instances.awk.new
7e5ad85f1f919dea9862b420ddbb0fdd  gen-pass-instances.awk.old

$ diff gen-pass-instances.awk.old gen-pass-instances.awk.new
58c58
< 			substr(line, 0, pass_starts_at + len_of_pass_name - 1),
---
> 			substr(line, 1, pass_starts_at + len_of_pass_name - 1),

$ for AWK in gawk "gawk -c" mawk nawk "busybox awk" ; \
    do \
      $AWK -f gen-pass-instances.awk.old passes.def \
        > "pass-instances-old-$AWK.def" ; \
    done

$ md5sum pass-instances-old-*
e7d0f2c2ab4f2e83fbd032f222d66530  pass-instances-old-busybox awk.def
e7d0f2c2ab4f2e83fbd032f222d66530  pass-instances-old-gawk -c.def
e7d0f2c2ab4f2e83fbd032f222d66530  pass-instances-old-gawk.def
e7d0f2c2ab4f2e83fbd032f222d66530  pass-instances-old-mawk.def
e7d0f2c2ab4f2e83fbd032f222d66530  pass-instances-old-nawk.def

so it seems they're all generating the same output, with both my old
version and your new version.

Have I messed up my testing above, or is something else going on?  What
version of mawk are you using?

I'm using versions packaged on a Fedora 17 box:

$ rpm -q gawk mawk nawk busybox
gawk-4.0.1-1.fc17.x86_64
mawk-1.3.4-1.20130219.fc17.x86_64
nawk-20110810-3.fc17.x86_64
busybox-1.19.4-4.fc17.x86_64

i.e.:
* GNU Awk 4.0.1
* mawk 1.3.4
* nawk --version gives "awk version 20110810"
* BusyBox v1.19.4 (2012-04-18 15:11:20 UTC) multi-call binary.


Thanks again
Dave



More information about the Gcc-patches mailing list