[Bug c/40645] Bus error caused by ldd/std instructions in struct copy.
dentongosnell at yahoo dot com
Sat Jul 4 13:32:00 GMT 2009
------- Comment #3 from dentongosnell at yahoo dot com 2009-07-04 13:32 -------
(In reply to comment #2)
> > One other thing, there is a flag "-mno-faster-structs" which this page
> > suggests would prevent this sort of ldd/std use
> > (http://gcc.gnu.org/onlinedocs/gcc/SPARC-Options.html). Unfortunately
> > this flag doesn't seem to make any difference to this case.
> -mno-faster-structs is the default.
If "-mno-faster-structs" is the default, then surely it shouldn't be generating
ldd/std in this case (and assuming the 8-byte alignment for "union myblock").
The code it is generating is what I would expect if I passed
"-mfaster-structs", based on the above-mentioned documentation page.
In other words, gcc align_bug.c should give just ld/st pairs, and hence should
work without a bus error.
I think either the compiler or the documentation has a bug!
More information about the Gcc-bugs