From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 26586385802F; Thu, 1 Feb 2024 13:06:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 26586385802F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1706792767; bh=5aIL7wVQRLI4RYl99dXEUf64Q+lZl3tjL6Se+3pgAI8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Om7fobKd0Iz19/REACae1/06wLyNM2By7sVoPDfbJ40yToCeMBUrGyqzCkHpx8X+p +u5JoEDBgoLolkIs4hgBTjMUhY8V5iiANG7kgiWYuXNqpPk4sUKFD+UuzuG4shwkUH pkjW8GX1L6FYi+AQxV3xEU6cbklUQ3kEC7dggI5M= From: "pan2.li at intel dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/51492] vectorizer does not support saturated arithmetic patterns Date: Thu, 01 Feb 2024 13:06:06 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 4.6.2 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: pan2.li at intel dot com X-Bugzilla-Status: NEW 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=3D51492 --- Comment #7 from Li Pan --- RISC-V backend reproduce code, build with "-march=3Drv64gcv_zba_zbb_zbc_zbs --param=3Driscv-autovec-preference=3Dfixed-vlmax -Ofast -ffast-math" typedef unsigned short uint16_t; void AAA (uint16_t *x, uint16_t *y, unsigned wsize, unsigned count) { unsigned m =3D 0, n =3D count; register uint16_t *p; p =3D x; do { m =3D *--p; *p =3D (uint16_t)(m >=3D wsize ? m-wsize : 0); } while (--n); n =3D wsize; p =3D y; do { m =3D *--p; *p =3D (uint16_t)(m >=3D wsize ? m-wsize : 0); } while (--n); }=