[Bug tree-optimization/65077] [4.9/5 Regression] memcpy generates incorrect code with floating point numbers and -O1
anders.blomdell at control dot lth.se
gcc-bugzilla@gcc.gnu.org
Mon Feb 16 13:58:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65077
--- Comment #8 from anders.blomdell at control dot lth.se ---
(In reply to Richard Biener from comment #6)
> (In reply to anders.blomdell from comment #5)
> > No, but my users insists on using Matlab/Simulink, and the testcase is a
> > heavily downsized version of what is done in their S-functions.
>
> I mean - seriously storing a pointer as FP values of the upper/lower word
> of the pointer? So I suppose this is what Matlab/Simulink generate
> internally
> and what gets compiled - thus this is machine generated?
Nope, part of C-code that users should include in their S-functions.
Code used to work with gcc-4.8.3. This will become a major problem :-(
>
> A workaround is to use -fno-tree-pta btw (for 64bit pointers the out-of-bound
> write still occurs, but that may be due to your simplification?).
The out of bound write is because I'm a klutz, the bug occurs with this as well
S theS;
double *getP(void *p) {
union u {
void *p;
int i[2];
} u;
u.p = &theS;
P[0] = u.i[0];
P[1] = u.i[1];
return P;
}
More information about the Gcc-bugs
mailing list