From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C22F63858C41; Tue, 5 Mar 2024 08:58:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C22F63858C41 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1709629092; bh=PKTofG+n0SsofqB9T5YjLoPH7Xw7bpB+hcEV/9RRIMI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=rvgv4En6qhLiUJTNfoTupeMD8hZGbwUshiGI93HTZliEffNwrVClI12FjM2EyxCqV aZWYgtyDcpqO+pODc61a/w/cdv1mGxXXEyEFidtV8b9MFNCty/t+rInW5uID1EZtYz Z9ZpcE+AFYaC9X8P8ACLUFJ2DCWS4vvbVoO9kG6I= From: "belagod at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/114108] [14 regression] ICE when building opencv-4.8.1 (error: type mismatch in binary expression) since r14-1833 Date: Tue, 05 Mar 2024 08:58:12 +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: 14.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: belagod at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: belagod at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.0 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=3D114108 --- Comment #8 from Tejas Belagod --- I find this transformation a bit odd: ... pr114108.c:11:21: note: add new stmt: vect_patt_32.15_181 =3D .ABD (vect__3.11_177, vect__7.14_180); pr114108.c:11:21: note: ------>vectorizing statement: patt_31 =3D (unsigned char) patt_32; pr114108.c:11:21: note: transform statement. pr114108.c:11:21: note: vect_is_simple_use: operand .ABD (_3, _7), type of def: internal pr114108.c:11:21: note: vect_is_simple_use: vectype vector([16,16]) unsign= ed char pr114108.c:11:21: note: transform assignment. pr114108.c:11:21: note: vect_get_vec_defs_for_operand: patt_32 pr114108.c:11:21: note: vect_is_simple_use: operand .ABD (_3, _7), type of def: internal pr114108.c:11:21: note: def_stmt =3D patt_32 =3D .ABD (_3, _7); pr114108.c:11:21: note: add new stmt: vect_patt_31.16_182 =3D VIEW_CONVERT_EXPR(vect_patt_32.15_181); ... This seems to have a cascading effect on the MIN_EXPR vectorization: pr114108.c:11:21: note: ------>vectorizing statement: patt_30 =3D (int) pa= tt_31; pr114108.c:11:21: note: ------>vectorizing statement: _11 =3D dst_18(D) + = _1; pr114108.c:11:21: note: ------>vectorizing statement: patt_29 =3D MIN_EXPR ; pr114108.c:11:21: note: transform statement. pr114108.c:11:21: note: vect_is_simple_use: operand (unsigned char) patt_3= 2, type of def: internal pr114108.c:11:21: note: vect_is_simple_use: vectype vector([16,16]) signed char=20 pr114108.c:11:21: note: vect_is_simple_use: operand 127, type of def: cons= tant pr114108.c:11:21: note: transform binary/unary operation. pr114108.c:11:21: note: vect_get_vec_defs_for_operand: patt_31 pr114108.c:11:21: note: vect_is_simple_use: operand (unsigned char) patt_3= 2, type of def: internal pr114108.c:11:21: note: def_stmt =3D patt_31 =3D (unsigned char) patt_3= 2; pr114108.c:11:21: note: vect_get_vec_defs_for_operand: 127 pr114108.c:11:21: note: vect_is_simple_use: operand 127, type of def: cons= tant pr114108.c:11:21: note: created new init_stmt: vect_cst__183 =3D { 127, ..= . }; pr114108.c:11:21: note: add new stmt: vect_patt_29.17_184 =3D MIN_EXPR ; I suspect that when narrowing analysis drops patt_30 =3D (int) patt_31; and replaces patt_30 in MIN_EXPR directly with patt_31, the pre-computed vector type_out for patt_30 =3D (int) patt_31; might be getting reused without get= ting recomputed. Still digging to see if this theory holds water...=