Author: pfg
Date: Thu Dec 19 18:27:32 2013
New Revision: 259619
URL: http://svnweb.freebsd.org/changeset/base/259619
Log:
gcc: backport upstream fix for issue with C++'s placement new
Fixes GCC libstdc++/29286
Obtained from:gcc 4.3 (rev. 125603, 125653; GPLv2)
MFC after:2 weeks
Modified:
head/contrib/gcc/ChangeLog.gcc43
head/contrib/gcc/cp/ChangeLog.gcc43
head/contrib/gcc/cp/init.c
head/contrib/gcc/doc/c-tree.texi
head/contrib/gcc/expr.c
head/contrib/gcc/gimple-low.c
head/contrib/gcc/gimplify.c
head/contrib/gcc/omp-low.c
head/contrib/gcc/print-tree.c
head/contrib/gcc/tree-gimple.c
head/contrib/gcc/tree-inline.c
head/contrib/gcc/tree-pretty-print.c
head/contrib/gcc/tree-ssa-alias.c
head/contrib/gcc/tree-ssa-dce.c
head/contrib/gcc/tree-ssa-operands.c
head/contrib/gcc/tree-ssa-structalias.c
head/contrib/gcc/tree.def
head/contrib/gcc/tree.h
Modified: head/contrib/gcc/ChangeLog.gcc43
==
--- head/contrib/gcc/ChangeLog.gcc43Thu Dec 19 18:06:52 2013
(r259618)
+++ head/contrib/gcc/ChangeLog.gcc43Thu Dec 19 18:27:32 2013
(r259619)
@@ -65,6 +65,48 @@
fvisibility-ms-compat.
* c.opt (fvisibility-ms-compat): New.
+2007-06-12 Ian Lance Taylor i...@google.com (r125653)
+ Daniel Berlin dber...@dberlin.org
+
+ PR libstdc++/29286
+ * tree.def: Add CHANGE_DYNAMIC_TYPE_EXPR.
+ * tree.h (CHANGE_DYNAMIC_TYPE_NEW_TYPE): Define.
+ (CHANGE_DYNAMIC_TYPE_LOCATION): Define.
+ (DECL_NO_TBAA_P): Define.
+ (struct tree_decl_common): Add no_tbaa_flag field.
+ * tree-ssa-structalias.c (struct variable_info): Add
+ no_tbaa_pruning field.
+ (new_var_info): Initialize no_tbaa_pruning field.
+ (unify_nodes): Copy no_tbaa_pruning field.
+ (find_func_aliases): Handle CHANGE_DYNAMIC_TYPE_EXPR.
+ (dump_solution_for_var): Print no_tbaa_pruning flag.
+ (set_uids_in_ptset): Add no_tbaa_pruning parameter. Change all
+ callers.
+ (compute_tbaa_pruning): New static function.
+ (compute_points_to_sets): Remove CHANGE_DYNAMIC_TYPE_EXPR nodes.
+ Call compute_tbaa_pruning.
+ * tree-ssa-alias.c (may_alias_p): Test no_tbaa_flag for pointers.
+ * gimplify.c (gimplify_expr): Handle CHANGE_DYNAMIC_TYPE_EXPR.
+ * gimple-low.c (lower_stmt): Likewise.
+ * tree-gimple.c (is_gimple_stmt): Likewise.
+ * tree-ssa-operands.c (get_expr_operands): Likewise.
+ * tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Likewise.
+ * tree-inline.c (estimate_num_insns_1): Likewise.
+ (copy_result_decl_to_var): Likewise.
+ * expr.c (expand_expr_real_1): Likewise.
+ * tree-pretty-print.c (dump_generic_node): Likewise.
+ * tree-inline.c (copy_decl_to_var): Copy DECL_NO_TBAA_P flag.
+ * omp-low.c (omp_copy_decl_2): Likewise.
+ * print-tree.c (print_node): Print DECL_NO_TBAA_P flag.
+ * doc/c-tree.texi (Expression trees): Document
+ CHANGE_DYNAMIC_TYPE_EXPR.
+
+2007-06-09 Daniel Berlin dber...@dberlin.org (r125603)
+
+ * tree-ssa-structalias.c (set_uids_in_ptset): Add is_deref'd
+ parameter, use it.
+ (find_what_p_points_to): Pass new parameter to set_uids_in_ptset.
+
2007-06-05 Joerg Wunsch j@uriah.heep.sax.de (r125346)
PR preprocessor/23479
Modified: head/contrib/gcc/cp/ChangeLog.gcc43
==
--- head/contrib/gcc/cp/ChangeLog.gcc43 Thu Dec 19 18:06:52 2013
(r259618)
+++ head/contrib/gcc/cp/ChangeLog.gcc43 Thu Dec 19 18:27:32 2013
(r259619)
@@ -25,6 +25,12 @@
* decl2.c (determine_visibility): Remove duplicate code for
handling type info.
+2007-06-12 Ian Lance Taylor i...@google.com (r125653)
+
+ PR libstdc++/29286
+ * init.c (avoid_placement_new_aliasing): New static function.
+ (build_new_1): Call it.
+
2007-05-31 Daniel Berlin dber...@dberlin.org (r125239)
* typeck.c (build_binary_op): Include types in error.
Modified: head/contrib/gcc/cp/init.c
==
--- head/contrib/gcc/cp/init.c Thu Dec 19 18:06:52 2013(r259618)
+++ head/contrib/gcc/cp/init.c Thu Dec 19 18:27:32 2013(r259619)
@@ -1,6 +1,7 @@
/* Handle initialization things in C++.
Copyright (C) 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+ Free Software Foundation, Inc.
Contributed by Michael Tiemann (tiem...@cygnus.com)
This file is part of GCC.
@@ -1564,6 +1565,55 @@ build_raw_new_expr (tree placement, tree
return new_expr;
}
+/* Make sure that there are no aliasing issues with T, a placement new
+ expression applied to