Floating Pt. Optimize on PA
Nicholas Sterling
Nicholas.Sterling@Eng.Sun.COM
Sun Dec 27 14:43:00 GMT 1998
>
>In my dpANS (still haven't bought the final), there's the start of 3.3
>(probably 6.3 in ISO?):
>
> An object shall have its stored value accessed only by an
> lvalue that has one of the following types[36]:
>
> * the declared type of the object,
> [...qualified and/or signed/unsigned variants...]
> * an aggregate or union type that includes ...
> * a character type.
>
> ---
> 36. The intent of this list is to specify those circumstances
> in which an object may or may not be aliased.
>
Well, I think I'll have to see this in context in order to understand
it completely. That middle one in particular I'd like to know more about.
John Stampfl, can you try to run down the ANSI C document?
In the meantime, Jeffrey, please help me out here. Is the spec saying
that this would be OK (because character types are explicitly allowed)
double d = 1.0;
char *p = (char *) &d;
while ( p < (char *) (&d + 1) )
printf( "%x\n", *p++ );
but this (same thing, but int instead of char) would not?
double d = 1.0;
int *p = (int *) &d;
while ( p < (int *) (&d + 1) )
printf( "%x\n", *p++ );
Then what *is* the correct way to access the two words that comprise a
doubleword object?
Nicholas
More information about the Gcc-bugs
mailing list