This is the mail archive of the gcc-patches@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]

Using GAS on AIX



This patch fixes some problems with using GAS and GCC together on AIX.
Apparently, the AIX assembler doesn't check for the POWER forms of
opcodes.

It also fixes the `alias' attribute.  With this and a patch for GAS
which I'm also about to commit, it now actually works on AIX.

-- 
- Geoffrey Keating <geoffk@cygnus.com>

===File ~/patches/cygnus/rs6000-aixgas.patch================
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/rs6000/Attic/ChangeLog,v
retrieving revision 1.1.2.26
diff -p -u -u -p -r1.1.2.26 ChangeLog
--- ChangeLog	2000/01/31 15:59:31	1.1.2.26
+++ ChangeLog	2000/01/31 18:55:16
@@ -1,3 +1,10 @@
+2000-01-30  Geoff Keating  <geoffk@cygnus.com>
+
+	* rs6000.h (ASM_OUTPUT_DEF_FROM_DECLS): New macro.
+
+	* rs6000.md (stmw): Use the right POWER opcode.
+	(lmw): Likewise.
+
 2000-01-31  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
 	* rs6000-protos.h: New file.
Index: rs6000.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/rs6000/rs6000.h,v
retrieving revision 1.64.2.12
diff -p -u -u -p -r1.64.2.12 rs6000.h
--- rs6000.h	2000/01/31 15:59:31	1.64.2.12
+++ rs6000.h	2000/01/31 18:55:16
@@ -2449,6 +2449,36 @@ do {						\
   fputc('\n', FILE);				\
 } while (0)
 
+/* This implementes the `alias' attribute.  */
+
+#define ASM_OUTPUT_DEF_FROM_DECLS(FILE,decl,target)	\
+do {							\
+  char * alias = XSTR (XEXP (DECL_RTL (decl), 0), 0);	\
+  char * name = IDENTIFIER_POINTER (target);		\
+  if (TREE_CODE (decl) == FUNCTION_DECL			\
+      && DEFAULT_ABI == ABI_AIX)			\
+    {							\
+      if (TREE_PUBLIC (decl))				\
+	{						\
+	  fputs ("\t.globl .", FILE);			\
+	  RS6000_OUTPUT_BASENAME (FILE, alias);		\
+	  putc ('\n', FILE);				\
+	}						\
+      else						\
+	{						\
+	  fputs ("\t.lglobl .", FILE);			\
+	  RS6000_OUTPUT_BASENAME (FILE, alias);		\
+	  putc ('\n', FILE);				\
+	}						\
+      fputs ("\t.set .", FILE);				\
+      RS6000_OUTPUT_BASENAME (FILE, alias);		\
+      fputs (",.", FILE);				\
+      RS6000_OUTPUT_BASENAME (FILE, name);		\
+      fputc ('\n', FILE);				\
+    }							\
+  ASM_OUTPUT_DEF (FILE, alias, name);			\
+} while (0)
+
 /* Output to assembler file text saying following lines
    may contain character constants, extra white space, comments, etc.  */
 
Index: rs6000.md
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/rs6000/rs6000.md,v
retrieving revision 1.79.2.12
diff -p -u -u -p -r1.79.2.12 rs6000.md
--- rs6000.md	2000/01/29 01:23:37	1.79.2.12
+++ rs6000.md	2000/01/31 18:55:16
@@ -11044,7 +11044,7 @@
 		  [(set (match_operand:SI 1 "memory_operand" "=m")
        			(match_operand:SI 2 "gpc_reg_operand" "r"))])]
  "TARGET_MULTIPLE"
- "stmw %2,%1")
+ "{stm|stmw} %2,%1")
  
 (define_insn "*save_fpregs_si"
  [(match_parallel 0 "any_operand"
@@ -11114,7 +11114,7 @@
 		  [(set (match_operand:SI 1 "gpc_reg_operand" "=r")
        			(match_operand:SI 2 "memory_operand" "m"))])]
  "TARGET_MULTIPLE"
- "lmw %1,%2")
+ "{lm|lmw} %1,%2")
  
 (define_insn "*return_internal_si"
   [(use (match_operand:SI 0 "register_operand" "l"))
============================================================

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