On 03/03/12 08:41, Paul Richard Thomas wrote:
> Dear Tobias,
> 
> This is certainly OK for 4.8.
> 
> I have a couple of remarks:
> (i) The DTYPE_TYPE_MASK is 0x38 so that we saturated it a long time
> since!  At the moment it does not cause any problems because of the
> extremely limited use of the dtype 'type'.

Hi,

AFAIU, you're saying here that since there are very few uses of the type part of
dtype, it's not a problem.

But at the moment, BT_ASSUMED with value 11 bleeds into the size part of dtype.

In gfc_get_dtype_rank_type, we just set the type directly without applying the 
mask:
...
  i = rank | (n << GFC_DTYPE_TYPE_SHIFT);
...

In fact, the mask seems completely unused.

>  Whilst the array
> descriptor revamp will eliminate such worries, we should be mindful of
> this; and

I think that if we have a mask that we're not respecting, we need to clearly
document at the definiton how that's done and why that's not a problem. And
ideally, add some asserts to detect when we break that allowed usage pattern.

Thanks,
- Tom

Reply via email to