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 3
3
--show-goto-functions --json-ui
4
4
^EXIT=0$
5
5
^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\'
10
10
--
11
11
--
12
12
Original file line number Diff line number Diff line change @@ -245,7 +245,11 @@ static std::string type2name(
245
245
else if (type.id ()==ID_c_bit_field)
246
246
result+=" BF" +pointer_offset_bits_as_string (type, ns);
247
247
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
+ }
249
253
else
250
254
throw " unknown type '" +type.id_string ()+" ' encountered" ;
251
255
@@ -256,8 +260,7 @@ static std::string type2name(
256
260
type2name (to_type_with_subtype (type).subtype (), ns, symbol_number);
257
261
result+=' }' ;
258
262
}
259
-
260
- if (type.has_subtypes ())
263
+ else if (type.has_subtypes ())
261
264
{
262
265
result+=' $' ;
263
266
for (const typet &subtype : to_type_with_subtypes (type).subtypes ())
You can’t perform that action at this time.
0 commit comments