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]

# in constraints in asm statements.



GCC was complaining that '#' was not a valid character in a
constraint...  This fixes it.  glibc uses this on powerpc.  I have
included a testcase, which I'll add to the testsuite.

Tested on powerpc-linux.

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

===File ~/patches/cygnus/gcc-asmhashmark.patch==============
2000-09-19  Geoff Keating  <geoffk@cygnus.com>

	* stmt.c (expand_asm_operands): Allow # in constraints.

Index: stmt.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/stmt.c,v
retrieving revision 1.169
diff -p -u -u -p -r1.169 stmt.c
--- stmt.c	2000/09/19 13:39:10	1.169
+++ stmt.c	2000/09/22 14:49:58
@@ -1476,7 +1476,7 @@ expand_asm_operands (string, outputs, in
 	      }
 	    break;
 
-	  case '?':  case '!':  case '*':  case '&':
+	  case '?':  case '!':  case '*':  case '&':  case '#':
 	  case 'E':  case 'F':  case 'G':  case 'H':
 	  case 's':  case 'i':  case 'n':
 	  case 'I':  case 'J':  case 'K':  case 'L':  case 'M':
@@ -1658,7 +1658,7 @@ expand_asm_operands (string, outputs, in
 	    break;
 
 	  case '<':  case '>':
-	  case '?':  case '!':  case '*':
+	  case '?':  case '!':  case '*':  case '#':
 	  case 'E':  case 'F':  case 'G':  case 'H':
 	  case 's':  case 'i':  case 'n':
 	  case 'I':  case 'J':  case 'K':  case 'L':  case 'M':
============================================================

===File
~/cygnus/co/egcs-mainline/egcs/gcc/testsuite/gcc.c-torture/compile/20000922-1.c===
extern void doit(int);
void 
quick_doit(int x)
{
#ifdef __OPTIMIZE__
  if (__builtin_constant_p (x)
      && x != 0)
    asm volatile ("%0" : : "i#*X"(x));
  else
#endif
    doit(x);
}
============================================================

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