From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id EA4EE3858D37; Sun, 22 Oct 2023 02:48:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EA4EE3858D37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1697942910; bh=uot4C5V9qUjPVyTfFFfoKKKdK+Fu8DLGQHcFDBWNeOc=; h=From:To:Subject:Date:From; b=bM0GchtrKyCK5oAJHwWbceYe2rrlqp6pRU8dEavuttQL//JKHTwmVs5pqQtTNsxE7 SEZ72DKYueCoucF2c77KmkHnFhgrcCGvu5nogdghEPgoZHF4ng88da+izU0TTBKYxg Ln9WgFkQgbW5uXy9OJyuiMehKXWTtlhEW1jlf2mA= From: "141242068 at smail dot nju.edu.cn" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/111915] New: GCC: ICEs on a program with __restrict and option `-O2 -fno-tree-vrp -fno-tree-dominator-opts -fno-tree-ccp` Date: Sun, 22 Oct 2023 02:48:29 +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: 141242068 at smail dot nju.edu.cn 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=3D111915 Bug ID: 111915 Summary: GCC: ICEs on a program with __restrict and option `-O2 -fno-tree-vrp -fno-tree-dominator-opts -fno-tree-ccp` Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: 141242068 at smail dot nju.edu.cn Target Milestone: --- When compile this program, GCC crashes: ``` void=20 foo (int * __restrict a, int * __restrict b, int * __restrict w) { for (int i =3D 0; i < 16; ++i) { *a +=3D w[2*i+0]; *b +=3D w[2*i&1]; } } int main() { int w[32]; int a =3D 0, b =3D 0; foo (&a, b, w); return 0; } ``` Compiler Explorer: https://gcc.godbolt.org/z/8oYjE3e9j The crash seems to be triggered solely under specific conditions: when the -fno-tree-vrp, -fno-tree-dominator-opts, and -fno-tree-ccp options are enab= led, in conjunction with an optimization level of -O2 or higher. However, I'm uncertain whether this combination of settings violates on any internal conventions or requirements tied to these options. The full stack dump: ``` : In function 'main': :15:12: warning: passing argument 2 of 'foo' makes pointer from int= eger without a cast [-Wint-conversion] 15 | foo (&a, b, w); | ^ | | | int :2:43: note: expected 'int * restrict' but argument is of type 'int' 2 | foo (int * __restrict a, int * __restrict b, int * __restrict w) | ~~~~~~~~~~~~~~~~~^ : In function 'foo': :2:1: error: definition in block 3 follows the use 2 | foo (int * __restrict a, int * __restrict b, int * __restrict w) | ^~~ for SSA_NAME: _12 in statement: vect_cst__35 =3D {_12, _12, _12, _12}; during GIMPLE pass: vect :2:1: internal compiler error: verify_ssa failed 0x231f49e internal_error(char const*, ...) ???:0 0x139c15e verify_ssa(bool, bool) ???:0 Please submit a full bug report, with preprocessed source (by using -freport-bug). Please include the complete backtrace with any bug report. See for instructions. ```=