aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorH.J. Lu <hongjiu.lu@intel.com>2010-06-03 16:36:22 +0000
committerH.J. Lu <hjl@gcc.gnu.org>2010-06-03 09:36:22 -0700
commit1c314335e78d3db824b5d3c3d8bf605221a39528 (patch)
tree33ce3fac8549a6e690ebbf71d88d113efaa17aaa /gcc/cp
parentddf54e5aa0dac6956f9fa42a7e11c2915236cad0 (diff)
downloadgcc-1c314335e78d3db824b5d3c3d8bf605221a39528.zip
gcc-1c314335e78d3db824b5d3c3d8bf605221a39528.tar.gz
gcc-1c314335e78d3db824b5d3c3d8bf605221a39528.tar.bz2
Check MAX_FIXED_MODE_SIZE on bit-field in C++.
gcc/ada/ 2010-06-03 H.J. Lu <hongjiu.lu@intel.com> PR c++/44294 * gcc-interface/decl.c (MAX_FIXED_MODE_SIZE): Removed. gcc/cp/ 2010-06-03 H.J. Lu <hongjiu.lu@intel.com> PR c++/44294 * class.c (layout_class_type): Check MAX_FIXED_MODE_SIZE on bit-field. gcc/ 2010-06-03 H.J. Lu <hongjiu.lu@intel.com> PR c++/44294 * defaults.h (MAX_FIXED_MODE_SIZE): New. * stor-layout.c (MAX_FIXED_MODE_SIZE): Removed. From-SVN: r160229
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/class.c6
2 files changed, 10 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index d02bff4..1138cd2 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2010-06-03 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR c++/44294
+ * class.c (layout_class_type): Check MAX_FIXED_MODE_SIZE on
+ bit-field.
+
2010-06-02 Jonathan Wakely <jwakely.gcc@gmail.com>
* parser.c (cp_parser_mem_initializer_list): Change error text.
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index c2831c1..69064a6 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -4976,8 +4976,10 @@ layout_class_type (tree t, tree *virtuals_p)
bits as additional padding. */
for (itk = itk_char; itk != itk_none; ++itk)
if (integer_types[itk] != NULL_TREE
- && INT_CST_LT (DECL_SIZE (field),
- TYPE_SIZE (integer_types[itk])))
+ && (INT_CST_LT (size_int (MAX_FIXED_MODE_SIZE),
+ TYPE_SIZE (integer_types[itk]))
+ || INT_CST_LT (DECL_SIZE (field),
+ TYPE_SIZE (integer_types[itk]))))
break;
/* ITK now indicates a type that is too large for the