PR c++/68795: fix uninitialized close_paren_loc in cp_parser_postfix_expression
[gcc.git] / gcc / tree-data-ref.c
index 74f7614ff93d0727a9f7db049b2954bca9b0480c..a40f40dc33965142746f176a3f0713b777daaa5d 100644 (file)
@@ -1,5 +1,5 @@
 /* Data references and dependences detectors.
-   Copyright (C) 2003-2015 Free Software Foundation, Inc.
+   Copyright (C) 2003-2016 Free Software Foundation, Inc.
    Contributed by Sebastian Pop <pop@cri.ensmp.fr>
 
 This file is part of GCC.
@@ -3872,6 +3872,8 @@ get_references_in_stmt (gimple *stmt, vec<data_ref_loc, va_heap> *references)
   else if (stmt_code == GIMPLE_CALL)
     {
       unsigned i, n;
+      tree ptr, type;
+      unsigned int align;
 
       ref.is_read = false;
       if (gimple_call_internal_p (stmt))
@@ -3882,12 +3884,16 @@ get_references_in_stmt (gimple *stmt, vec<data_ref_loc, va_heap> *references)
              break;
            ref.is_read = true;
          case IFN_MASK_STORE:
-           ref.ref = fold_build2 (MEM_REF,
-                                  ref.is_read
-                                  ? TREE_TYPE (gimple_call_lhs (stmt))
-                                  : TREE_TYPE (gimple_call_arg (stmt, 3)),
-                                  gimple_call_arg (stmt, 0),
-                                  gimple_call_arg (stmt, 1));
+           ptr = build_int_cst (TREE_TYPE (gimple_call_arg (stmt, 1)), 0);
+           align = tree_to_shwi (gimple_call_arg (stmt, 1));
+           if (ref.is_read)
+             type = TREE_TYPE (gimple_call_lhs (stmt));
+           else
+             type = TREE_TYPE (gimple_call_arg (stmt, 3));
+           if (TYPE_ALIGN (type) != align)
+             type = build_aligned_type (type, align);
+           ref.ref = fold_build2 (MEM_REF, type, gimple_call_arg (stmt, 0),
+                                  ptr);
            references->safe_push (ref);
            return false;
          default: