This is the mail archive of the gcc-patches@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]

Re: [patch] tree-vrp.c: Avoid VR_ANTI_RANGE in a binary expression.



On Jun 22, 2005, at 11:21 AM, Diego Novillo wrote:


On Tue, Jun 21, 2005 at 10:25:42AM -0400, Kazu Hirata wrote:

Tested on x86_64-pc-linux-gnu. OK to apply?

No. ~[0,0] * ~[0,0] == ~[0,0].

Your test needs to be less broad.  It will probably be sufficient
to do this inside the handler for PLUS_EXPR.

It is also MINUS_EXPR too. Wrong, this is also miscompiled as unsigned overflow is defined: unsigned int f(unsigned char a, unsigned char b) { unsigned char c; if (a != 0) if (b != 0) { c = ((unsigned)a)*((unsigned)b); printf("c=%d\n", c); if (c!=0) abort(); } }

int main(void)
{
  f(0x80,0x80);
  return 0;
}

Thanks,
Andrew Pinski


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