Re: More fun with aliasing - removing assignments?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> > OK, thanks.  That settles it then.
> 
> Just to close out this thread for the record, Andrew Pinski opened PR
> 23912 for this problem, and Diego checked in a patch for the 4.0
> br
> n
> h.  So all should be well in 4.0.2.
> 

And the alias analyzer for 4.1 has tihs code, which is why it comes up
with the right answer:

  case NOP_EXPR:
          case CONVERT_EXPR:
          case NON_LVALUE_EXPR:
            {
              tree op = TREE_OPERAND (t, 0);

              /* Cast from non-pointer to pointers are bad news for us.
                 Anything else, we see through */
              if (!(POINTER_TYPE_P (TREE_TYPE (t))
                    && ! POINTER_TYPE_P (TREE_TYPE (op))))
                return get_constraint_for (op);

              /* FALLTHRU  */

    }
          default:
            {
              temp.type = ADDRESSOF;
              temp.var = anything_id;
              temp.offset = 0;
              return temp;
            }


We special case casts from integer constants like 0 (somewhere else) :)


I decided it wasn't worth trying to change years of practice of "let's
cast integers to pointers" by trying to sneak this in.
I'd rathre just watch as all their code explodes for other reasons, like
trying to cast pointers to unsigned int's on a 64 bit machine with LP64
models.



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux