Description of problem: If a variable of type "short" crosses qword boundary (e.g. it's a member of packed structure), its value incorrectly retrieved/modified through the pointer. Version-Release number of selected component (if applicable): g++ 3.2.1 How reproducible: always Steps to Reproduce: 1. compile & run attached example 2. 3. Actual results: First 2 output lines shows correct behavior (direct access to the packed structure member, no_problem() function); second 2 output lines shows incorrect behavior (access to the same data through the pointer, problem() function) Expected results: variable should be correctly accessed/modified through the pointer :) Additional info:
Created attachment 90243 [details] example of the wrong behavior
short *pw = &ps->word; This assignment is buggy. You can't take the address of an element of a packed structure and assign it to a normal "short *".