diff options
author | Mihail Ionescu <mihail.ionescu@arm.com> | 2020-01-21 10:11:35 +0000 |
---|---|---|
committer | Mihail Ionescu <mihail.ionescu@arm.com> | 2020-01-21 10:11:35 +0000 |
commit | f0aec8643830a50812aeec0296086ed338aac678 (patch) | |
tree | 3b7065a1680c6f78266792418d1929f61d6265f5 /gcc | |
parent | 51e010b5f75c1fff06425a72702c1bf82a3ab053 (diff) | |
download | gcc-f0aec8643830a50812aeec0296086ed338aac678.zip gcc-f0aec8643830a50812aeec0296086ed338aac678.tar.gz gcc-f0aec8643830a50812aeec0296086ed338aac678.tar.bz2 |
[PATCH, GCC/ARM] Fix clear_operation_p uninitialised variable
2020-01-21 Mihail-Calin Ionescu <mihail.ionescu@arm.com>
* gcc/config/arm/arm.c (clear_operation_p):
Initialise last_regno, skip first iteration
based on the first_set value and use ints instead
of the unnecessary HOST_WIDE_INTs.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/config/arm/arm.c | 13 |
2 files changed, 14 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4f38f24..8c17e59 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2020-01-21 Mihail-Calin Ionescu <mihail.ionescu@arm.com> + + * gcc/config/arm/arm.c (clear_operation_p): + Initialise last_regno, skip first iteration + based on the first_set value and use ints instead + of the unnecessary HOST_WIDE_INTs. + 2020-01-21 Jakub Jelinek <jakub@redhat.com> PR target/93073 diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index c47fc23..b54382d 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -13751,13 +13751,14 @@ ldm_stm_operation_p (rtx op, bool load, machine_mode mode, bool clear_operation_p (rtx op, bool vfp) { - unsigned regno, last_regno; + unsigned regno; + unsigned last_regno = INVALID_REGNUM; rtx elt, reg, zero; - HOST_WIDE_INT count = XVECLEN (op, 0); - HOST_WIDE_INT i, first_set = vfp ? 1 : 0; + int count = XVECLEN (op, 0); + int first_set = vfp ? 1 : 0; machine_mode expected_mode = vfp ? E_SFmode : E_SImode; - for (i = first_set; i < count; i++) + for (int i = first_set; i < count; i++) { elt = XVECEXP (op, 0, i); @@ -13790,14 +13791,14 @@ clear_operation_p (rtx op, bool vfp) if (vfp) { - if (i != 1 && regno != last_regno + 1) + if (i != first_set && regno != last_regno + 1) return false; } else { if (regno == SP_REGNUM || regno == PC_REGNUM) return false; - if (i != 0 && regno <= last_regno) + if (i != first_set && regno <= last_regno) return false; } |