Hi,
On trunk and 4.7 __aarch64_sync_cache_range gives a missing prototype
warning and two "statement with no effect" warnings as so:
---
.../libgcc/config/aarch64/sync-cache.c:22:1: warning: no previous prototype for
'__aarch64_sync_cache_range' [-Wmissing-prototypes]
__aarch64_sync_cache_range (const void *base, const void *end)
^
.../libgcc/config/aarch64/sync-cache.c: In function
'__aarch64_sync_cache_range':
/work/oban-clean/src/gcc/libgcc/config/aarch64/sync-cache.c:46:3: warning:
statement with no effect [-Wunused-value]
for (address; address < (const char *) end; address += dcache_lsize)
^
.../libgcc/config/aarch64/sync-cache.c:58:3: warning: statement with no effect
[-Wunused-value]
for (address; address < (const char *) end; address += icache_lsize)
---
This patch silences these warnings by declaring a prototype for
aarch64_sync_cache_range and removing the no-op for loop initialisation
Regression tested on aarch64-none-linux-gnu with no issues.
OK for trunk/aarch64-4.7-branch?
Thanks,
James Greenhalgh
---
libgcc/
2013-03-01 James Greenhalgh <[email protected]>
* config/aarch64/sync-cache.c
(__aarch64_sync_cache_range): Silence warnings.
diff --git a/libgcc/config/aarch64/sync-cache.c b/libgcc/config/aarch64/sync-cache.c
index 7091c48..3397e9d 100644
--- a/libgcc/config/aarch64/sync-cache.c
+++ b/libgcc/config/aarch64/sync-cache.c
@@ -18,6 +18,8 @@
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
+void __aarch64_sync_cache_range (const void *, const void *);
+
void
__aarch64_sync_cache_range (const void *base, const void *end)
{
@@ -43,7 +45,7 @@ __aarch64_sync_cache_range (const void *base, const void *end)
address = (const char*) ((__UINTPTR_TYPE__) base
& ~ (__UINTPTR_TYPE__) (dcache_lsize - 1));
- for (address; address < (const char *) end; address += dcache_lsize)
+ for (; address < (const char *) end; address += dcache_lsize)
asm volatile ("dc\tcvau, %0"
:
: "r" (address)
@@ -55,7 +57,7 @@ __aarch64_sync_cache_range (const void *base, const void *end)
address = (const char*) ((__UINTPTR_TYPE__) base
& ~ (__UINTPTR_TYPE__) (icache_lsize - 1));
- for (address; address < (const char *) end; address += icache_lsize)
+ for (; address < (const char *) end; address += icache_lsize)
asm volatile ("ic\tivau, %0"
:
: "r" (address)