https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67861

            Bug ID: 67861
           Summary: coreutils' wc.c:write_counts is miscompiled since
                    commit 7e3a76de7c496449b187c2688d958631cf21a944
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: blocker
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jim at meyering dot net
  Target Milestone: ---

Since the Oct 1 commit, 7e3a76de7c496449b187c2688d958631cf21a944,
coreutils's wc.c write_counts function is no longer compiled correctly,
yielding a "wc" command that prints only a newline, regardless of optimization
level.

To reproduce, I bootstrapped and installed gcc, then built coreutils from git,
then ran this:

  echo | src/wc

and since that commit, it prints only a newline. Normally it would print this
24-byte sequence:

        1       0       1

I confirmed that it is also reproduced when building from the latest released
tarball:

  wget http://ftp.gnu.org/gnu/coreutils/coreutils-8.24.tar.xz
  tar xf coreutils-8.24.tar.xz && cd coreutils-8.24 && ./configure && make

When built with a recently-bootstrapped gcc, wc malfunctions like this:

  $ echo | src/wc|od -An -a
    nl

Reply via email to