PR c/51147 - attribute((mode(byte))) on an enum generates wrong code

gcc/testsuite/ChangeLog:
2016-02-24  Martin Sebor  <msebor@redhat.com>

        PR c/51147
        * gcc.dg/enum-mode-2.c: New test.

From-SVN: r233686
This commit is contained in:
Martin Sebor 2016-02-24 23:26:42 +00:00 committed by Martin Sebor
parent 4429358036
commit 2e9c8641aa
2 changed files with 27 additions and 0 deletions

View file

@ -1,3 +1,8 @@
2016-02-24 Martin Sebor <msebor@redhat.com>
PR c/51147
* gcc.dg/enum-mode-2.c: New test.
2016-02-24 Jakub Jelinek <jakub@redhat.com>
PR c++/69922

View file

@ -0,0 +1,22 @@
/* PR c/51147 - attribute((mode(byte))) on an enum generates wrong code */
/* { dg-do compile } */
/* { dg-additional-options "-O2 -fdump-tree-optimized" } */
enum _eq_bool
{
false,
true
} __attribute__((mode (byte)));
typedef enum _eq_bool bool;
bool foo (void);
bool bar (void);
bool test (void)
{
return foo () || bar ();
}
/* { dg-final { scan-tree-dump-times "foo|bar" 2 "optimized" } } */