VLA representation in GCC internals

Alejandro Colomar alx@kernel.org
Fri Nov 8 23:54:17 GMT 2024


Hi Martin,

I'm in the process of rebasing my __countof__ changes after your patch
that fixes support for [*] and [0].

I should update the implementation of the following function:

	static bool
	is_top_array_vla (tree type)
	{
	  bool zero, star, var;
	  tree d;

	  if (TREE_CODE (type) != ARRAY_TYPE)
	    return false;
	  if (!COMPLETE_TYPE_P (type))
	    return false;

	  d = TYPE_DOMAIN (type);
	  zero = !TYPE_MAX_VALUE (d);
	  star = (zero && C_TYPE_VARIABLE_SIZE (type));
	  if (star)
	    return true;
	  if (zero)
	    return false;

	  var = (TREE_CODE (TYPE_MIN_VALUE (d)) != INTEGER_CST
		|| TREE_CODE (TYPE_MAX_VALUE (d)) != INTEGER_CST);
	  return var;
	}

The 'star' calculation should be updated.  Would you mind proposing an
implementation of this function that works with your changes?  Thanks!

Have a lovely night!
Alex


-- 
<https://www.alejandro-colomar.es/>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20241109/303cd516/attachment.sig>


More information about the Gcc mailing list