This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/78764] New: CPU type option discarded on 32-bit powerpc


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78764

            Bug ID: 78764
           Summary: CPU type option discarded on 32-bit powerpc
           Product: gcc
           Version: 5.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rin at NetBSD dot org
  Target Milestone: ---

Created attachment 40300
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40300&action=edit
restrict usage of ".machine" pseudo-op to 64-bit powerpc

GCC >= 4.8.5 passes ".machine ppc" pseudo-op to assembler for 32-bit
powerpc, which is introduced by this commit:

 
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=5379d8d457b300219d3d8eda38caaa9916f98078

This pseudo-op discards CPU type specified by compiler option
"-mcpu=XXX" or "-Wa,-mXXX". As a result, some mnemonics in inline
assembler codes are misassembled into instructions for generic ppc.
This results in broken kernel for NetBSD on IBM 405, where indices
of some special purpose registers are different from those in
generic ppc, cf. NetBSD PR port-powerpc/51366:

  http://gnats.netbsd.org/51366

The commit raised above seem to be intended for 64-bit powerpc;
without it, gas cannot assemble codes generated by GCC for 64-bit
powerpc. I therefore propose to restrict usage of ".machine" pseudo-
op to the 64-bit CPUs. Please find the attached file. This is for
GCC 5.4.0, but it can be applied to the master branch as of today.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]