Avoid explicit use of machine modes (6/n) objc/objc-act.c
Hans-Peter Nilsson
hp@bitrange.com
Tue Sep 30 02:56:00 GMT 2003
On Mon, 29 Sep 2003, Zack Weinberg wrote:
> objc-act.c uses mode numbers to determine the encoding of type
> strings. I looked into matching what cp/mangle.c does when faced with
> a similar problem (it uses itk_* numbers) but I did not think I could
> guarantee no ABI changes if I did that. So I just made the codes
> depend on the mode bitsizes instead of the modes directly.
> + switch (GET_MODE_BITSIZE (TYPE_MODE (type)))
> + case 8: c = TREE_UNSIGNED (type) ? 'C' : 'c'; break;
> + case 16: c = TREE_UNSIGNED (type) ? 'S' : 's'; break;
> + case 32:
> - if (TYPE_MODE (type) == QImode)
> - obstack_1grow (&util_obstack, 'C');
I think you still changed the ABI for e.g. c4x, where
BITS_PER_UNIT is 32 and thus QImode is 32 bits. I don't imagine
that it matters for that target though, but checking the results
after dividing by BITS_PER_UNIT might have helped.
brgds, H-P
More information about the Gcc-patches
mailing list