public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "t3suzuki at ucsd dot edu" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/107660] New: Running binaries compiled with g++11 or later produces different results than g++ version 10 or earlier
Date: Sat, 12 Nov 2022 03:28:20 +0000	[thread overview]
Message-ID: <bug-107660-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 107660
           Summary: Running binaries compiled with g++11 or later produces
                    different results than g++ version 10 or earlier
           Product: gcc
           Version: 12.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: t3suzuki at ucsd dot edu
  Target Milestone: ---

[gcc version]
$ ./g++ -v
Using built-in specs.
COLLECT_GCC=./g++
COLLECT_LTO_WRAPPER=/home/tomoya-s/gcc-12.2.0/install/libexec/gcc/x86_64-pc-linux-gnu/12.2.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ./configure --prefix=/home/tomoya-s/gcc-12.2.0/install
--disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.2.0 (GCC)

[the command line that triggers the bug]
% git clone https://github.com/sbeamer/gapbs.git
% cd gapbs
% make bfs
% ./bfs -g 10 -n 1

[the output by using g++-12.2.0 (or g++-11) ]
Generate Time:       0.00282
Build Time:          0.00044
Graph has 1024 nodes and 10496 undirected edges for degree: 10
Source:                  204
    i                0.00001
   td          2     0.00000
   td         59     0.00000
    e                0.00000
   bu        711     0.00003
   bu        123     0.00001
   bu          0     0.00001
    c                0.00000
Trial Time:          0.00017
Average Time:        0.00017

[the output by using g++-10 or earlier or clang++]
Generate Time:       0.00797
Build Time:          0.00102
Graph has 1024 nodes and 10496 undirected edges for degree: 10
Source:                  204
    i                0.00001
   td         15     0.00001
    e                0.00000
   bu        615     0.00004
   bu        264     0.00001
   bu          1     0.00001
    c                0.00000
   td          0     0.00000
Trial Time:          0.00017
Average Time:        0.00017

Of course, the execution time is different.

We expect the numbers 2 and 59 and 711 after td and bu to be the same.
This is because the input and the process itself are the same, and there is no
randomness inside the process (random seed is fixed).

Note that this program uses OpenMP, but even if we disable it, the results will
be different depending on the g++ version as well.

             reply	other threads:[~2022-11-12  3:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-12  3:28 t3suzuki at ucsd dot edu [this message]
2022-11-12  3:49 ` [Bug c++/107660] " redi at gcc dot gnu.org
2022-11-12  5:45 ` t3suzuki at ucsd dot edu
2022-11-12  5:57 ` t3suzuki at ucsd dot edu
2022-11-13 20:18 ` pinskia at gcc dot gnu.org
2022-11-13 20:21 ` [Bug libstdc++/107660] " pinskia at gcc dot gnu.org
2022-11-15  1:47 ` redi at gcc dot gnu.org
2022-11-15 17:50 ` t3suzuki at ucsd dot edu
2022-11-15 19:24 ` redi at gcc dot gnu.org
2022-11-16  1:41 ` t3suzuki at ucsd dot edu
2022-11-16 12:33 ` redi at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-107660-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).