summaryrefslogtreecommitdiff
path: root/gcc/tree-object-size.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2009-09-02 12:25:14 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2009-09-02 12:25:14 +0000
commit01f8e000268f6673d1bb5059d0193b3bd5aaba14 (patch)
treeefb22c41209ac029bd4fbc0200c7d0c9bd288ef2 /gcc/tree-object-size.c
parent7acc347ee5888d93283457ced4a914766b7ab0ab (diff)
downloadgcc-01f8e000268f6673d1bb5059d0193b3bd5aaba14.tar.gz
* tree-object-size.c (addr_object_size): Always use object_size_type
0 or 2 when determining the pointer pointed object size. * gcc.dg/builtin-object-size-9.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@151323 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-object-size.c')
-rw-r--r--gcc/tree-object-size.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/tree-object-size.c b/gcc/tree-object-size.c
index 5b9fe38e96b..443f2808c2d 100644
--- a/gcc/tree-object-size.c
+++ b/gcc/tree-object-size.c
@@ -171,9 +171,9 @@ addr_object_size (struct object_size_info *osi, const_tree ptr,
{
unsigned HOST_WIDE_INT sz;
- if (!osi)
+ if (!osi || (object_size_type & 1) != 0)
sz = compute_builtin_object_size (TREE_OPERAND (pt_var, 0),
- object_size_type);
+ object_size_type & ~1);
else
{
tree var = TREE_OPERAND (pt_var, 0);