public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "dcb314 at hotmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/112550] New: Difference in output from -O0 to -01 ?
Date: Wed, 15 Nov 2023 16:48:10 +0000	[thread overview]
Message-ID: <bug-112550-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 112550
           Summary: Difference in output from -O0 to -01 ?
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

Created attachment 56594
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56594&action=edit
C source code

For the attached C code, with this bash script:

$ cat qwe.sh
CC="/home/dcb38/gcc/results/bin/gcc"
FLAGS="-w -ftrivial-auto-var-init=zero -fno-strict-aliasing"

echo bug 981
$CC -O0 $FLAGS bug981.c -o 1.exe
$CC -O1 $FLAGS bug981.c -o 2.exe
./1.exe 1 > 1.out
./2.exe 1 > 2.out
diff 1.out 2.out | head -5

$ source ./qwe.sh
bug 981
38c38
< ...checksum after hashing g_130[i][j] : 19463610
---
> ...checksum after hashing g_130[i][j] : 65FD073B
40c40
$ /home/dcb38/gcc/results/bin/gcc -v 2>&1 | grep exp
gcc version 14.0.0 20231115 (experimental) (081fddbbcf979022) 
$ 

I don't understand why such a trivial change from -O0 to -O1 would cause
such a difference.

Is there perhaps another -f flag I should use to get no difference ?

             reply	other threads:[~2023-11-15 16:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-15 16:48 dcb314 at hotmail dot com [this message]
2023-11-15 16:49 ` [Bug c/112550] " sjames at gcc dot gnu.org
2023-11-15 16:59 ` dcb314 at hotmail dot com
2023-11-15 17:10 ` dcb314 at hotmail dot com
2023-11-15 22:42 ` xry111 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-112550-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).