+2018-07-25 Claudiu Zissulescu <claziss@synopsys.com>
+
+ * config/arc/arc.c (compact_memory_operand_p): Check for uncached
+ accesses as well.
+ (arc_is_uncached_mem_p): uncached applies to both the variable and
+ the pointer.
+
2018-07-25 Claudiu Zissulescu <claziss@synopsys.com>
* config/arc/arc.h (ADDITIONAL_REGISTER_NAMES): Add additional
if (MEM_VOLATILE_P (op) && !TARGET_VOLATILE_CACHE_SET)
return false;
+ /* likewise for uncached types. */
+ if (arc_is_uncached_mem_p (op))
+ return false;
+
if (mode == VOIDmode)
mode = GET_MODE (op);
bool
arc_is_uncached_mem_p (rtx pat)
{
- tree attrs;
- tree ttype;
- struct mem_attrs *refattrs;
+ tree attrs = NULL_TREE;
+ tree addr;
if (!MEM_P (pat))
return false;
/* Get the memory attributes. */
- refattrs = MEM_ATTRS (pat);
- if (!refattrs
- || !refattrs->expr)
+ addr = MEM_EXPR (pat);
+ if (!addr)
return false;
- /* Get the type declaration. */
- ttype = TREE_TYPE (refattrs->expr);
- if (!ttype)
- return false;
+ /* Get the attributes. */
+ if (TREE_CODE (addr) == MEM_REF)
+ {
+ attrs = TYPE_ATTRIBUTES (TREE_TYPE (addr));
+ if (lookup_attribute ("uncached", attrs))
+ return true;
- /* Get the type attributes. */
- attrs = TYPE_ATTRIBUTES (ttype);
- if (lookup_attribute ("uncached", attrs))
- return true;
+ attrs = TYPE_ATTRIBUTES (TREE_TYPE (TREE_OPERAND (addr, 0)));
+ if (lookup_attribute ("uncached", attrs))
+ return true;
+ }
+
+ /* For COMPONENT_REF, use the FIELD_DECL from tree operand 1. */
+ if (TREE_CODE (addr) == COMPONENT_REF)
+ {
+ attrs = TYPE_ATTRIBUTES (TREE_TYPE (TREE_OPERAND (addr, 1)));
+ if (lookup_attribute ("uncached", attrs))
+ return true;
+ }
return false;
}
+2018-07-25 Claudiu Zissulescu <claziss@synopsys.com>
+
+ * gcc.target/arc/uncached-1.c: New test.
+ * gcc.target/arc/uncached-2.c: Likewise.
+
2018-07-24 Martin Sebor <msebor@redhat.com>
PR tree-optimization/86622
--- /dev/null
+/* { dg-do compile } */
+
+void clkgen_switch(unsigned int base, unsigned int offset, int val)
+{
+ volatile unsigned int __attribute__ ((uncached)) *dest =
+ (volatile unsigned int __attribute__ ((uncached)) *) (base + offset);
+ *dest = val;
+}
+/* { dg-final { scan-assembler-times "st\.di" 1 } } */