<div dir="ltr">Agree, there is no point in features that cannot be used. The only excuse for huge array support is that gcc supports them. If it is not a problem, emitting an error looks as the best solution.</div><div class="gmail_extra">
<br><br><div class="gmail_quote">2013/7/15 David Chisnall <span dir="ltr"><<a href="mailto:David.Chisnall@cl.cam.ac.uk" target="_blank">David.Chisnall@cl.cam.ac.uk</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On 12 Jul 2013, at 19:38, Serge Pavlov <<a href="mailto:sepavloff@gmail.com">sepavloff@gmail.com</a>> wrote:<br>
<br>
> Hi all,<br>
><br>
> There are several bugs, manifested as a crash when clang treats really huge arrays (PRs 8256, 12816, 15216). The arrays are so huge that bit size cannot be represented by 64-bit integer.<br>
><br>
> There are several ways to fix these defects.<br>
><br>
> 1. Emit an error if the array size cannot be represented by 64-bit number. In this case changes to the clang sources are minimal. However some arrays accepted by GCC would be rejected.<br>
> 2. Use bytes to represent size and alignment of a type. It looks like values other than multiples of 8 aren't used.<br>
> 3. Represent the bit size by some new type, say BitUnits (similar to CharUnits). This type could allocate more space to represent all possible values of bit size, or use some encoding to pack any bit size into uint64_t (for instance to store the size in bytes, if it is larger that some value).<br>
><br>
> Probably using bytes to represent size and alignment is the most natural way to fix these problems. Is there a need to keep size/alignment with bit precision?<br>
><br>
> Any thoughts?<br>
<br>
</div></div>What is the use case for this? I am not aware of any existing platforms that support more than 2^56 bytes of virtual address space and so such an array would be impossible to represent in the TLB, let alone in physical memory. I'd have thought that the correct solution would be for clang to emit a 'this array is bigger than your target platform can handle' error until someone brings out some hardware that actually supports 64-bit virtual address spaces.<br>
<span class="HOEnZb"><font color="#888888"><br>
David<br>
<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>Thanks,<br>--Serge<br>
</div>