File tree Expand file tree Collapse file tree 4 files changed +48
-7
lines changed
goto-instrument/bitfield_naming Expand file tree Collapse file tree 4 files changed +48
-7
lines changed Original file line number Diff line number Diff line change 1+ typedef int __v4 __attribute__((__vector_size__ (16 )));
2+ typedef int __v8 __attribute__((__vector_size__ (32 )));
3+ typedef int __v16 __attribute__((__vector_size__ (64 )));
4+
5+ __v8 foo (__v16 __A )
6+ {
7+ union
8+ {
9+ __v8 __a [2 ];
10+ __v16 __v ;
11+ } __u = {.__v = __A };
12+ return __u .__a [0 ];
13+ }
14+
15+ __v4 bar (__v8 __A )
16+ {
17+ union
18+ {
19+ __v4 __a [2 ];
20+ __v8 __v ;
21+ } __u = {.__v = __A };
22+ return __u .__a [0 ];
23+ }
24+
25+ int main ()
26+ {
27+ }
Original file line number Diff line number Diff line change 1+ CORE gcc-only
2+ main.c
3+
4+ ^EXIT=0$
5+ ^SIGNAL=0$
6+ --
7+ ^warning: ignoring
8+ ^CONVERSION ERROR$
9+ --
10+ We previously got a spurious type conflict for both unions got the same tag name
11+ (as type2name did not correctly name vectors of different size).
Original file line number Diff line number Diff line change 33--show-goto-functions --json-ui
44^EXIT=0$
55^SIGNAL=0$
6- BF1\{U8\}\$U8\$\ 'b11\'
7- BF1\{U8\}\$U8\$\ 'b22\'
8- BF2\{U8\}\$U8\$\ 'b34\'
9- BF4\{U8\}\$U8\$\ 'b58\'
6+ BF1\{U8\}\'b11\'
7+ BF1\{U8\}\'b22\'
8+ BF2\{U8\}\'b34\'
9+ BF4\{U8\}\'b58\'
1010--
1111--
1212
Original file line number Diff line number Diff line change @@ -245,7 +245,11 @@ static std::string type2name(
245245 else if (type.id ()==ID_c_bit_field)
246246 result+=" BF" +pointer_offset_bits_as_string (type, ns);
247247 else if (type.id ()==ID_vector)
248- result+=" VEC" +type.get_string (ID_size);
248+ {
249+ const constant_exprt &size = to_vector_type (type).size ();
250+ const auto size_int = numeric_cast_v<mp_integer>(size);
251+ result += " VEC" + integer2string (size_int);
252+ }
249253 else
250254 throw " unknown type '" +type.id_string ()+" ' encountered" ;
251255
@@ -256,8 +260,7 @@ static std::string type2name(
256260 type2name (to_type_with_subtype (type).subtype (), ns, symbol_number);
257261 result+=' }' ;
258262 }
259-
260- if (type.has_subtypes ())
263+ else if (type.has_subtypes ())
261264 {
262265 result+=' $' ;
263266 for (const typet &subtype : to_type_with_subtypes (type).subtypes ())
You can’t perform that action at this time.
0 commit comments