From 930d1d3fe2835ab89d2bbe688d730bfd75a4f16e Mon Sep 17 00:00:00 2001 From: rguenth Date: Fri, 28 Aug 2009 19:36:05 +0000 Subject: [PATCH] 2009-08-28 Richard Guenther PR lto/41058 * cp-gimplify.c (cp_genericize_r): Do not leak zero-sized stores into the generic IL. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@151176 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cp/ChangeLog | 6 ++++++ gcc/cp/cp-gimplify.c | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index bb5a615..90a5c59 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2009-08-28 Richard Guenther + + PR lto/41058 + * cp-gimplify.c (cp_genericize_r): Do not leak zero-sized stores + into the generic IL. + 2009-08-27 Richard Guenther * class.c (build_vtbl_ref_1): Remove excess vertical space. diff --git a/gcc/cp/cp-gimplify.c b/gcc/cp/cp-gimplify.c index b4d36de4..52c12eb 100644 --- a/gcc/cp/cp-gimplify.c +++ b/gcc/cp/cp-gimplify.c @@ -853,6 +853,15 @@ cp_genericize_r (tree *stmt_p, int *walk_subtrees, void *data) *walk_subtrees = 0; } + else if (TREE_CODE (stmt) == MODIFY_EXPR + && (integer_zerop (cp_expr_size (TREE_OPERAND (stmt, 0))) + || integer_zerop (cp_expr_size (TREE_OPERAND (stmt, 1))))) + { + *stmt_p = build2 (COMPOUND_EXPR, TREE_TYPE (stmt), + TREE_OPERAND (stmt, 0), + TREE_OPERAND (stmt, 1)); + } + pointer_set_insert (p_set, *stmt_p); return NULL; -- 2.7.4