Hi James, Thanks for the review and suggestions regarding the testcase.
>> Why limit the ABI and endianness here, and if you do plan to do that Extra options have been dropped and the testcase will check across all variants and endianness. Please find attached the modified patch as per the comments and let me know if its okay? Thanks, Naveen
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index dab46b5..9fce849 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -1302,7 +1302,8 @@ aarch64_load_symref_appropriately (rtx dest, rtx imm, emit_move_insn (gp_rtx, gen_rtx_HIGH (Pmode, s)); if (mode != GET_MODE (gp_rtx)) - gp_rtx = simplify_gen_subreg (mode, gp_rtx, GET_MODE (gp_rtx), 0); + gp_rtx = gen_lowpart (mode, gp_rtx); + } if (mode == ptr_mode) diff --git a/gcc/testsuite/gcc.c-torture/compile/pr71112.c b/gcc/testsuite/gcc.c-torture/compile/pr71112.c new file mode 100644 index 0000000..69e2df6 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr71112.c @@ -0,0 +1,10 @@ +/* PR target/71112. */ +/* { dg-additional-options "-fpie" { target pie } } */ + +extern int dbs[100]; +void f (int *); +int nscd_init (void) +{ + f (dbs); + return 0; +}