]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
cselib: Skip BImode while keeping track of subvalue relations [PR107088]
authorStefan Schulze Frielinghaus <stefansf@linux.ibm.com>
Thu, 6 Oct 2022 06:43:53 +0000 (08:43 +0200)
committerStefan Schulze Frielinghaus <stefansf@linux.ibm.com>
Thu, 6 Oct 2022 06:43:53 +0000 (08:43 +0200)
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.

gcc/cselib.cc

index 9b582e5d3d6db03dd6e47d331830a5ef04fcae31..2abc763a3f8ed4f7bb2460b8fd9cba94b6520b59 100644 (file)
@@ -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)))
     {