[Bug middle-end/108657] csmith: possible wrong checksum with -O3 and -ftrivial-auto-var-init=zero

2023-02-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108657

--- Comment #2 from Andrew Pinski  ---
If I initialize __trans_tmp_13 explictly to 0, the issue goes away 

[Bug middle-end/108657] csmith: possible wrong checksum with -O3 and -ftrivial-auto-var-init=zero

2023-02-03 Thread dcb314 at hotmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108657

--- Comment #3 from David Binderman  ---
(In reply to Andrew Pinski from comment #2)
> If I initialize __trans_tmp_13 explictly to 0, the issue goes away 

$ fgrep trans_tmp_13 bug880.c
   int64_t __trans_tmp_13;
   (g_452) ^= (__trans_tmp_13);
$ 

This now looks like a bug in csmith.

[Bug middle-end/108657] csmith: possible wrong checksum with -O3 and -ftrivial-auto-var-init=zero

2023-02-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108657

--- Comment #4 from Andrew Pinski  ---
(In reply to David Binderman from comment #3)
> (In reply to Andrew Pinski from comment #2)
> > If I initialize __trans_tmp_13 explictly to 0, the issue goes away 
> 
> $ fgrep trans_tmp_13 bug880.c
>int64_t __trans_tmp_13;
>(g_452) ^= (__trans_tmp_13);
> $ 
> 
> This now looks like a bug in csmith.

It might be both. I have not looked into the IR differences with respect of
initializing and not initializing it and using/not using
-ftrivial-auto-var-init=zero yet. This was mostly to give a hint to the next
person who looks into this issue to see if they understand why there is a
difference happening.
-ftrivial-auto-var-init=zero should produce the similar results to initializing
that variable to 0 but it is not. There has been some bugs (in GCC) recently in
the area of not executed pathes with uninitialized variables changing the
behavior (incorrectly) so it might be related to one of those ...

[Bug middle-end/108657] csmith: possible wrong checksum with -O3 and -ftrivial-auto-var-init=zero

2023-02-04 Thread dcb314 at hotmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108657

--- Comment #5 from David Binderman  ---
(In reply to David Binderman from comment #0)
> Also, the possible bug seems to have first occurred sometime before 20230103

Also before 20221201:

$ /home/dcb36/gcc/results.20221201/bin/gcc -w -O3 -ftrivial-auto-var-init=zero
bug880.c
$ ./a.out
checksum = BCC02729
$ /home/dcb36/gcc/results.20221201/bin/gcc -v 2>&1 | fgrep exp
gcc version 13.0.0 20221130 (experimental) (d0a3d55ae4a2656f) 
$

[Bug middle-end/108657] csmith: possible wrong checksum with -O3 and -ftrivial-auto-var-init=zero

2023-02-04 Thread dcb314 at hotmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108657

--- Comment #6 from David Binderman  ---
(In reply to David Binderman from comment #5)
> (In reply to David Binderman from comment #0)
> > Also, the possible bug seems to have first occurred sometime before 20230103
> 
> Also before 20221201:

And before 20221101:

$ /home/dcb36/gcc/results.20221101/bin/gcc -w -O3 -ftrivial-auto-var-init=zero
bug880.c
$ ./a.out
checksum = BCC02729
$ /home/dcb36/gcc/results.20221101/bin/gcc -v 2>&1 | fgrep exp
gcc version 13.0.0 20221101 (experimental) (4acc4c2be84d6607) 
$

[Bug middle-end/108657] csmith: possible wrong checksum with -O3 and -ftrivial-auto-var-init=zero

2023-02-04 Thread dcb314 at hotmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108657

--- Comment #7 from David Binderman  ---
I can only go back as far as 20221028, when the git tree was installed.

$ /home/dcb36/gcc/results.20221028/bin/gcc -w -O3 -ftrivial-auto-var-init=zero
bug880.c
$ ./a.out
checksum = BCC02729
$ /home/dcb36/gcc/results.20221028/bin/gcc -v 2>&1 | fgrep exp
gcc version 13.0.0 20221028 (experimental) (8f2358724fa4) 
$ 

I will have a look at how to get at dates before the clone date.

[Bug middle-end/108657] csmith: possible wrong checksum with -O3 and -ftrivial-auto-var-init=zero

2023-02-06 Thread dcb314 at hotmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108657

--- Comment #8 from David Binderman  ---
(In reply to David Binderman from comment #7)
> I will have a look at how to get at dates before the clone date.

I used snapshots instead. I tried 20221002, and got

$ ./results.20221002/bin/gcc -w -O3 -ftrivial-auto-var-init=zero 
~/gcc/foundBugs/bug880.c && ./a.out
checksum = BCC02729
$ ./results.20221002/bin/gcc -v 2>&1 | fgrep exp
gcc version 13.0.0 20221002 (experimental) (GCC) 
$

[Bug middle-end/108657] csmith: possible wrong checksum with -O3 and -ftrivial-auto-var-init=zero

2023-02-06 Thread dcb314 at hotmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108657

--- Comment #9 from David Binderman  ---
Same thing, back to 20220807.

[Bug middle-end/108657] csmith: possible wrong checksum with -O3 and -ftrivial-auto-var-init=zero

2023-02-06 Thread dcb314 at hotmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108657

--- Comment #10 from David Binderman  ---
Bingo ! 

>From snapshot 20220703, with g:f3a5e75cb66dc96e, to 20220807, with
g:ef54eb74cab17737, it goes wrong.

Perhaps someone who has the git history would like to bisect this.