Commit 4bf8dbe1 by Bernd Edlinger Committed by Bernd Edlinger

decl.c (finish_enum_value_list): Use the specified mode.

2016-05-19  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        * decl.c (finish_enum_value_list): Use the specified mode.

testsuite:
2016-05-19  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        * c-c++-common/pr69669.c: Check the used mode.

From-SVN: r236458
parent f3510625
2016-05-19 Bernd Edlinger <bernd.edlinger@hotmail.de>
* decl.c (finish_enum_value_list): Use the specified mode.
2016-05-18 Jason Merrill <jason@redhat.com>
* pt.c (value_dependent_expression_p): Tweak new cases to better
......
......@@ -13346,6 +13346,19 @@ finish_enum_value_list (tree enumtype)
use_short_enum = flag_short_enums
|| lookup_attribute ("packed", TYPE_ATTRIBUTES (enumtype));
/* If the precision of the type was specified with an attribute and it
was too small, give an error. Otherwise, use it. */
if (TYPE_PRECISION (enumtype))
{
if (precision > TYPE_PRECISION (enumtype))
error ("specified mode too small for enumeral values");
else
{
use_short_enum = true;
precision = TYPE_PRECISION (enumtype);
}
}
for (itk = (use_short_enum ? itk_char : itk_int);
itk != itk_none;
itk++)
......
2016-05-19 Bernd Edlinger <bernd.edlinger@hotmail.de>
* c-c++-common/pr69669.c: Check the used mode.
2016-05-19 Maxim Ostapenko <m.ostapenko@samsung.com>
PR sanitizer/64354
......
/* PR c/69669 */
/* { dg-do compile } */
/* { dg-options "-fdump-rtl-final" } */
enum __attribute__((mode(QI))) E { F = 1 };
......@@ -8,3 +9,5 @@ foo (enum E *x, int y)
{
*x = (enum E) y;
}
/* { dg-final { scan-rtl-dump-times "mem:QI" 1 "final" } } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment