aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-cfg.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2017-07-28 11:27:45 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2017-07-28 11:27:45 +0000
commit92e29a5e86c8adc88ee17a483d7284d7bb9e090c (patch)
tree7c89972072bd6357aef834097b5e62e1378d814d /gcc/tree-cfg.c
parentc9b39a4955f56fe609ef54784f7bf48c4cba6b1a (diff)
downloadgcc-92e29a5e86c8adc88ee17a483d7284d7bb9e090c.zip
gcc-92e29a5e86c8adc88ee17a483d7284d7bb9e090c.tar.gz
gcc-92e29a5e86c8adc88ee17a483d7284d7bb9e090c.tar.bz2
re PR middle-end/81502 (In some cases the data is moved to memory unnecessarily [partial regression])
2017-07-28 Richard Biener <rguenther@suse.de> PR tree-optimization/81502 * match.pd: Add pattern combining BIT_INSERT_EXPR with BIT_FIELD_REF. * tree-cfg.c (verify_expr): Verify types of BIT_FIELD_REF size/pos operands. (verify_gimple_assign_ternary): Likewise for BIT_INSERT_EXPR pos. * gimple-fold.c (maybe_canonicalize_mem_ref_addr): Use bitsizetype for BIT_FIELD_REF args. * fold-const.c (make_bit_field_ref): Likewise. * tree-vect-stmts.c (vectorizable_simd_clone_call): Likewise. * gcc.target/i386/pr81502.c: New testcase. From-SVN: r250659
Diffstat (limited to 'gcc/tree-cfg.c')
-rw-r--r--gcc/tree-cfg.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index f664ffe..733c92f 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -3054,7 +3054,9 @@ verify_expr (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
tree t1 = TREE_OPERAND (t, 1);
tree t2 = TREE_OPERAND (t, 2);
if (!tree_fits_uhwi_p (t1)
- || !tree_fits_uhwi_p (t2))
+ || !tree_fits_uhwi_p (t2)
+ || !types_compatible_p (bitsizetype, TREE_TYPE (t1))
+ || !types_compatible_p (bitsizetype, TREE_TYPE (t2)))
{
error ("invalid position or size operand to BIT_FIELD_REF");
return t;
@@ -4248,6 +4250,7 @@ verify_gimple_assign_ternary (gassign *stmt)
return true;
}
if (! tree_fits_uhwi_p (rhs3)
+ || ! types_compatible_p (bitsizetype, TREE_TYPE (rhs3))
|| ! tree_fits_uhwi_p (TYPE_SIZE (rhs2_type)))
{
error ("invalid position or size in BIT_INSERT_EXPR");