+2008-07-11 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/36765
+ * tree-ssa-alias.c (compute_flow_insensitive_aliasing): Add
+ aliases from HEAP vars to SMTs.
+
2008-07-10 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* Makefile.in (LOOSE_WARN, STRICT_WARN): Update comments.
+2008-07-11 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/36765
+ * gcc.c-torture/execute/pr36765.c: New testcase.
+
2008-07-10 Joseph Myers <joseph@codesourcery.com>
PR middle-end/29056
--- /dev/null
+int __attribute__((noinline))
+foo(int i)
+{
+ int *p = __builtin_malloc (4 * sizeof(int));
+ *p = 0;
+ p[i] = 1;
+ return *p;
+}
+extern void abort (void);
+int main()
+{
+ if (foo(0) != 1)
+ abort ();
+ return 0;
+}
static void
compute_flow_insensitive_aliasing (struct alias_info *ai)
{
+ referenced_var_iterator rvi;
+ tree var;
size_t i;
timevar_push (TV_FLOW_INSENSITIVE);
add_may_alias (tag1, tag2);
}
}
+
+ /* We have to add all HEAP variables to all SMTs aliases bitmaps.
+ As we don't know which effective type the HEAP will have we cannot
+ do better here and we need the conflicts with obfuscated pointers
+ (a simple (*(int[n] *)ptr)[i] will do, with ptr from a VLA array
+ allocation). */
+ for (i = 0; i < ai->num_pointers; i++)
+ {
+ struct alias_map_d *p_map = ai->pointers[i];
+ tree tag = symbol_mem_tag (p_map->var);
+
+ FOR_EACH_REFERENCED_VAR (var, rvi)
+ {
+ if (var_ann (var)->is_heapvar)
+ add_may_alias (tag, var);
+ }
+ }
+
timevar_pop (TV_FLOW_INSENSITIVE);
}