On Thu, Jul 2, 2009 at 3:46 PM, Andrew Stubbs wrote:
> On 02/07/09 14:34, Richard Guenther wrote:
>>
>> No, that's invalid. You would have to do
>>
>> extern union {
>> void *foo;
>> short *bar;
>> };
>>
>> using the union for the double-indirect pointer doesn't help. Or
>> simply use memcpy
Andrew Stubbs wrote:
> On 02/07/09 14:34, Richard Guenther wrote:
>> No, that's invalid. You would have to do
>>
>> extern union {
>>void *foo;
>>short *bar;
>> };
>>
>> using the union for the double-indirect pointer doesn't help. Or
>> simply use memcpy to store to foo.
>
> Ah, I did n
On 02/07/09 14:34, Richard Guenther wrote:
No, that's invalid. You would have to do
extern union {
void *foo;
short *bar;
};
using the union for the double-indirect pointer doesn't help. Or
simply use memcpy to store to foo.
Ah, I did not know that. I still don't understand how a refe
On Thu, Jul 2, 2009 at 3:29 PM, Andrew Stubbs wrote:
> On 02/07/09 14:26, Richard Guenther wrote:
>>
>> You are writing to memory of type void * via an lvalue of type short *.
>
> Yes, there is type punning there, but that should work, shouldn't it?
No, that's invalid. You would have to do
exter
On 02/07/09 14:26, Richard Guenther wrote:
You are writing to memory of type void * via an lvalue of type short *.
Yes, there is type punning there, but that should work, shouldn't it?
This code is distilled from some glibc code I'm having trouble with.
Andrew
On Thu, Jul 2, 2009 at 3:21 PM, Andrew Stubbs wrote:
> Hi all,
>
> I'm fairly sure I have found an aliasing bug in GCC, although I could be
> wrong. I've reproduced it in both 4.4 and mainline.
>
> Consider this testcase, aliasing.c:
>
> extern void *foo;
>
> extern inline short **
> f1 (v