From mboxrd@z Thu Jan 1 00:00:00 1970 From: To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org Subject: Re: optimization/3289 Date: Thu, 21 Jun 2001 02:56:00 -0000 Message-id: <20010621095602.1544.qmail@sourceware.cygnus.com> X-SW-Source: 2001-06/msg00885.html List-Id: The following reply was made to PR optimization/3289; it has been noted by GNATS. From: To: , , , , Cc: Subject: Re: optimization/3289 Date: Thu, 21 Jun 2001 11:51:24 +0200 This is a multi-part message in MIME format. ------=_NextPart_000_0022_01C0FA48.7F144CC0 Content-Type: multipart/alternative; boundary="----=_NextPart_001_0023_01C0FA48.7F144CC0" ------=_NextPart_001_0023_01C0FA48.7F144CC0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=3Dview&pr=3D3289&database=3Dgc= c Sorry for the attached file, here is the right one. Thanks JEF P.S.:=20 in case of pbs, here is the exemple : extern __const int *__ctype_tolower; /* Case conversions. */ # define __tobody(c, f, a) \ (__extension__ \ ({ int __res; \ if (sizeof (c) > 1) \ { \ if (__builtin_constant_p (c)) \ { \ int __c =3D (c); \ __res =3D __c < -128 || __c > 255 ? __c : a[__c]; \ } \ else \ __res =3D f (c); \ } \ else \ __res =3D a[(int) (c)]; \ __res; })) # define tolower(c) __tobody (c, tolower, __ctype_tolower) /*-----------------------------------------------------------------------= ------- LOWER- SCO_SV!jef 98/01/29 15:32:16 -------------------------------------------------------------------------= -----*/ static void Lower( string ) char * string; { while( *string ) *string++ =3D tolower( *string ); } /*-----------------------------------------------------------------------= ------- MAIN- Linux!alpha 2001/06/0020 13:25:55 -------------------------------------------------------------------------= -----*/ int main() { char p[] =3D "string"; Lower( p ); printf("(%s)\n", p ); } ------=_NextPart_001_0023_01C0FA48.7F144CC0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
 
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=3Dview&= pr=3D3289&database=3Dgcc
 
Sorry for the attached file,  here = is the=20 right one.
Thanks
JEF
 
P.S.:
in case of pbs, here is the exemple = :
 
 
extern __const int *__ctype_tolower; /* = Case=20 conversions.  */
 
# define __tobody(c, f, a) \
 =20 (__extension__          = ;  =20 \
   ({ int=20 __res;           &= nbsp;=20 \
      if (sizeof (c) >=20 1)           =20 \
 {          &= nbsp;  =20 \
   if (__builtin_constant_p=20 (c))          =20 \
    =20 {            =  =20 \
       int __c =3D=20 (c);           =20 \
       __res =3D __c < -128 || __c = > 255=20 ? __c : a[__c];       =20 \
    =20 }            =  =20 \
  =20 else           &nb= sp; =20 \
     __res =3D f=20 (c);           =20 \
 }          &= nbsp;  =20 \
     =20 else           &nb= sp; =20 \
 __res =3D a[(int)=20 (c)];           =20 \
      __res; }))
 
# define tolower(c) __tobody (c, = tolower,=20 __ctype_tolower)
 
/*--------------------------------------------------------------= ----------------
 LOWER-
SCO_SV!jef=20 98/01/29=20 15:32:16
-------------------------------------------------------------= -----------------*/
 
static void Lower( string )
char *=20 string;
{
 while( *string ) *string++ =3D tolower( = *string=20 );
}
/*------------------------------------------------------------= ------------------
 MAIN-
Linux!alpha=20 2001/06/0020=20 13:25:55
-------------------------------------------------------------= -----------------*/
 
int main()
{
 char p[] =3D=20 "string";
 
 Lower( p = );
 printf("(%s)\n", p=20 );
}
------=_NextPart_001_0023_01C0FA48.7F144CC0-- ------=_NextPart_000_0022_01C0FA48.7F144CC0 Content-Type: application/octet-stream; name="aa.c" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="aa.c" /*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D[ (c) ALPHA SOFT = ]=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= =0A= FICHIER : [aa.c]=0A= =0A= DATE : 2001/06/0020 13:25:21=0A= =0A= CREATEUR : [Linux!alpha]=0A= =0A= COMMENTAIRE :=0A= =0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=0A= --- gcc -v=0A= Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0/specs=0A= Configured with: ./configure --enable-languages=3Dc++=0A= Thread model: single=0A= gcc version 3.0=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D*/=0A= =0A= /* this is an a short cut to my ctype.h tolower function */=0A= =0A= extern __const int *__ctype_tolower; /* Case conversions. */=0A= =0A= # define __tobody(c, f, a) \=0A= (__extension__ \=0A= ({ int __res; \=0A= if (sizeof (c) > 1) \=0A= { \=0A= if (__builtin_constant_p (c)) \=0A= { \=0A= int __c =3D (c); \=0A= __res =3D __c < -128 || __c > 255 ? __c : a[__c]; \=0A= } \=0A= else \=0A= __res =3D f (c); \=0A= } \=0A= else \=0A= __res =3D a[(int) (c)]; \=0A= __res; }))=0A= =0A= # define tolower(c) __tobody (c, tolower, __ctype_tolower)=0A= =0A= /*-----------------------------------------------------------------------= -------=0A= LOWER-=0A= SCO_SV!jef 98/01/29 15:32:16=0A= -------------------------------------------------------------------------= -----*/=0A= =0A= static void Lower( string )=0A= char * string;=0A= {=0A= while( *string ) *string++ =3D tolower( *string );=0A= }=0A= /*-----------------------------------------------------------------------= -------=0A= MAIN-=0A= Linux!alpha 2001/06/0020 13:25:55=0A= -------------------------------------------------------------------------= -----*/=0A= =0A= int main()=0A= {=0A= char p[] =3D "string";=0A= =0A= Lower( p );=0A= printf("(%s)\n", p );=0A= }=0A= =0A= ------=_NextPart_000_0022_01C0FA48.7F144CC0--