(sparc_type_code): Don't put more than 30 bits of info

into the variable qualifiers.

From-SVN: r7123
This commit is contained in:
Jim Wilson 1994-04-21 12:49:26 -07:00
parent c1da1f33b7
commit aee2c3c58e
1 changed files with 11 additions and 3 deletions

View File

@ -2886,6 +2886,11 @@ sparc_type_code (type)
register unsigned long qualifiers = 0;
register unsigned shift = 6;
/* Only the first 30 bits of the qualifer are valid. We must refrain from
setting more, since some assemblers will give an error for this. Also,
we must be careful to avoid shifts of 32 bits or more to avoid getting
unpredictable results. */
for (;;)
{
switch (TREE_CODE (type))
@ -2894,14 +2899,16 @@ sparc_type_code (type)
return qualifiers;
case ARRAY_TYPE:
qualifiers |= (3 << shift);
if (shift < 30)
qualifiers |= (3 << shift);
shift += 2;
type = TREE_TYPE (type);
break;
case FUNCTION_TYPE:
case METHOD_TYPE:
qualifiers |= (2 << shift);
if (shift < 30)
qualifiers |= (2 << shift);
shift += 2;
type = TREE_TYPE (type);
break;
@ -2909,7 +2916,8 @@ sparc_type_code (type)
case POINTER_TYPE:
case REFERENCE_TYPE:
case OFFSET_TYPE:
qualifiers |= (1 << shift);
if (shift < 30)
qualifiers |= (1 << shift);
shift += 2;
type = TREE_TYPE (type);
break;