From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4D7BF3858C2A; Tue, 10 Oct 2023 14:30:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4D7BF3858C2A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1696948250; bh=EJy0ysOI7kF5yXEhz9v0ZEEXPlp6AFNjSioCMDGr4/s=; h=From:To:Subject:Date:From; b=S1TM6hAKfVuz80kFoUmDkvz3lLjm+g1/4rfq8/iYRBArMdva6tsqP6lfLcPHDmiNQ 6MsT/cJeFwSjSsOioz5d1oxgYHlNc7Y8vLQOHcrHlNzDjKr5hES6XeKcTB/cC2a4q0 P34JMKvEd9S7F6nJTXwvRHFtxIKP535dIQxzpjyg= From: "juzhe.zhong at rivai dot ai" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/111761] New: risc-v regression: COND_LEN_* incorrect fold/simplify in middle-end Date: Tue, 10 Oct 2023 14:30:49 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: juzhe.zhong at rivai dot ai 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=3D111761 Bug ID: 111761 Summary: risc-v regression: COND_LEN_* incorrect fold/simplify in middle-end Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: juzhe.zhong at rivai dot ai Target Milestone: --- FAIL: gcc.dg/vect/vect-cond-arith-2.c -flto -ffat-lto-objects scan-tree-du= mp optimized " =3D \\.COND_(LEN_)?SUB" FAIL: gcc.dg/vect/vect-cond-arith-2.c scan-tree-dump optimized " =3D \\.COND_(LEN_)?SUB" https://godbolt.org/z/hEz51qf6a double __GIMPLE (ssa, startwith("loop")) neg_xi (double *x) { int i; long unsigned int index; long unsigned int offset; double * xi_ptr; double xi; double neg_xi; double res; unsigned int ivtmp; __BB(5): goto __BB2; __BB(2): res_1 =3D __PHI (__BB5: 0.0, __BB3: res_2); i_4 =3D __PHI (__BB5: 0, __BB3: i_5); ivtmp_6 =3D __PHI (__BB5: 100U, __BB3: ivtmp_7); index =3D (long unsigned int) i_4; offset =3D index * 8UL; xi_ptr =3D x_8(D) + offset; xi =3D *xi_ptr; neg_xi =3D -xi; res_2 =3D neg_xi + res_1; i_5 =3D i_4 + 1; ivtmp_7 =3D ivtmp_6 - 1U; if (ivtmp_7 !=3D 0U) goto __BB3; else goto __BB4; __BB(3): goto __BB2; __BB(4): res_3 =3D __PHI (__BB2: res_2); return res_3; } There is no COND_LEN_ADD IR here which is incorrect.=