[Bug rtl-optimization/68636] unnecessary unaligned load on mips o32

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Dec 3 13:52:00 GMT 2015


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 ...


More information about the Gcc-bugs mailing list