Hi,
In config/aarch64/aarch64.c::aarch64_add_constant `shift' was
declared after we started writing code. C90 doesn't like this,
so split the declaration and the assignment.
This fixes the warning:
config/aarch64/aarch64.c: In function ‘aarch64_add_constant’:
config/aarch64/aarch64.c:2249:4: warning: ISO C90 forbids mixed declarations
and code [-pedantic]
Regression tested on aarch64-none-elf with no regressions.
OK for aarch64-4.7-branch?
Thanks,
James
---
gcc/
2013-02-01 James Greenhalgh <[email protected]>
* config/aarch64/aarch64.c
(aarch64_add_constant): Move declaration of 'shift' above code.
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index 59124eb..62d0a12 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -2307,8 +2307,9 @@ aarch64_add_constant (int regnum, int scratchreg, HOST_WIDE_INT delta)
{
if (mdelta >= 4096)
{
+ rtx shift;
emit_insn (gen_rtx_SET (Pmode, scratch_rtx, GEN_INT (mdelta / 4096)));
- rtx shift = gen_rtx_ASHIFT (Pmode, scratch_rtx, GEN_INT (12));
+ shift = gen_rtx_ASHIFT (Pmode, scratch_rtx, GEN_INT (12));
if (delta < 0)
emit_insn (gen_rtx_SET (Pmode, this_rtx,
gen_rtx_MINUS (Pmode, this_rtx, shift)));