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] mem-ref2 merge, core patch


On 06/29/2010 11:03 AM, Richard Guenther wrote:
          if (code == ALIGN_INDIRECT_REF)
            {
              int align = TYPE_ALIGN_UNIT (type);
              op0 = gen_rtx_AND (address_mode, op0, GEN_INT (-align));
              op0 = memory_address_addr_space (mode, op0, as);
            }

we seem to rely on combine or whatever to do fancy things

No, the AND is getting into the expansion directly if it is a legitimate address.

Which is a hack, right? With the plan I have in mind we'd have


   ptr&= 3;  // align the pointer
   .. = *p;   // aligned load

which should expand fine (to an AND and to an aligned load).  Then
combine can combine those two insns just fine to the aligning load.

Not necessarily a hack; I could say that a BIT_AND_EXPR on a pointer, with a pointer-typed operand 1 0xFFFFFFF0, is also a hack...


But if TER or fwprop can create the addresses already, that's fine by me.

Paolo


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