- if (TYPE_CODE (type) == TYPE_CODE_STRUCT
- || TYPE_CODE (type) == TYPE_CODE_STRUCT
- || TYPE_CODE (type) == TYPE_CODE_ARRAY)
- return RETURN_VALUE_STRUCT_CONVENTION;
+ if (type->code () == TYPE_CODE_STRUCT
+ || type->code () == TYPE_CODE_UNION
+ || type->code () == TYPE_CODE_ARRAY)
+ {
+ /* The default on VAX is to return structures in static memory.
+ Consequently a function must return the address where we can
+ find the return value. */
+
+ if (readbuf)
+ {
+ ULONGEST addr;
+
+ regcache_raw_read_unsigned (regcache, VAX_R0_REGNUM, &addr);
+ read_memory (addr, readbuf, len);
+ }
+
+ return RETURN_VALUE_ABI_RETURNS_ADDRESS;
+ }