Commit f0aec864 by Mihail Ionescu

[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.
parent 51e010b5
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> 2020-01-21 Jakub Jelinek <jakub@redhat.com>
PR target/93073 PR target/93073
......
...@@ -13751,13 +13751,14 @@ ldm_stm_operation_p (rtx op, bool load, machine_mode mode, ...@@ -13751,13 +13751,14 @@ ldm_stm_operation_p (rtx op, bool load, machine_mode mode,
bool bool
clear_operation_p (rtx op, bool vfp) clear_operation_p (rtx op, bool vfp)
{ {
unsigned regno, last_regno; unsigned regno;
unsigned last_regno = INVALID_REGNUM;
rtx elt, reg, zero; rtx elt, reg, zero;
HOST_WIDE_INT count = XVECLEN (op, 0); int count = XVECLEN (op, 0);
HOST_WIDE_INT i, first_set = vfp ? 1 : 0; int first_set = vfp ? 1 : 0;
machine_mode expected_mode = vfp ? E_SFmode : E_SImode; 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); elt = XVECEXP (op, 0, i);
...@@ -13790,14 +13791,14 @@ clear_operation_p (rtx op, bool vfp) ...@@ -13790,14 +13791,14 @@ clear_operation_p (rtx op, bool vfp)
if (vfp) if (vfp)
{ {
if (i != 1 && regno != last_regno + 1) if (i != first_set && regno != last_regno + 1)
return false; return false;
} }
else else
{ {
if (regno == SP_REGNUM || regno == PC_REGNUM) if (regno == SP_REGNUM || regno == PC_REGNUM)
return false; return false;
if (i != 0 && regno <= last_regno) if (i != first_set && regno <= last_regno)
return false; return false;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment