summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authortbsaunde <tbsaunde@138bc75d-0d04-0410-961f-82ee72b054a4>2015-05-05 03:41:53 +0000
committertbsaunde <tbsaunde@138bc75d-0d04-0410-961f-82ee72b054a4>2015-05-05 03:41:53 +0000
commit690b050a17c1d61a257c046959b6b4dbe123e9bb (patch)
treeccc4d5e0cfe5965a5e89e5eb7f6616cfdb85f63e /config
parentedfc04e760da62abe4974546679abbfd5c02a9c8 (diff)
downloadgcc-690b050a17c1d61a257c046959b6b4dbe123e9bb.tar.gz
Improve the test in bitfields.m4
Using a named bitfield with a width more than 0 means we won't hit weirdness caused by the bitfield not really needing to exist. Changing int to long long means we won't have trouble with some arch where size of int is 1 or 2. libobjc/ChangeLog: 2015-05-04 Trevor Saunders <tbsaunde+gcc@tbsaunde.org> * configure: Regenerate. config/ChangeLog: 2015-05-04 Trevor Saunders <tbsaunde+gcc@tbsaunde.org> * bitfields.m4: Change int to long long, and use bitfields of width 1 instead of 0. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222794 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'config')
-rw-r--r--config/ChangeLog5
-rw-r--r--config/bitfields.m47
2 files changed, 8 insertions, 4 deletions
diff --git a/config/ChangeLog b/config/ChangeLog
index 19f2103a3c0..d62ae4ce6c8 100644
--- a/config/ChangeLog
+++ b/config/ChangeLog
@@ -1,3 +1,8 @@
+2015-05-04 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
+
+ * bitfields.m4: Change int to long long, and use bitfields of
+ width 1 instead of 0.
+
2015-05-01 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
* bitfields.m4: New file.
diff --git a/config/bitfields.m4 b/config/bitfields.m4
index ee8f3b5baba..8185cd302a9 100644
--- a/config/bitfields.m4
+++ b/config/bitfields.m4
@@ -13,10 +13,9 @@ AC_DEFUN([gt_BITFIELD_TYPE_MATTERS],
AC_CACHE_CHECK([if the type of bitfields matters], gt_cv_bitfield_type_matters,
[
AC_TRY_COMPILE(
- [struct foo1 { char x; char :0; char y; };
-struct foo2 { char x; int :0; char y; };
-int foo1test[ sizeof (struct foo1) == 2 ? 1 : -1 ];
-int foo2test[ sizeof (struct foo2) == 5 ? 1 : -1]; ],
+ [struct foo1 { char x; char y:1; char z; };
+struct foo2 { char x; long long int y:1; char z; };
+int foo1test[ sizeof (struct foo1) < sizeof (struct foo2) ? 1 : -1 ]; ],
[], gt_cv_bitfield_type_matters=yes, gt_cv_bitfield_type_matters=no)
])
if test $gt_cv_bitfield_type_matters = yes; then