Commit 754c3d5d by Richard Sandiford Committed by Richard Sandiford

rtl.h (mem_attrs): Turn offset and size fields into HOST_WIDE_INTs.

gcc/
	* rtl.h (mem_attrs): Turn offset and size fields into HOST_WIDE_INTs.
	Add offset_known_p and size_known_p fields.
	(MEM_OFFSET_KNOWN_P): Update accordingly.
	(MEM_OFFSET, MEM_SIZE_KNOWN_P, MEM_SIZE): Likewise.
	* emit-rtl.c (mem_attrs_htab_hash): Update after mem_attrs changes.
	(mem_attrs_eq_p, set_mem_attributes_minus_bitpos, set_mem_offset)
	(clear_mem_offset, set_mem_size, clear_mem_size, change_address)
	(adjust_address_1, widen_memory_access, set_mem_attrs_for_spill)
	(init_emit_regs): Likewise.

From-SVN: r176478
parent 527210c4
2011-07-19 Richard Sandiford <rdsandiford@googlemail.com> 2011-07-19 Richard Sandiford <rdsandiford@googlemail.com>
* rtl.h (mem_attrs): Turn offset and size fields into HOST_WIDE_INTs.
Add offset_known_p and size_known_p fields.
(MEM_OFFSET_KNOWN_P): Update accordingly.
(MEM_OFFSET, MEM_SIZE_KNOWN_P, MEM_SIZE): Likewise.
* emit-rtl.c (mem_attrs_htab_hash): Update after mem_attrs changes.
(mem_attrs_eq_p, set_mem_attributes_minus_bitpos, set_mem_offset)
(clear_mem_offset, set_mem_size, clear_mem_size, change_address)
(adjust_address_1, widen_memory_access, set_mem_attrs_for_spill)
(init_emit_regs): Likewise.
2011-07-19 Richard Sandiford <rdsandiford@googlemail.com>
* doc/rtl.texi (MEM_OFFSET_KNOWN_P): Document. * doc/rtl.texi (MEM_OFFSET_KNOWN_P): Document.
(MEM_OFFSET): Change from returning an rtx to returning a (MEM_OFFSET): Change from returning an rtx to returning a
HOST_WIDE_INT. HOST_WIDE_INT.
......
...@@ -136,19 +136,38 @@ typedef struct ...@@ -136,19 +136,38 @@ typedef struct
/* Structure used to describe the attributes of a MEM. These are hashed /* Structure used to describe the attributes of a MEM. These are hashed
so MEMs that the same attributes share a data structure. This means so MEMs that the same attributes share a data structure. This means
they cannot be modified in place. If any element is nonzero, it means they cannot be modified in place. */
the value of the corresponding attribute is unknown. */
/* ALIGN and SIZE are the alignment and size of the MEM itself,
while EXPR can describe a larger underlying object, which might have a
stricter alignment; OFFSET is the offset of the MEM within that object. */
typedef struct GTY(()) mem_attrs typedef struct GTY(()) mem_attrs
{ {
tree expr; /* expr corresponding to MEM. */ /* The expression that the MEM accesses, or null if not known.
rtx offset; /* Offset from start of DECL, as CONST_INT. */ This expression might be larger than the memory reference itself.
rtx size; /* Size in bytes, as a CONST_INT. */ (In other words, the MEM might access only part of the object.) */
alias_set_type alias; /* Memory alias set. */ tree expr;
unsigned int align; /* Alignment of MEM in bits. */
unsigned char addrspace; /* Address space (0 for generic). */ /* The offset of the memory reference from the start of EXPR.
Only valid if OFFSET_KNOWN_P. */
HOST_WIDE_INT offset;
/* The size of the memory reference in bytes. Only valid if
SIZE_KNOWN_P. */
HOST_WIDE_INT size;
/* The alias set of the memory reference. */
alias_set_type alias;
/* The alignment of the reference in bits. Always a multiple of
BITS_PER_UNIT. Note that EXPR may have a stricter alignment
than the memory reference itself. */
unsigned int align;
/* The address space that the memory reference uses. */
unsigned char addrspace;
/* True if OFFSET is known. */
bool offset_known_p;
/* True if SIZE is known. */
bool size_known_p;
} mem_attrs; } mem_attrs;
/* Structure used to describe the attributes of a REG in similar way as /* Structure used to describe the attributes of a REG in similar way as
...@@ -1303,19 +1322,19 @@ do { \ ...@@ -1303,19 +1322,19 @@ do { \
#define MEM_EXPR(RTX) (get_mem_attrs (RTX)->expr) #define MEM_EXPR(RTX) (get_mem_attrs (RTX)->expr)
/* For a MEM rtx, true if its MEM_OFFSET is known. */ /* For a MEM rtx, true if its MEM_OFFSET is known. */
#define MEM_OFFSET_KNOWN_P(RTX) (get_mem_attrs (RTX)->offset != NULL_RTX) #define MEM_OFFSET_KNOWN_P(RTX) (get_mem_attrs (RTX)->offset_known_p)
/* For a MEM rtx, the offset from the start of MEM_EXPR. */ /* For a MEM rtx, the offset from the start of MEM_EXPR. */
#define MEM_OFFSET(RTX) INTVAL (get_mem_attrs (RTX)->offset) #define MEM_OFFSET(RTX) (get_mem_attrs (RTX)->offset)
/* For a MEM rtx, the address space. */ /* For a MEM rtx, the address space. */
#define MEM_ADDR_SPACE(RTX) (get_mem_attrs (RTX)->addrspace) #define MEM_ADDR_SPACE(RTX) (get_mem_attrs (RTX)->addrspace)
/* For a MEM rtx, true if its MEM_SIZE is known. */ /* For a MEM rtx, true if its MEM_SIZE is known. */
#define MEM_SIZE_KNOWN_P(RTX) (get_mem_attrs (RTX)->size != NULL_RTX) #define MEM_SIZE_KNOWN_P(RTX) (get_mem_attrs (RTX)->size_known_p)
/* For a MEM rtx, the size in bytes of the MEM. */ /* For a MEM rtx, the size in bytes of the MEM. */
#define MEM_SIZE(RTX) INTVAL (get_mem_attrs (RTX)->size) #define MEM_SIZE(RTX) (get_mem_attrs (RTX)->size)
/* For a MEM rtx, the alignment in bits. We can use the alignment of the /* For a MEM rtx, the alignment in bits. We can use the alignment of the
mode as a default when STRICT_ALIGNMENT, but not if not. */ mode as a default when STRICT_ALIGNMENT, but not if not. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment