middle-end: intialize regnum in store_bit_field_1
authorTamar Christina <tamar.christina@arm.com>
Tue, 30 Aug 2022 06:48:21 +0000 (07:48 +0100)
committerTamar Christina <tamar.christina@arm.com>
Tue, 30 Aug 2022 06:48:21 +0000 (07:48 +0100)
This initializes regnum to 0 for when undefined_p.
0 is the right default as it's supposed to get the lowpart
when undefined.

gcc/ChangeLog:

* expmed.cc (store_bit_field_1): Initialize regnum to 0.

gcc/expmed.cc

index 8d7418b..cdc0adb 100644 (file)
@@ -794,7 +794,7 @@ store_bit_field_1 (rtx str_rtx, poly_uint64 bitsize, poly_uint64 bitnum,
         words or to cope with mode punning between equal-sized modes.
         In the latter case, use subreg on the rhs side, not lhs.  */
       rtx sub;
-      HOST_WIDE_INT regnum;
+      HOST_WIDE_INT regnum = 0;
       poly_uint64 regsize = REGMODE_NATURAL_SIZE (GET_MODE (op0));
       if (known_eq (bitnum, 0U)
          && known_eq (bitsize, GET_MODE_BITSIZE (GET_MODE (op0))))