From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C27313858284; Wed, 2 Aug 2023 19:44:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C27313858284 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1691005476; bh=h+iLUgSoVWPCNObnt+tIexzmE9qnejGnNg6ZhqoHAZY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=aSWlVWG2g5Ve8ao8NWieAKOUG9vYr42aMHz+eE+Nk8raDOpiw9Rv29FuAZplXLDAr A+qXb33c+kpp7Z/k5SmZ24D4HqDhgxYW+ks6eUblMCAFyuXJN1KWplmpsAYeoQS656 z0Od603umH8EFjDKUBR/eHPjKpS/eJkGilZqFd+Y= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/110869] [14 regression] ICE in decompose, at rtl.h:2297 Date: Wed, 02 Aug 2023 19:44:36 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org 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: 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=3D110869 --- Comment #8 from CVS Commits --- The master branch has been updated by Stefan Schulze Frielinghaus : https://gcc.gnu.org/g:41ef5a34161356817807be3a2e51fbdbe575ae85 commit r14-2932-g41ef5a34161356817807be3a2e51fbdbe575ae85 Author: Stefan Schulze Frielinghaus Date: Wed Aug 2 21:43:22 2023 +0200 rtl-optimization/110867 Fix narrow comparison of memory and constant In certain cases a constant may not fit into the mode used to perform a comparison. This may be the case for sign-extended constants which are used during an unsigned comparison as e.g. in (set (reg:CC 100 cc) (compare:CC (mem:SI (reg/v/f:SI 115 [ a ]) [1 *a_4(D)+0 S4 A64]) (const_int -2147483648 [0xffffffff80000000]))) Fixed by ensuring that the constant fits into comparison mode. Furthermore, on some targets as e.g. sparc the constant used in a comparison is chopped off before combine which leads to failing test cases (see PR 110869). Fixed by not requiring that the source mode has to be DImode, and excluding sparc from the last two test cases entirely since there the constant cannot be further reduced. gcc/ChangeLog: PR rtl-optimization/110867 * combine.cc (simplify_compare_const): Try the optimization only in case the constant fits into the comparison mode. gcc/testsuite/ChangeLog: PR rtl-optimization/110869 * gcc.dg/cmp-mem-const-1.c: Relax mode for constant. * gcc.dg/cmp-mem-const-2.c: Relax mode for constant. * gcc.dg/cmp-mem-const-3.c: Relax mode for constant. * gcc.dg/cmp-mem-const-4.c: Relax mode for constant. * gcc.dg/cmp-mem-const-5.c: Exclude sparc since here the constant is already reduced. * gcc.dg/cmp-mem-const-6.c: Exclude sparc since here the constant is already reduced.=