[Bug target/64703] glibc sysdeps/powerpc/powerpc64/dl-machine.h miscompile
msebor at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Feb 25 01:06:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64703
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |msebor at gcc dot gnu.org
--- Comment #8 from Martin Sebor <msebor at gcc dot gnu.org> ---
The test case is invalid because it accesses the value of the opd object via a
pointer to a function when C allows an object to have its value accessed only
by an lvalue of a compatible type.
A simpler test case that demonstrates a similar issue is below:
#include <assert.h>
struct X { const char *s; };
struct Y { unsigned long n; };
const char* __attribute__ ((weak))
foo (unsigned long value) {
struct Y y;
if (value) {
y.n = ((struct Y*)value)->n;
value = (unsigned long)&y;
}
return ((struct X*)value)->s;
}
int main (void) {
struct Y y = { 123 };
unsigned long n = (unsigned long)foo ((unsigned long)&y);
assert (n == y.n);
return 0;
}
More information about the Gcc-bugs
mailing list