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/14750] type-punned pointer causes bad code


------- Additional Comments From lindsayd at cisco dot com  2004-03-27 04:09 -------
The above got committed before I was finished. Sigh.

What's right about these four lines is that they store two halfwords (with "sh")
and load a word (with "lw"). What's wrong is that they do it in the order
{store,load,store}, not {store,store,load}. So the result (the returned word)
contains 16 uninitialized bits from the stack frame. That's not OK.

The latest 3.4 snapshot has this behavior. I believe 3.3 has the same problem:
at least, it did in December.

-- 


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


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