summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordberlin <dberlin@138bc75d-0d04-0410-961f-82ee72b054a4>2005-07-11 18:28:36 +0000
committerdberlin <dberlin@138bc75d-0d04-0410-961f-82ee72b054a4>2005-07-11 18:28:36 +0000
commitd460b85fba311dfa6dea77da4f7ac526b343572b (patch)
tree9f96c9ce72ce2ed36318bcf256b5205358692d21
parent930e95c392794eb1077ba3400f9ee0028db0bc43 (diff)
downloadlinaro-gcc-d460b85fba311dfa6dea77da4f7ac526b343572b.tar.gz
linaro-gcc-d460b85fba311dfa6dea77da4f7ac526b343572b.tar.bz2
linaro-gcc-d460b85fba311dfa6dea77da4f7ac526b343572b.zip
2005-07-11 Daniel Berlin <dberlin@dberlin.org>
* print-tree.c (print_node): Use DECL_ARGUMENT_FLD. * tree.h (DECL_ARGUMENT_FLD): New macro. 2005-07-11 Daniel Berlin <dberlin@dberlin.org> Fix PR tree-optimization/22404 * tree-ssa-structalias.c (create_variable_info_for): Use correct offset. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@101894 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog12
-rw-r--r--gcc/print-tree.c2
-rw-r--r--gcc/testsuite/g++.dg/tree-ssa/pr22404.C15
-rw-r--r--gcc/tree-ssa-structalias.c1
-rw-r--r--gcc/tree.h1
5 files changed, 30 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e1b5b633fd1..9cd1d758111 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,15 @@
+2005-07-11 Daniel Berlin <dberlin@dberlin.org>
+
+ * print-tree.c (print_node): Use DECL_ARGUMENT_FLD.
+ * tree.h (DECL_ARGUMENT_FLD): New macro.
+
+2005-07-11 Daniel Berlin <dberlin@dberlin.org>
+
+ Fix PR tree-optimization/22404
+
+ * tree-ssa-structalias.c (create_variable_info_for): Use
+ correct offset.
+
2005-07-11 Bernd Schmidt <bernd.schmidt@analog.com>
* config/bfin/bfin.md (cmpsi, compare_eq, compare_ne, compare_lt,
diff --git a/gcc/print-tree.c b/gcc/print-tree.c
index 9bd79f4452e..954ee2d6a9c 100644
--- a/gcc/print-tree.c
+++ b/gcc/print-tree.c
@@ -467,7 +467,7 @@ print_node (FILE *file, const char *prefix, tree node, int indent)
}
if (CODE_CONTAINS_STRUCT (code, TS_DECL_NON_COMMON))
{
- print_node (file, "arguments", DECL_ARGUMENTS (node), indent + 4);
+ print_node (file, "arguments", DECL_ARGUMENT_FLD (node), indent + 4);
print_node (file, "result", DECL_RESULT_FLD (node), indent + 4);
}
print_node_brief (file, "initial", DECL_INITIAL (node), indent + 4);
diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr22404.C b/gcc/testsuite/g++.dg/tree-ssa/pr22404.C
new file mode 100644
index 00000000000..2c6b8cd2729
--- /dev/null
+++ b/gcc/testsuite/g++.dg/tree-ssa/pr22404.C
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+/* We were not getting the offset of a in B and a in C::B correct,
+ causing an abort. */
+struct A { A(); };
+
+struct B : A
+{
+ A a;
+};
+
+struct C : B { };
+
+C c;
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c
index 6f89799d00a..27299e764bc 100644
--- a/gcc/tree-ssa-structalias.c
+++ b/gcc/tree-ssa-structalias.c
@@ -3065,6 +3065,7 @@ create_variable_info_for (tree decl, const char *name)
field = fo->field;
vi->size = TREE_INT_CST_LOW (DECL_SIZE (field));
+ vi->offset = fo->offset;
for (i = 1; VEC_iterate (fieldoff_s, fieldstack, i, fo); i++)
{
varinfo_t newvi;
diff --git a/gcc/tree.h b/gcc/tree.h
index eb9ebdcd05d..e1007a3caed 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -2631,6 +2631,7 @@ struct tree_decl_non_common GTY(())
VAR_DECL and PARM_DECL reserve the arguments slot for language-specific
uses. */
#define DECL_ARGUMENTS(NODE) (FUNCTION_DECL_CHECK (NODE)->decl_non_common.arguments)
+#define DECL_ARGUMENT_FLD(NODE) (DECL_NON_COMMON_CHECK (NODE)->decl_non_common.arguments)
/* FUNCTION_DECL inherits from DECL_NON_COMMON because of the use of the
arguments/result/saved_tree fields by front ends. It was either inherit