public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* tree-ssa bug?
@ 2003-04-03 13:26 Eyal Lebedinsky
  2003-04-03 14:18 ` Eyal Lebedinsky
  2003-04-03 16:27 ` Diego Novillo
  0 siblings, 2 replies; 3+ messages in thread
From: Eyal Lebedinsky @ 2003-04-03 13:26 UTC (permalink / raw)
  To: list, gcc, Eigler, Frank Ch.

Built off CVS branch tree-ssa-20020619-branch.
Linux 2.4, i386

OK, here is another very strange result, took me a bit of time to track
this one down.
  -------------------------------------------
#!/bin/sh

cat >zz.c <<EOF
#include <stdio.h>

#define XXX 2147483647

int main ()
{
        unsigned long count = 8;

        if (count > XXX)
                fprintf (stderr, "wow!\n");

        return (0);
}
EOF

/usr/local/gcc-mudflap/bin/i686-pc-linux-gnu-gcc-3.5-tree-ssa -fmudflap
\
        -Wall -o zz zz.c
./zz
  -------------------------------------------
The reult is:
wow!

Looks like a bug to me. Same result when the constant is
	0x7fffffff
or
	0x7fffffffUL

--
Eyal Lebedinsky (eyal@eyal.emu.id.au) <http://samba.org/eyal/>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: tree-ssa bug?
  2003-04-03 13:26 tree-ssa bug? Eyal Lebedinsky
@ 2003-04-03 14:18 ` Eyal Lebedinsky
  2003-04-03 16:27 ` Diego Novillo
  1 sibling, 0 replies; 3+ messages in thread
From: Eyal Lebedinsky @ 2003-04-03 14:18 UTC (permalink / raw)
  To: list, gcc, Eigler, Frank Ch.

Eyal Lebedinsky wrote:
> 
> Built off CVS branch tree-ssa-20020619-branch.
> Linux 2.4, i386
> 
> OK, here is another very strange result, took me a bit of time to track
> this one down.
> ...
> /usr/local/gcc-mudflap/bin/i686-pc-linux-gnu-gcc-3.5-tree-ssa -fmudflap \
>        -Wall -o zz zz.c

I should say that the -fmudflap is not related to the problem which
shows without it too.

--
Eyal Lebedinsky (eyal@eyal.emu.id.au) <http://samba.org/eyal/>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: tree-ssa bug?
  2003-04-03 13:26 tree-ssa bug? Eyal Lebedinsky
  2003-04-03 14:18 ` Eyal Lebedinsky
@ 2003-04-03 16:27 ` Diego Novillo
  1 sibling, 0 replies; 3+ messages in thread
From: Diego Novillo @ 2003-04-03 16:27 UTC (permalink / raw)
  To: Eyal Lebedinsky; +Cc: gcc

On Thu, 03 Apr 2003, Eyal Lebedinsky wrote:

> Built off CVS branch tree-ssa-20020619-branch.
> Linux 2.4, i386
> 
> OK, here is another very strange result, took me a bit of time to track
> this one down.
>
Good catch.  This was an omission in the new non destructive
folders.  When folding comparisons with signed_max+1 we were
always replacing the comparison with >=.


Diego.

	* fold-const.c (fold_relational_hi_lo): Add missing comparison when
	folding comparisons to signed_max+1.


Index: fold-const.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fold-const.c,v
retrieving revision 1.213.2.25
diff -d -u -p -r1.213.2.25 fold-const.c
--- fold-const.c	27 Feb 2003 18:30:02 -0000	1.213.2.25
+++ fold-const.c	3 Apr 2003 14:14:41 -0000
@@ -4983,7 +4983,7 @@ fold_relational_hi_lo (code_p, type_p, o
 	      st0 = (*lang_hooks.types.signed_type) (TREE_TYPE (op0));
 	      st1 = (*lang_hooks.types.signed_type) (TREE_TYPE (op1));
 
-	      exp = build (LE_EXPR ? GE_EXPR: LT_EXPR,
+	      exp = build (code == LE_EXPR ? GE_EXPR: LT_EXPR,
 			   type,
 			   convert (st0, op0),
 			   convert (st1, integer_zero_node));

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-04-03 14:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-03 13:26 tree-ssa bug? Eyal Lebedinsky
2003-04-03 14:18 ` Eyal Lebedinsky
2003-04-03 16:27 ` Diego Novillo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).