RFA: Define EXTRA_MEMORY_CONSTRAINT for FRV

Nick Clifton nickc@redhat.com
Tue Sep 5 13:11:00 GMT 2006


Hi Aldy, Hi Alex,

  The Linux kernel developers working on the FRV port recently ran
  across a problem with the gcc 4.x series not being able to handle a
  "U" constraint inside an asm statement.  eg:

  void jump3(unsigned long *ppte, unsigned long pte, unsigned long n)
  {
    ppte[n] = pte;
    asm volatile("dcf %M0" :: "U"(ppte[n]));
  }

  The solution I found was to define EXTRA_MEMORY_CONSTRAINT and
  have it treat the U constraint as another kind of memory
  constraint.

  So - may I apply the patch below please ?  It also treats the R and
  T as memory constraints although I have not tested these.  I did
  test the patch by compiling the test fragment above, but the
  FRV toolchain itself does not build due to the problem reported in
  PR 28583.

Cheers
  Nick

gcc/ChangeLog
2006-09-05  Nick Clifton  <nickc@redhat.com>

	* config/frv/frv.h (EXTRA_MEMORY_CONSTRAINT): Define.

Index: gcc/config/frv/frv.h
===================================================================
--- gcc/config/frv/frv.h	(revision 116693)
+++ gcc/config/frv/frv.h	(working copy)
@@ -1376,6 +1376,9 @@ extern enum reg_class reg_class_from_let
    : (C) == 'U' ? EXTRA_CONSTRAINT_FOR_U (VALUE)			\
    : 0)
 
+#define EXTRA_MEMORY_CONSTRAINT(C,STR) \
+  ((C) == 'U' || (C) == 'R' || (C) == 'T')
+
 #define CONSTRAINT_LEN(C, STR) \
   ((C) == 'D' ? 3 : DEFAULT_CONSTRAINT_LEN ((C), (STR)))
 



More information about the Gcc-patches mailing list