Andrew Geissler | 9347dd4 | 2023-03-03 12:38:41 -0600 | [diff] [blame^] | 1 | From 096150fa19014b397a5d8f8d774bb8236ac37679 Mon Sep 17 00:00:00 2001 |
| 2 | From: Shyamanth RH <shyamanth.rh@arm.com> |
| 3 | Date: Wed, 4 Jan 2023 13:08:35 +0530 |
| 4 | Subject: [PATCH] Fix for issue #245 |
| 5 | |
| 6 | * The change fixes the build issue observed in GCC 12.XX. |
| 7 | * Looks like GCC is confusing label to a local variable and hence triggers dangling-pointer error when a label addres is assigned to a pointer. |
| 8 | * Changed branch_to_test from void * pointer to uint64_t datatype since we just need the retrun address of the label while updating the ELR. This should suppress the dangling-pinter warning thrown by GCC 12.XX |
| 9 | |
| 10 | Signed-off-by: Shyamanth RH <shyamanth.rh@arm.com> |
| 11 | Upstream-Status: Backport |
| 12 | --- |
| 13 | test_pool/peripherals/test_d003.c | 6 +++--- |
| 14 | 1 file changed, 3 insertions(+), 3 deletions(-) |
| 15 | |
| 16 | diff --git a/test_pool/peripherals/test_d003.c b/test_pool/peripherals/test_d003.c |
| 17 | index 9f36e1f..0658a45 100755 |
| 18 | --- a/test_pool/peripherals/test_d003.c |
| 19 | +++ b/test_pool/peripherals/test_d003.c |
| 20 | @@ -30,7 +30,7 @@ |
| 21 | |
| 22 | static uint64_t l_uart_base; |
| 23 | static uint32_t int_id; |
| 24 | -static void *branch_to_test; |
| 25 | +static uint64_t branch_to_test; |
| 26 | static uint32_t test_fail; |
| 27 | |
| 28 | static |
| 29 | @@ -40,7 +40,7 @@ esr(uint64_t interrupt_type, void *context) |
| 30 | uint32_t index = val_pe_get_index_mpid(val_pe_get_mpid()); |
| 31 | |
| 32 | /* Update the ELR to point to next instrcution */ |
| 33 | - val_pe_update_elr(context, (uint64_t)branch_to_test); |
| 34 | + val_pe_update_elr(context, branch_to_test); |
| 35 | |
| 36 | val_print(AVS_PRINT_ERR, "\n Error : Received Sync Exception type %d", interrupt_type); |
| 37 | val_set_status(index, RESULT_FAIL(g_sbsa_level, TEST_NUM, 01)); |
| 38 | @@ -150,7 +150,7 @@ payload(void) |
| 39 | val_pe_install_esr(EXCEPT_AARCH64_SYNCHRONOUS_EXCEPTIONS, esr); |
| 40 | val_pe_install_esr(EXCEPT_AARCH64_SERROR, esr); |
| 41 | |
| 42 | - branch_to_test = &&exception_taken; |
| 43 | + branch_to_test = (uint64_t)&&exception_taken; |
| 44 | |
| 45 | if (count == 0) { |
| 46 | val_print(AVS_PRINT_WARN, "\n No UART defined by Platform ", 0); |