Skip to content

Commit f26aa77

Browse files
iainscatap
authored andcommitted
Darwin, Arm64 : Account for stack addresses less aligned than DI.
darwinpcs, packs some stack items, which means that one cannot guarantee that they are aligned to DI. Check for these cases and reject PRFM instructions then. Note, that this generally results in use of an extra temporary reg. clang uses 'PRFUM' instructions in those cases, so we have a missed optimisation opportunity (low priority). fixes issue gcc-mirror#16. (cherry picked from commit 534aad5033dc224ed96118b67a84d496bba500ca)
1 parent 410164f commit f26aa77

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

gcc/config/aarch64/aarch64.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9561,6 +9561,10 @@ aarch64_address_valid_for_prefetch_p (rtx x, bool strict_p)
95619561
if (!res)
95629562
return false;
95639563

9564+
/* Darwinpcs allows addresses on the stack that are not DImode aligned. */
9565+
if (TARGET_MACHO && addr.offset && (INTVAL (addr.offset) & 0x07))
9566+
return false;
9567+
95649568
/* ... except writeback forms. */
95659569
return addr.type != ADDRESS_REG_WB;
95669570
}

0 commit comments

Comments
 (0)