https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84486
Bug ID: 84486 Summary: code hoisting removes alignment assumption Product: gcc Version: 7.3.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: krebbel at gcc dot gnu.org Target Milestone: --- Created attachment 43473 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43473&action=edit Autoreduced testcase The __atomic_compare_exchange_n builtin on s390 uses the cdsg (compare and swap double) instruction for 16 byte aligned operands and falls back to a library call otherwise. Since the code hoisting change r238242 alignment hints applied with __builtin_assume_aligned appear to get lost and we get a library call for the attached testcase. hardware instruction: -O1 libatomic call with: -O1 -fcode-hoisting