summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2012-03-28 21:59:23 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2012-03-28 21:59:23 +0000
commit2defb110db56604247474b3dea21ebdd22a62ff0 (patch)
treeabd02fca19d088aec09811c320303539478f9c12 /gcc
parent552ab9772fb2bb59f2e3d3706f2cd304e95c8741 (diff)
downloadgcc-2defb110db56604247474b3dea21ebdd22a62ff0.tar.gz
* tree.c (tree_size) <VECTOR_CST>: New case.
From-SVN: r185930
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gnat.dg/vect7.adb20
-rw-r--r--gcc/testsuite/gnat.dg/vect7.ads15
-rw-r--r--gcc/tree.c4
5 files changed, 47 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f84e25e2686..55fc1e43ac2 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,7 @@
+2012-03-28 Eric Botcazou <ebotcazou@adacore.com>
+
+ * tree.c (tree_size) <VECTOR_CST>: New case.
+
2012-03-28 Uros Bizjak <ubizjak@gmail.com>
* config/i386/i386.c (ix86_modes_tieable_p): Handle 32bit AVX modes.
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 945e50795db..b16a490b58c 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2012-03-28 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/vect7.ad[sb]: New test.
+
2012-03-28 Paul Thomas <pault@gcc.gnu.org>
Tobias Burnus <burnus@gcc.gnu.org>
diff --git a/gcc/testsuite/gnat.dg/vect7.adb b/gcc/testsuite/gnat.dg/vect7.adb
new file mode 100644
index 00000000000..7911cc812c6
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/vect7.adb
@@ -0,0 +1,20 @@
+-- { dg-do compile }
+
+package body Vect7 is
+
+ procedure Assign is
+ v1 : constant v4sf := (-1.0, -2.0, -3.0, -4.0);
+ v2 : v4sf := v1;
+ v3 : v4sf;
+ begin
+ v3 := vzero;
+ v3 := vconst;
+ v3 := v1;
+ v3 := v2;
+ v3 := (1.0, -2.0, 3.0, -4.0);
+ v3 := (1.0, -2.0, 3.0, F);
+
+ v2 := vzero;
+ end;
+
+end Vect7;
diff --git a/gcc/testsuite/gnat.dg/vect7.ads b/gcc/testsuite/gnat.dg/vect7.ads
new file mode 100644
index 00000000000..faf01679e23
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/vect7.ads
@@ -0,0 +1,15 @@
+package Vect7 is
+
+ type v4sf is array (1 .. 4) of Float;
+ for v4sf'Alignment use 16;
+ pragma Machine_Attribute (v4sf, "vector_type");
+
+ vzero : constant v4sf := (0.0, 0.0, 0.0, 0.0);
+ vconst : constant v4sf := (1.0, 2.0, 3.0, 4.0);
+ vvar : v4sf := vconst;
+
+ F : Float := 5.0;
+
+ procedure Assign;
+
+end Vect7;
diff --git a/gcc/tree.c b/gcc/tree.c
index cfea9f7b88d..7c7e43a5a88 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -724,6 +724,10 @@ tree_size (const_tree node)
return (sizeof (struct tree_vec)
+ (TREE_VEC_LENGTH (node) - 1) * sizeof (tree));
+ case VECTOR_CST:
+ return (sizeof (struct tree_vector)
+ + (TYPE_VECTOR_SUBPARTS (TREE_TYPE (node)) - 1) * sizeof (tree));
+
case STRING_CST:
return TREE_STRING_LENGTH (node) + offsetof (struct tree_string, str) + 1;