]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
2015-12-04 Richard Biener <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 4 Dec 2015 08:17:50 +0000 (08:17 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 4 Dec 2015 08:17:50 +0000 (08:17 +0000)
PR middle-end/68636
* builtins.c (get_pointer_alignment_1): Take care of byte to
bit alignment computation overflow.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231246 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/builtins.c

index 0a3fd7939dd5496e6e6b83c517efe87992c63184..fc026c58ee7ad7518611436b2e9cc1fa20dc6e2f 100644 (file)
@@ -1,3 +1,9 @@
+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.
+
 2015-12-04  Richard Biener  <rguenther@suse.de>
 
        PR middle-end/67438
index 7c614e6336edf4c10646d26a94c21c66e5bf1b29..9d816044c73ffebcd8359b004648f0c16ac2b434 100644 (file)
@@ -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;
        }