Without setting this bit, even for a small enumeration types their member fields contain random 0/1's as the values of "artificial". When comparing two instances of exactly the same
enum type, the result depends on whether their members contain the same garbage as the value of artificial.
gdb/ChangeLog:
2017-02-11 Maxim Akhmedov <max42@yandex-team.ru>
* dwarf2read.c: fix uninitialized bit in a struct field corresponding
to enumeration member.
---
gdb/dwarf2read.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 774ed73075..676da14c58 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -13652,6 +13652,7 @@ process_enumeration_scope (struct die_info *die, struct dwarf2_cu *cu)
FIELD_TYPE (fields[num_fields]) = NULL;
SET_FIELD_ENUMVAL (fields[num_fields], SYMBOL_VALUE (sym));
FIELD_BITSIZE (fields[num_fields]) = 0;
+ FIELD_ARTIFICIAL (fields[num_fields]) = 0;
num_fields++;
}