[parisc-linux] GCC 4.1.1 generates invalid mfctl,w asm instruction

Guy Martin gmsoft at tuxicoman.be
Tue Jan 30 07:19:34 MST 2007


Hi all,

Reference : http://h21007.www2.hp.com/dspp/tech/tech_TechDocumentDetailPage_IDX/1,1701,959!114!244,00.html

According this doc, the ,w completer of the mfctl instruction is only used for the cr11 register. This is the way binutils handle it.
However, gcc will generate the following instruction "mfctl,w %%cr27,%0" while compiling glibc-2.5 on pa2.0.

This little patch fix this :

diff -uNr gcc-4.1.1.orig/gcc/config/pa/pa.md gcc-4.1.1/gcc/config/pa/pa.md
--- gcc-4.1.1.orig/gcc/config/pa/pa.md  2007-01-30 06:59:07.579391048 +0000
+++ gcc-4.1.1/gcc/config/pa/pa.md       2007-01-30 07:23:29.213188936 +0000
@@ -9854,7 +9854,7 @@
   [(set (match_operand:SI 0 "register_operand" "=r")
        (unspec:SI [(const_int 0)] UNSPEC_TP))]
   ""
-  "{mfctl|mfctl,w} %%cr27,%0"
+  "mfctl %%cr27,%0"
   [(set_attr "type" "multi")
    (set_attr "length" "4")])


Please review.


Regards,
  Guy


-- 
Guy Martin
Gentoo Linux - HPPA port Lead




More information about the parisc-linux mailing list