This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH, SRA] Do not care about trailing zero-sized bit-fields any more
- From: Martin Jambor <mjambor at suse dot cz>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Richard Guenther <rguenther at suse dot de>
- Date: Fri, 24 Sep 2010 18:54:41 +0200
- Subject: [PATCH, SRA] Do not care about trailing zero-sized bit-fields any more
Hi,
with SRA producing MEM_REFs to access components of aggregates,
zero-sized trailing bit-fields are no longer a problem (PR 43191,
better description:
http://gcc.gnu.org/ml/gcc-patches/2010-03/msg00207.html) and so there
is no need to handle them specially.
Bootstrapped and tested on x86_64-linux. OK for trunk?
Thanks,
Martin
2010-09-24 Martin Jambor <mjambor@suse.cz>
* tree-sra.c (type_consists_of_records_p): Do not check for trailing
zero sized bit-fields.
Index: mine/gcc/tree-sra.c
===================================================================
--- mine.orig/gcc/tree-sra.c
+++ mine/gcc/tree-sra.c
@@ -815,14 +815,12 @@ create_access (tree expr, gimple stmt, b
/* Return true iff TYPE is a RECORD_TYPE with fields that are either of gimple
register types or (recursively) records with only these two kinds of fields.
- It also returns false if any of these records has a zero-size field as its
- last field or has a bit-field. */
+ It also returns false if any of these records contains a bit-field. */
static bool
type_consists_of_records_p (tree type)
{
tree fld;
- bool last_fld_has_zero_size = false;
if (TREE_CODE (type) != RECORD_TYPE)
return false;
@@ -838,13 +836,8 @@ type_consists_of_records_p (tree type)
if (!is_gimple_reg_type (ft)
&& !type_consists_of_records_p (ft))
return false;
-
- last_fld_has_zero_size = tree_low_cst (DECL_SIZE (fld), 1) == 0;
}
- if (last_fld_has_zero_size)
- return false;
-
return true;
}