On Sun, 18 Jan 2009, H.J. Lu wrote: > On Sat, Jan 17, 2009 at 6:23 AM, Richard Guenther <rguent...@suse.de> wrote: > > > > A release candidate for GCC 4.3.3 is available from > > > > ftp://gcc.gnu.org/pub/gcc/snapshots/4.3.3-RC-20090117/ > > > > and shortly its mirrors. It has been generated from SVN revision 143460. > > > > The branch is still frozen and all checkins until after the final > > release of GCC 4.3.3 require explicit RM approval. > > > > Gcc 4.3.3 miscompiled SPEC CPU 2006 on Linux/x86-64: > > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38905
I am testing the following patch. Richard. 2008-07-11 Richard Guenther <rguent...@suse.de> PR tree-optimization/36765 * tree-ssa-alias.c (compute_flow_insensitive_aliasing): Add aliases from HEAP vars to SMTs. * gcc.c-torture/execute/pr36765.c: New testcase. Index: gcc/tree-ssa-alias.c =================================================================== *** gcc/tree-ssa-alias.c (revision 137712) --- gcc/tree-ssa-alias.c (working copy) *************** have_common_aliases_p (bitmap tag1aliase *** 2370,2375 **** --- 2370,2377 ---- static void compute_flow_insensitive_aliasing (struct alias_info *ai) { + referenced_var_iterator rvi; + tree var; size_t i; timevar_push (TV_FLOW_INSENSITIVE); *************** compute_flow_insensitive_aliasing (struc *** 2460,2465 **** --- 2462,2485 ---- 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); } Index: gcc/testsuite/gcc.c-torture/execute/pr36765.c =================================================================== *** gcc/testsuite/gcc.c-torture/execute/pr36765.c (revision 0) --- gcc/testsuite/gcc.c-torture/execute/pr36765.c (revision 0) *************** *** 0 **** --- 1,15 ---- + 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; + }