]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/tree-ssa-ccp.c
Merge in trunk.
[thirdparty/gcc.git] / gcc / tree-ssa-ccp.c
index b1e21b8b47c1ec2d93e7d9745ae402663ee96c4c..99e1920a070cc1e5e1d1565374a080ace2c394ad 100644 (file)
@@ -1803,6 +1803,25 @@ evaluate_stmt (gimple stmt)
              val = bit_value_assume_aligned (stmt, NULL_TREE, val, false);
              break;
 
+           case BUILT_IN_ALIGNED_ALLOC:
+             {
+               tree align = get_constant_value (gimple_call_arg (stmt, 0));
+               if (align
+                   && tree_fits_uhwi_p (align))
+                 {
+                   unsigned HOST_WIDE_INT aligni = tree_to_uhwi (align);
+                   if (aligni > 1
+                       /* align must be power-of-two */
+                       && (aligni & (aligni - 1)) == 0)
+                     {
+                       val.lattice_val = CONSTANT;
+                       val.value = build_int_cst (ptr_type_node, 0);
+                       val.mask = double_int::from_shwi (-aligni);
+                     }
+                 }
+               break;
+             }
+
            default:;
            }
        }