diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-09-06 13:17:50 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-09-06 13:17:50 +0000 |
commit | 7384c67892617a29359a07d6f4f4196eb1d7bdd0 (patch) | |
tree | 79a6f72b4c729032adb2e9fb056921d1ebcc1a92 /gcc/tree-ssa-sccvn.h | |
parent | 288afea98393883aa13c0b09a43970fdebe2b69a (diff) | |
download | gcc-7384c67892617a29359a07d6f4f4196eb1d7bdd0.tar.gz |
2011-09-06 Richard Guenther <rguenther@suse.de>
PR tree-optimization/48317
* tree-ssa-sccvn.h (struct vn_nary_op_s): Make op a true
trailing array.
(sizeof_vn_nary_op): New inline function.
(vn_nary_op_lookup_pieces): Adjust.
(vn_nary_op_insert_pieces): Likewise.
* tree-ssa-sccvn.c (vn_nary_op_eq): Also compare the length.
(init_vn_nary_op_from_pieces): Adjust signature. Deal with
any number of operands.
(vn_nary_length_from_stmt): New function.
(init_vn_nary_op_from_stmt): Adjust for CONSTRUCTOR handling.
(vn_nary_op_lookup_pieces): Adjust signature and allocate properly
sized temporary.
(vn_nary_op_lookup): Likewise.
(vn_nary_op_lookup_stmt): Likewise.
(vn_nary_op_insert_into): Likewise.
(vn_nary_op_insert_stmt): Likewise.
(visit_use): Handle CONSTRUCTOR as nary.
* tree-ssa-pre.c (phi_translate_1): Adjust.
(create_expression_by_pieces): Likewise.
(compute_avail): Likewise.
* gcc.dg/tree-ssa/ssa-fre-31.c: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@178595 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-sccvn.h')
-rw-r--r-- | gcc/tree-ssa-sccvn.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/gcc/tree-ssa-sccvn.h b/gcc/tree-ssa-sccvn.h index bf99702e43a..97d7f8f3921 100644 --- a/gcc/tree-ssa-sccvn.h +++ b/gcc/tree-ssa-sccvn.h @@ -42,10 +42,18 @@ typedef struct vn_nary_op_s hashval_t hashcode; tree result; tree type; - tree op[4]; + tree op[1]; } *vn_nary_op_t; typedef const struct vn_nary_op_s *const_vn_nary_op_t; +/* Return the size of a vn_nary_op_t with LENGTH operands. */ + +static inline size_t +sizeof_vn_nary_op (unsigned int length) +{ + return sizeof (struct vn_nary_op_s) + sizeof (tree) * (length - 1); +} + /* Phi nodes in the hashtable consist of their non-VN_TOP phi arguments, and the basic block the phi is in. Result is the value number of the operation, and hashcode is stored to avoid having to @@ -176,13 +184,11 @@ void free_scc_vn (void); tree vn_nary_op_lookup (tree, vn_nary_op_t *); tree vn_nary_op_lookup_stmt (gimple, vn_nary_op_t *); tree vn_nary_op_lookup_pieces (unsigned int, enum tree_code, - tree, tree, tree, tree, tree, - vn_nary_op_t *); + tree, tree *, vn_nary_op_t *); vn_nary_op_t vn_nary_op_insert (tree, tree); vn_nary_op_t vn_nary_op_insert_stmt (gimple, tree); vn_nary_op_t vn_nary_op_insert_pieces (unsigned int, enum tree_code, - tree, tree, tree, tree, - tree, tree, unsigned int); + tree, tree *, tree, unsigned int); void vn_reference_fold_indirect (VEC (vn_reference_op_s, heap) **, unsigned int *); void copy_reference_ops_from_ref (tree, VEC(vn_reference_op_s, heap) **); |