From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 643E338582B0; Wed, 8 Mar 2023 13:43:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 643E338582B0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1678282983; bh=Ued5i+oCx0GHjwhcu9WP7IYXoqf/7v9L+Ay8giugQig=; h=From:To:Subject:Date:In-Reply-To:References:From; b=p6TH5ZdQ1QxVZnZXAUDqanpWtSYLQGlaaYgaC+Fv/kqv09ki7OyHidi6OeRCKr8la uHa4NZg/2YCLpxU48z6wNSkEA2ZAGwMF8Ly1xhHDWGM35BS6DIgSjhWNKu5LhHtYIB eWAUxpAMfSnAAffzwSfSjiu+WLtOgfslTXJJLIf0= From: "marxin at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/109031] csmith: possible bad code with -O2 -fno-strict-aliasing Date: Wed, 08 Mar 2023 13:43:03 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: needs-bisection, needs-reduction, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: marxin at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109031 --- Comment #10 from Martin Li=C5=A1ka --- (In reply to David Binderman from comment #9) > (In reply to Martin Li=C5=A1ka from comment #8) > > > but then if diff returns 1, the script should return 0 and > > > if diff returns 0, then the script should return 1. > >=20 > > You can take an inspiration here: > > https://github.com/marxin/gcc-util/blob/master/bisect/reduce.sh >=20 > Thanks for that. I am a bit further forward and I have this cvise > script: >=20 > /usr/bin/gcc -w -Werror=3Dimplicit bug892.c -o one.exe > && (./one.exe 1 | fgrep "checksum after hashing g_50 :" > 1)=20 > && /home/dcb36/gcc/results/bin/gcc -w -O2 -fno-strict-aliasing bug892.c= =20 > -o two.exe If the compilation fails for any reason, then the compound && expression is false (non-zero) and thus you end up with 'exit 0'. That's not what you wan= t I guess. What about: /usr/bin/gcc -w -Werror=3Dimplicit bug892.c -o one.exe && (./one.exe 1 | fgrep "checksum after hashing g_50 :" > 1)=20 && /home/dcb36/gcc/results/bin/gcc -w -O2 -fno-strict-aliasing bug8= 92.c=20 -o two.exe && (./two.exe 1 | fgrep "checksum after hashing g_50 :" > 2)=20 if test $? !=3D 0; then=20 exit 1 diff 1 2;=20 if test $? =3D 0; then=20 exit 1 fi exit 0 ? > && (./two.exe 1 | fgrep "checksum after hashing g_50 :" > 2)=20 > && diff 1 2;=20 > if test $? =3D 0; then=20 > exit 1 > fi > exit 0 >=20 > It still doesn't work right and I can't fathom what's wrong. > It all works nicely when I do it line by line.=