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 tree-optimization/53986] missing vrp on bit-mask test, LSHIFT_EXPR not handled


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

--- Comment #5 from Steven Bosscher <steven at gcc dot gnu.org> 2012-08-05 11:35:40 UTC ---
Just to illustrate:
$ cat t.c
#include <stdio.h>
int
main (void)
{
  int cases[] = { -16, -12, -9, -17 };
  int i, v;
  printf ("Show why cast must happen after add. T==1 iff (D.1732_8 != 0)\n");
  printf ("%-12s%-12s%-12s%-12s\t T T\n",
          "s_1", "(u)s_1", "s_1+16", "((u)s_1)+16");
  for (i = 0; i < 4; i++)
    {
      int v = cases[i];
      unsigned int uv = (unsigned) v;
      printf ("%-12d%-12u%-12d%-12u\t%2d%2d\n",
          v, uv, v+16, uv+16,
          (v+16) > 7, (uv+16) > 7);
    }
  return 0;
}
$ gcc t.c
$ ./a.out 
Show why cast must happen after add. T==1 iff (D.1732_8 != 0)
s_1         (u)s_1      s_1+16      ((u)s_1)+16      T T
-16         4294967280  0           0                0 0
-12         4294967284  4           4                0 0
-9          4294967287  7           7                0 0
-17         4294967279  -1          4294967295       0 1
$


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