This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: comparisons..
- To: andrewm at uow dot edu dot au
- Subject: Re: comparisons..
- From: "Martin v. Loewis" <martin at loewis dot home dot cs dot tu-berlin dot de>
- Date: Thu, 13 Jul 2000 08:49:32 +0200
- CC: gcc at gcc dot gnu dot org
- References: <396D3B72.8A9426EA@uow.edu.au>
> unsigned long x;
>
> int y()
> {
> return (x < 0);
> }
>
> This is usually a bug. Is there a way of getting gcc to warn about it?
GCC knows exactly that the expression is zero; with -O2
-fomit-frame-pointer, it generates
y:
xorl %eax,%eax
ret
However, what exactly is the "usual" bug here? That an expression can
be computed statically?
Regards,
Martin