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 14:02:06 +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
----------------------------------------------------------------------------
Keywords| |missed-optimization
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot gnu.org
--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fix:
Index: gcc/builtins.c
===================================================================
--- gcc/builtins.c (revision 231058)
+++ gcc/builtins.c (working copy)
@@ -497,6 +497,10 @@ get_pointer_alignment_1 (tree exp, unsig
{
*bitposp = ptr_misalign * BITS_PER_UNIT;
*alignp = ptr_align * BITS_PER_UNIT;
+ /* Make sure to return a sensible alignment when the multiplication
+ by BITS_PER_UNIT overflowed. */
+ if (*alignp == 0)
+ *alignp = 1u << (HOST_BITS_PER_INT - 1);
/* We cannot really tell whether this result is an approximation. */
return true;
}