Skip to content

Commit c08c727

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 3fae26f commit c08c727

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
@@ -9615,6 +9615,10 @@ aarch64_address_valid_for_prefetch_p (rtx x, bool strict_p)
96159615
if (!res)
96169616
return false;
96179617

9618+
/* Darwinpcs allows addresses on the stack that are not DImode aligned. */
9619+
if (TARGET_MACHO && addr.offset && (INTVAL (addr.offset) & 0x07))
9620+
return false;
9621+
96189622
/* ... except writeback forms. */
96199623
return addr.type != ADDRESS_REG_WB;
96209624
}

0 commit comments

Comments
 (0)