This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/24178] [4.0/4.1 regression] generates code that produces unaligned access exceptions
- From: "tsv at solvo dot ru" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 14 Oct 2005 13:30:29 -0000
- Subject: [Bug middle-end/24178] [4.0/4.1 regression] generates code that produces unaligned access exceptions
- References: <bug-24178-3055@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from tsv at solvo dot ru 2005-10-14 13:30 -------
I tried check the difference between 3.4 and 4.x. The 3.4 emit instruction that
correct passed pointer (in my case -25) and then stores value to member of
structure (p4) at correct offset (24).
In gcc 4.x the "store_field" is called with target rtx defined as "MEM plus
const_int -25", but in gcc 3.4 - just MEM. The "store_bit_field" adds member
offset to target rtx and it became "MEM plus const_int -1". Later on
"get_aligned_mem" in alpha.c tries to convert it to "load long", but at that
point it thinks that MEM is aligned (which is not true).
Unfortunatelly, I don't have deep knowledge of gcc :) and could not figure out
what is correct place for check of alignment restrictions for such cases:
expand_assignment, store_field or store_bit_field functions. All of them seems
to have alignemnt check logic.
Thank you.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24178