public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH][testsuite] Fix oversized bitfield warning.
@ 2015-01-14 10:58 Matthew Wahab
  2015-01-14 21:59 ` Jeff Law
  0 siblings, 1 reply; 2+ messages in thread
From: Matthew Wahab @ 2015-01-14 10:58 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 754 bytes --]

Hello,

Test case g++.dg/torture/20141013.C (added 
https://gcc.gnu.org/ml/gcc-patches/2014-10/msg01190.html) triggers the 
warning
--
   20141013.C:45:23: warning: width of 'tree_base::code' exceeds its type
--
on arm-none-eabi.

The code specifies a bitfield of size 16 with an enum as the underlying 
type. On arm-none-eabi, enums are packed by default (-fshort-enums) so 
the bitfield is oversized and the warning is correct.

This patch adds -fno-short-enums to the compiler options for the test case.

Testing: Ran g++.dg/torture/dg-torture.exp for arm-none-eabi and 
arm-none-linux-gnueabihf.

Matthew

2015-01-13  Matthew Wahab  <matthew.wahab@arm.com>

         * testsuite/g++.dg/torture/20141013.C: Set -fno-short-enums.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: testcase20141013.patch --]
[-- Type: text/x-patch; name=testcase20141013.patch, Size: 382 bytes --]

diff --git a/gcc/testsuite/g++.dg/torture/20141013.C b/gcc/testsuite/g++.dg/torture/20141013.C
index 529ef0965e4472e5038a9e6d09f13ca4f4a05954..82aacd6317eb3cd66b2839347a708ae0f4787efc 100644
--- a/gcc/testsuite/g++.dg/torture/20141013.C
+++ b/gcc/testsuite/g++.dg/torture/20141013.C
@@ -1,3 +1,4 @@
+/* { dg-options "-fno-short-enums" } */
 enum
 {
   _sch_isdigit = 0x0004,

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH][testsuite] Fix oversized bitfield warning.
  2015-01-14 10:58 [PATCH][testsuite] Fix oversized bitfield warning Matthew Wahab
@ 2015-01-14 21:59 ` Jeff Law
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Law @ 2015-01-14 21:59 UTC (permalink / raw)
  To: Matthew Wahab, gcc-patches

On 01/14/15 03:54, Matthew Wahab wrote:
> Hello,
>
> Test case g++.dg/torture/20141013.C (added
> https://gcc.gnu.org/ml/gcc-patches/2014-10/msg01190.html) triggers the
> warning
> --
>    20141013.C:45:23: warning: width of 'tree_base::code' exceeds its type
> --
> on arm-none-eabi.
>
> The code specifies a bitfield of size 16 with an enum as the underlying
> type. On arm-none-eabi, enums are packed by default (-fshort-enums) so
> the bitfield is oversized and the warning is correct.
>
> This patch adds -fno-short-enums to the compiler options for the test case.
>
> Testing: Ran g++.dg/torture/dg-torture.exp for arm-none-eabi and
> arm-none-linux-gnueabihf.
>
> Matthew
>
> 2015-01-13  Matthew Wahab  <matthew.wahab@arm.com>
>
>          * testsuite/g++.dg/torture/20141013.C: Set -fno-short-enums.
OK for the trunk.  Please install.

Thanks,
Jeff

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-01-14 21:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-14 10:58 [PATCH][testsuite] Fix oversized bitfield warning Matthew Wahab
2015-01-14 21:59 ` Jeff Law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).