diff mbox

Fix fallout of VECTOR_CST change

Message ID 201203282359.45922.ebotcazou@adacore.com
State New
Headers show

Commit Message

Eric Botcazou March 28, 2012, 9:59 p.m. UTC
Vector support has been seriously damaged in Ada since the re-implementation of 
the VECTOR_CST node.  This fixes crashes.

Tested on i586-suse-linux, applied on the mainline as obvious.


2012-03-28  Eric Botcazou  <ebotcazou@adacore.com>

	* tree.c (tree_size) <VECTOR_CST>: New case.


2012-03-28  Eric Botcazou  <ebotcazou@adacore.com>

	* gnat.dg/vect7.ad[sb]: New test.
diff mbox

Patch

Index: tree.c
===================================================================
--- tree.c	(revision 185857)
+++ tree.c	(working copy)
@@ -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;