https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68384
Bug ID: 68384 Summary: LTO error for global register variables in PHP 7 compiling on powerpc64le Product: gcc Version: 6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: lto Assignee: unassigned at gcc dot gnu.org Reporter: acsawdey at gcc dot gnu.org Target Milestone: --- Created attachment 36734 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36734&action=edit zend.i from reduced test case If you attempt to build PHP 7 with -flto, you encounter errors for the 2 register global variables it uses: zend_execute.i:81:32: error: global register variable follows a function definition register const zend_op *opline __asm__("r29"); ^ zend_execute.i:80:36: error: global register variable follows a function definition register zend_execute_data *execute_data __asm__("r28"); ^ I've reduced this with multidelta and the preprocessed files are attached. Reproduce with: gcc -flto -O3 main.i php_cli.i zend_execute.i zend.i Of course this test case won't link or do anything useful, but it hits the LTO issue before getting to the link phase. I did my testing with trunk 230270, but older gcc 4.8.x also has the same problem.