This is the mail archive of the newlib@sources.redhat.com mailing list for the newlib 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]

PATCH: Add missing clobber in xscale's strchr routine


Hi Guys,

  The hand crafted strchr() routine for the XScale is missing a
  clobber, which can, under some circumstances, cause gcc to generate
  bad code.  Fixed as obvious by the patch below.

Cheers
        Nick

2002-02-20  Nick Clifton  <nickc@cambridge.redhat.com>

	* libc/machine/xscale/strchr.c (strchr): Add 'r1' to the list of
	clobbered registers.

Index: newlib/libc/machine/xscale/strchr.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/machine/xscale/strchr.c,v
retrieving revision 1.1
diff -c -3 -p -w -r1.1 strchr.c
*** strchr.c	2000/11/30 01:57:27	1.1
--- strchr.c	2002/02/20 14:35:42
*************** strchr (const char *s, int c)
*** 60,66 ****
  1:"
         : "=&r" (s)
         : "r" (c2), "0" (s)
!        : "r2", "r3", "r5", "r6", "cc");
  #endif
  
    while (*s && *s != c)
--- 60,66 ----
  1:"
         : "=&r" (s)
         : "r" (c2), "0" (s)
!        : "r1", "r2", "r3", "r5", "r6", "cc");
  #endif
  
    while (*s && *s != c)


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