From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B0A34392DFF6; Fri, 7 Jun 2024 08:17:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B0A34392DFF6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1717748278; bh=tLbiWt+Iz2qxWYKTzuNMsdSZOI24db6xCgkkutArxe0=; h=From:To:Subject:Date:From; b=FhqAP5CTxGjy22Rl0TeIiB7czAvJu7Ls4TqNtmKc+/73kJbDrk88UznBIPfLcXbAH QK6U+2OxLQIUhrroSNyREaa35+p+CUqbqtQFBAbLAbYOZ2GKXbiqIVy7Ej7PG77zwv WR3aWlpRcrWzI0ZicRD38uUVwy87pzFh0DCJNFsQ= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/115382] New: Wrong code with in-order conditional reduction and masked loops Date: Fri, 07 Jun 2024 08:17:55 +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: 15.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth 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=3D115382 Bug ID: 115382 Summary: Wrong code with in-order conditional reduction and masked loops Product: gcc Version: 15.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: rguenth at gcc dot gnu.org Target Milestone: --- vectorize_fold_left_reduction does if (LOOP_VINFO_FULLY_MASKED_P (loop_vinfo)) mask =3D vect_get_loop_mask (loop_vinfo, gsi, masks, vec_num, vecty= pe_in, i); else if (is_cond_op) mask =3D vec_opmask[i]; that doesn't work - both masks have to be combined. This for example shows in a runfail of gcc.dg/vect/vect-cond-reduc-in-order-2-signed-zero.c with -march=3Dcascadelake --param vect-partial-vector-usage=3D2 on x86_64. The len-masking code looks good.=