This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/11469] Code compiles and runs correctly without optimisation but causes a bus error if -O is used on Solaris 2.8


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11469


ebotcazou at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


------- Additional Comments From ebotcazou at gcc dot gnu dot org  2003-07-09 10:24 -------
Your code invokes undefined behaviour according to the C standard, because
you're converting a void pointer 'p' (which has the alignment requirement of
char* pointer) to a double* pointer, and 'p' is not sufficiently aligned for
pointing to a double.

char* pointers are 4-byte aligned on SPARC while double* pointers are 8-byte
aligned.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]