score/cpu: Silence ARM and AARCH64 GCC 12 false trigger array warning

The false trigger is covered in:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99578

GCC 11 and 12 has been patched for constant pointer casts above
4K. This code casts a constant pointer within the first 4K
page. As a result the patch disables the warning.

Updates #4662
This commit is contained in:
Chris Johns
2022-06-15 12:57:28 +10:00
parent 1f23640a9b
commit 5262b9c2ab
2 changed files with 7 additions and 1 deletions
+3
View File
@@ -180,6 +180,8 @@ void _CPU_ISR_install_vector(
CPU_ISR_handler *old_handler
)
{
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Warray-bounds"
/* Redirection table starts at the end of the vector table */
CPU_ISR_handler *table = (CPU_ISR_handler *) (MAX_EXCEPTIONS * 4);
@@ -194,6 +196,7 @@ void _CPU_ISR_install_vector(
if (current_handler != new_handler) {
table [vector] = new_handler;
}
#pragma GCC diagnostic pop
}
void _CPU_Initialize( void )
+4 -1
View File
@@ -167,8 +167,10 @@ void _CPU_ISR_install_vector(
CPU_ISR_handler *old_handler
)
{
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Warray-bounds"
/* Redirection table starts at the end of the vector table */
CPU_ISR_handler *table = (CPU_ISR_handler *) (MAX_EXCEPTIONS * 4);
CPU_ISR_handler volatile *table = (CPU_ISR_handler *) (MAX_EXCEPTIONS * 4);
CPU_ISR_handler current_handler = table [vector];
@@ -181,6 +183,7 @@ void _CPU_ISR_install_vector(
if (current_handler != new_handler) {
table [vector] = new_handler;
}
#pragma GCC diagnostic pop
}
void _CPU_Initialize( void )