This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/68636] unnecessary unaligned load on mips o32
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 03 Dec 2015 13:52:08 +0000
- Subject: [Bug rtl-optimization/68636] unnecessary unaligned load on mips o32
- Auto-submitted: auto-generated
- References: <bug-68636-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68636
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2015-12-03
Ever confirmed|0 |1
--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
Ok, so we get in
bool
get_pointer_alignment_1 (tree exp, unsigned int *alignp,
unsigned HOST_WIDE_INT *bitposp)
{
...
else if (TREE_CODE (exp) == SSA_NAME
&& POINTER_TYPE_P (TREE_TYPE (exp)))
{
unsigned int ptr_align, ptr_misalign;
struct ptr_info_def *pi = SSA_NAME_PTR_INFO (exp);
if (pi && get_ptr_info_alignment (pi, &ptr_align, &ptr_misalign))
{
*bitposp = ptr_misalign * BITS_PER_UNIT;
*alignp = ptr_align * BITS_PER_UNIT;
a ptr_align of 536870912 and multiplying that by 8 overflows 'unsigned int'
to zero. And then in the caller
374 known_alignment
375 = get_pointer_alignment_1 (addr, &ptr_align, &ptr_bitpos);
376 align = MAX (ptr_align, align);
MAX (0, 8) is 8 ...