This is the mail archive of the gcc-bugs@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]
Other format: [Raw text]

[Bug middle-end/12113] [tree-ssa] wrong result for comparison


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12113


steven at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dnovillo at redhat dot com


------- Additional Comments From steven at gcc dot gnu dot org  2003-09-07 14:46 -------
Hmm weird,

If I compile this code,

int main (void)
{
  char *s = "012345678901234567890123I567890";
  printf ("%c\n", (char)(s[24] & 0x000000ff));
  if ('I' ==  (char)(s[24] & 0x0ff))
    return (0);
  else
    abort ();
}

then my .t02.optimized dump looks like this,
                                                                                
;; Function main (main)
;; enabled by -tree-original
                                                                                
                                                                                
{
   char* s = ("012345678901234567890123I567890");
   printf(("%c\n"), (*(s + 24) & '\xffffffff'));
   if (0)
      return <return-value> = 0;
   else
       abort();
                                                                                
}

Note the difference between the two printf lines. 

Also weird that the first s[24] expr is not folded but the second is...


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