Patchwork [4/6,AArch64-4.7] Fix warning - aarch64_trampoline_init passes the wrong type to emit_library_call.

login
register
mail settings
Submitter James Greenhalgh
Date Feb. 1, 2013, 5:42 p.m.
Message ID <1359740555-10179-5-git-send-email-james.greenhalgh@arm.com>
Download mbox | patch
Permalink /patch/217549/
State New
Headers show

Comments

James Greenhalgh - Feb. 1, 2013, 5:42 p.m.
Hi,

emit_library_call takes an `enum library_type` as its second argument.
Currently aarch64-4.7-branch passes it an int 0.

This patch fixes this, mirroring trunk, by passing LCT_NORMAL instead.

This patch fixes the warning:

config/aarch64/aarch64.c: In function ‘aarch64_trampoline_init’:
config/aarch64/aarch64.c:3893:8: warning: enum conversion when passing argument 2 of ‘emit_library_call’ is invalid in C++ [-Wc++-compat]

Regression tested on aarch64-none-elf with no regressions.

OK for aarch64-4.7-branch?

Thanks,
James

---
gcc/

2013-02-01  James Greenhalgh  <james.greenhalgh@arm.com>

	* config/aarch64/aarch64.c
	(aarch64_trampoline_init): Pass 'LCT_NORMAL' rather than '0'
	to emit_library_call.
Richard Earnshaw - Feb. 2, 2013, 2:24 p.m.
On 01/02/13 17:42, James Greenhalgh wrote:
>
> Hi,
>
> emit_library_call takes an `enum library_type` as its second argument.
> Currently aarch64-4.7-branch passes it an int 0.
>
> This patch fixes this, mirroring trunk, by passing LCT_NORMAL instead.
>
> This patch fixes the warning:
>
> config/aarch64/aarch64.c: In function ‘aarch64_trampoline_init’:
> config/aarch64/aarch64.c:3893:8: warning: enum conversion when passing argument 2 of ‘emit_library_call’ is invalid in C++ [-Wc++-compat]
>
> Regression tested on aarch64-none-elf with no regressions.
>
> OK for aarch64-4.7-branch?
>
> Thanks,
> James
>
> ---
> gcc/
>
> 2013-02-01  James Greenhalgh  <james.greenhalgh@arm.com>
>
> 	* config/aarch64/aarch64.c
> 	(aarch64_trampoline_init): Pass 'LCT_NORMAL' rather than '0'
> 	to emit_library_call.
>

OK.

R.

Patch

diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index fef2983..434ccd7 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -3952,7 +3952,7 @@  aarch64_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value)
      gen_clear_cache().  */
   a_tramp = XEXP (m_tramp, 0);
   emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__clear_cache"),
-		     0, VOIDmode, 2, a_tramp, Pmode,
+		     LCT_NORMAL, VOIDmode, 2, a_tramp, Pmode,
 		     plus_constant (a_tramp, TRAMPOLINE_SIZE), Pmode);
 }