public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/112550] New: Difference in output from -O0 to -01 ?
@ 2023-11-15 16:48 dcb314 at hotmail dot com
  2023-11-15 16:49 ` [Bug c/112550] " sjames at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: dcb314 at hotmail dot com @ 2023-11-15 16:48 UTC (permalink / raw)
  To: gcc-bugs

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 ?

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-11-15 22:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-15 16:48 [Bug c/112550] New: Difference in output from -O0 to -01 ? dcb314 at hotmail dot com
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

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).