From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7806) id 60F83384D16C; Thu, 6 Oct 2022 06:47:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 60F83384D16C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1665038845; bh=31Ix56VT+1mMifpShSjyw9nnQXmt4T0eeUqfB5GKLcg=; h=From:To:Subject:Date:From; b=KsL0EAjnaCJEF8TH2oVUL/Ti8HT7WQ8xMT6Kw/pRICChXKOihLefXRID9y9P1FkUr cOINPtfhZLbb6bgrwBoelO3knoEeEZEPm7pFNkY38HHRxnhtSpIXzU157T8q8tCUqo WqGjW2lsKbrvtNz7YOKs/l7uyAZ9qAW5lKBCYdhE= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Stefan Schulze Frielinghaus To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-3105] cselib: Skip BImode while keeping track of subvalue relations [PR107088] X-Act-Checkin: gcc X-Git-Author: Stefan Schulze Frielinghaus X-Git-Refname: refs/heads/master X-Git-Oldrev: e9d50e7a4e290d7476cc7e6b5a8f2f1fb496c570 X-Git-Newrev: 5fc4d3e1837ea4850aac6460f563913f1d3fc5b8 Message-Id: <20221006064725.60F83384D16C@sourceware.org> Date: Thu, 6 Oct 2022 06:47:25 +0000 (GMT) List-Id: https://gcc.gnu.org/g:5fc4d3e1837ea4850aac6460f563913f1d3fc5b8 commit r13-3105-g5fc4d3e1837ea4850aac6460f563913f1d3fc5b8 Author: Stefan Schulze Frielinghaus Date: Thu Oct 6 08:43:53 2022 +0200 cselib: Skip BImode while keeping track of subvalue relations [PR107088] For BImode get_narrowest_mode evaluates to QImode but BImode < QImode. Thus FOR_EACH_MODE_UNTIL never reaches BImode and iterates until OImode for which no wider mode exists so we end up with VOIDmode and fail. Fixed by adding a size guard so we effectively skip BImode. gcc/ChangeLog: PR rtl-optimization/107088 * cselib.cc (new_cselib_val): Skip BImode while keeping track of subvalue relations. Diff: --- gcc/cselib.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/gcc/cselib.cc b/gcc/cselib.cc index 9b582e5d3d6..2abc763a3f8 100644 --- a/gcc/cselib.cc +++ b/gcc/cselib.cc @@ -1571,6 +1571,7 @@ new_cselib_val (unsigned int hash, machine_mode mode, rtx x) scalar_int_mode int_mode; if (REG_P (x) && is_int_mode (mode, &int_mode) + && GET_MODE_SIZE (int_mode) > 1 && REG_VALUES (REGNO (x)) != NULL && (!cselib_current_insn || !DEBUG_INSN_P (cselib_current_insn))) {