From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 772123858033; Thu, 4 Jan 2024 02:21:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 772123858033 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1704334914; bh=ifz4DOIQxKoWcb4EUxkzn9xMT9AKS4syE9IEKeqoA5Y=; h=From:To:Subject:Date:From; b=VSkjz9cJR5him8wd6utm4nG09qduPSXzLgdj+oz9Gz7VxvS/OIu6Ov/rUHDrSbVGP FPlnsuCV/YT0ecF7RaNfppMbIRuch8CYu7Zv+h0zWTa9/GEIOLyexZj1o513EOLoWt mtwbwa8B0+f/9QEnCyGRVWKh/XbHbwzvXQo919JA= From: "syq at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/113227] New: Maybe optimization (a>0) && (b>0) with or&<0 Date: Thu, 04 Jan 2024 02:21:53 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: syq 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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=3D113227 Bug ID: 113227 Summary: Maybe optimization (a>0) && (b>0) with or&<0 Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: syq at gcc dot gnu.org Target Milestone: --- _Bool f (int a, int b) { return a > 0 && b > 0; } _Bool f (int a, int b) { _Bool _1; _Bool _6; _Bool _7; [local count: 1073741824]: _6 =3D b_3(D) > 0; _7 =3D a_2(D) > 0; _1 =3D _6 & _7; return _1; } maybe we can do it like this? _Bool f (int a, int b) { int _1 =3D (a | b); return ((_1) > 0); }=