diff options
author | Richard Biener <rguenther@suse.de> | 2015-12-04 08:17:50 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2015-12-04 08:17:50 +0000 |
commit | 5505978ab31300aa02f321f97af9512916ed8595 (patch) | |
tree | 3ffe8c61c894fb1073c02b9a27437ef8c9a5ea2f /gcc/builtins.c | |
parent | 7fe996ba15e8453ea966bd0a62861e012d7045b6 (diff) | |
download | gcc-5505978ab31300aa02f321f97af9512916ed8595.zip gcc-5505978ab31300aa02f321f97af9512916ed8595.tar.gz gcc-5505978ab31300aa02f321f97af9512916ed8595.tar.bz2 |
re PR rtl-optimization/68636 (unnecessary unaligned load on mips o32)
2015-12-04 Richard Biener <rguenther@suse.de>
PR middle-end/68636
* builtins.c (get_pointer_alignment_1): Take care of byte to
bit alignment computation overflow.
From-SVN: r231246
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r-- | gcc/builtins.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c index 7c614e6..9d81604 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -458,6 +458,10 @@ get_pointer_alignment_1 (tree exp, unsigned int *alignp, { *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; } |