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: MIPS patch for execute/921117-1.c


The patch that changed this is:
Tue Nov  4 18:32:44 1997  Jim Wilson  <wilson@cygnus.com>

        * mips.md (insv, extzv, extv): Add change_address call.
        (movsi_ulw, movsi_usw): Change QImode to BLKmode in pattern.
	* mips.c (mips_expand_epilogue): Emit blockage insn before call to
        save_restore_insns if no FP and GP will be restored.

At this time, the checks for overlapping MEMs in the alias code used the mode
to compute the size of the reference.  Using QImode pretty obviously fails,
since a 4 (or 8) byte reference was considered to be a 1 byte reference, and
we would miss the fact that it did overlap other MEMs.

I don't recall exactly why I didn't use SImode/DImode here, but I can make
a guess.  If you use BLKmode, then you are safe from type based aliasing that
is based on the MEM mode.  If you use SImode/DImode, then type based aliasing
may accidentally trigger when you didn't want it to.  In the aliasing code
that existed at the time I made this change, we were using MEM_IN_STRUCT_P and
rtx_addr_varies_p for type based aliasing, and rtx_addr_varies_p handles
BLKmode specially.

In the current code, it looks like we use the MEM_SIZE attribute when trying
to detect when two mems overlap, so it looks like using QImode and setting
the MEM_SIZE attribute would work fine.  Using QImode avoids type based
aliasing problems, and MEM_SIZE gets the overlapping address range problem
right.  I think use of SImode or DImode could still fail due to type based
aliasing.

Jim


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