Re: [PATCH] Expand bitpos to LONGEST to allow access to large offsets within a struct

Siddhesh Poyarekar
2012-02-22T04:04:34Z

On Tue, Feb 21, 2012 at 01:42:23PM -0700, Tom Tromey wrote:
> I think this should fix http://sourceware.org/bugzilla/show_bug.cgi?id=7259.
> If so, at the top of the ChangeLog, write 'PR symtab/7259:'.
>
> If it does fix this PR then this suggests a simple test case that
> doesn't require a huge allocation.

Yes, it does. I'll update the ChangeLog entry.

>
> Most of the patch seems perfectly fine -- just the logical consequence
> of the core change. However there are a few issues, mostly minor.
>

Thanks for your feedback. I'll work on these and send an updated
patch.

On Tue, Feb 21, 2012 at 10:02:35PM +0100, Jan Kratochvil wrote:
> On top of Tom's comments - have you verified you caught all the cases?
> In these cases I use some
> typedef struct { LONGEST x; } LONGESTT;
>
> which is compatible for assignment only with itself catching all the cases.
> Unfortunately one needs to adjust by hand all the arithmetic operations just
> for the purpose of this verification.
>
> I guess there exist better static analysis tools for that.
>

I relied mostly on manual code inspection for this and for gcc to tell
me if something is getting truncated. I'll look for a more formal
method to make sure I have caught all cases.

Thanks,
Siddhesh