Changes from teg@redhat.com - subtle bugs that only show up under

certain circumstances.


include/global.h:
  Fix for gcc with strict aliasing.
  Thanks to teg@redhat.com for the patch.
strings/strstr-sparc.s:
  %g6 -> %o2
  %g6 and %g7 are reserved for OS use by Sun's ABI.
  Thanks to teg@redhat.com for the patch.
This commit is contained in:
unknown 2000-11-06 12:23:19 -05:00
parent 6cffc526b5
commit a948b3d66b
2 changed files with 10 additions and 6 deletions

View File

@ -682,10 +682,14 @@ typedef char bool; /* Ordinary boolean values 0 1 */
*((T)+4)=(uchar) (((A) >> 32)); }
#define int8store(T,A) *((ulonglong *) (T))= (ulonglong) (A)
#define doubleget(V,M) { *((long *) &V) = *((long*) M); \
*(((long *) &V)+1) = *(((long*) M)+1); }
#define doublestore(T,V) { *((long *) T) = *((long*) &V); \
*(((long *) T)+1) = *(((long*) &V)+1); }
typedef union {
double v;
long m[2];
} doubleget_union;
#define doubleget(V,M) { ((doubleget_union *)&V)->m[0] = *((long*) M); \
((doubleget_union *)&V)->m[1] = *(((long*) M)+1); }
#define doublestore(T,V) { *((long *) T) = ((doubleget_union *)&V)->m[0]; \
*(((long *) T)+1) = ((doubleget_union *)&V)->m[1]; }
#define float4get(V,M) { *((long *) &(V)) = *((long*) (M)); }
#define float8get(V,M) doubleget((V),(M))
#define float4store(V,M) memcpy((byte*) V,(byte*) (&M),sizeof(float))

View File

@ -31,12 +31,12 @@ strstr:
! if (*str++ == *search) {
! i=(char*) str; j=(char*) search+1;
ldsb [%o1],%g6 ! g6= First char of search
ldsb [%o1],%o2 ! g6= First char of search
.top:
ldsb [%o0],%g3 ! g3= First char of rest of str
cmp %g3,0
be .abort ! Found end null ;
cmp %g3,%g6
cmp %g3,%o2
bne .top
add %o0,1,%o0