This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/12113] [tree-ssa] wrong result for comparison
- From: "steven at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 7 Sep 2003 14:46:38 -0000
- Subject: [Bug middle-end/12113] [tree-ssa] wrong result for comparison
- References: <20030831004855.12113.eyal@eyal.emu.id.au>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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...