On Wed, Oct 20, 2010 at 10:29 AM, Albert Cahalan wrote:
> On Thu, Sep 30, 2010 at 5:39 AM, Richard Guenther
> wrote:
>> On Thu, Sep 30, 2010 at 9:54 AM, Albert Cahalan wrote:
>>> int weird(float *fp){
>>> // access an int as an int (see caller),
>>> // so not an aliasing violation
On Thu, Sep 30, 2010 at 5:39 AM, Richard Guenther
wrote:
> On Thu, Sep 30, 2010 at 9:54 AM, Albert Cahalan wrote:
>> int weird(float *fp){
>> // access an int as an int (see caller),
>> // so not an aliasing violation
>> return *(int*)fp;
>> }
>> int main(int argc, char *argv
On Thu, Sep 30, 2010 at 9:54 AM, Albert Cahalan wrote:
> int weird(float *fp){
> // access an int as an int (see caller),
> // so not an aliasing violation
> return *(int*)fp;
> }
> int main(int argc, char *argv[]){
> return weird((float*)&argc);
> }
>
> I just tried th
int weird(float *fp){
// access an int as an int (see caller),
// so not an aliasing violation
return *(int*)fp;
}
int main(int argc, char *argv[]){
return weird((float*)&argc);
}
I just tried this code with gcc 4.4.5 on 32-bit powerpc using -O2 -W -Wall.
Assembly c
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;
>
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 (void)
{
union
{
11 matches
Mail list logo