-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Speed up diff generation #271
base: master
Are you sure you want to change the base?
Conversation
8f708b8
to
123b5a8
Compare
See the diff generated by this PR for the tests here: https://github.com/lifting-bits/rellic/actions/runs/2384753177 fizzbuzz.bc--- /dev/fd/63 2022-05-25 13:44:28.659096994 +0000
+++ /dev/fd/62 2022-05-25 13:44:28.659096994 +0000
@@ -31,10 +31,10 @@
call5 = printf(_str);
}
}
- if (!((int)val3 % 3 != 0U || (int)val4 % 5 == 0U) || (int)val3 % 3 != 0U) {
- if (!((int)val2 >= 30 || (int)val3 % 3 != 0U || (int)val4 % 5 == 0U) || !((int)val2 >= 30 || (int)val3 % 3 == 0U)) {
+ if ((int)val3 % 3 != 0U || !((int)val4 % 5 == 0U || (int)val3 % 3 != 0U)) {
+ if (!((int)val2 >= 30 || (int)val3 % 3 == 0U) || !((int)val2 >= 30 || (int)val4 % 5 == 0U || (int)val3 % 3 != 0U)) {
val6 = var1;
- if ((int)val6 % 3 != 0U) {
+ if ((!((int)val2 >= 30 || (int)val3 % 3 == 0U) || !((int)val4 % 5 == 0U || (int)val2 >= 30 || (int)val3 % 3 != 0U)) && (int)val6 % 3 != 0U) {
val8 = var1;
if ((int)val8 % 5 != 0U) {
val10 = var1;
@@ -43,7 +43,9 @@
call9 = printf(_str_2);
}
} else {
- call7 = printf(_str_1);
+ if ((!((int)val2 >= 30 || (int)val3 % 3 == 0U) || !((int)val4 % 5 == 0U || (int)val2 >= 30 || (int)val3 % 3 != 0U)) && (int)val6 % 3 == 0U) {
+ call7 = printf(_str_1);
+ }
}
}
} typedefs_of_typedefs.bcswitch_loop.bcfunc_cond_zero_arg.bcfcmp.bcconflicting_names.bcstruct.bcissue_183_literal_structs.bczeroinit.bcissue_127_uint128_t_lit.bcstruct_swap.bcglobal_using_function_decl.bcinit_list.bcret0.bcgoto_loop.bcbool.bcbitops.bccast.bcnullptr.bcconflicting_global.bcarray_swap.bcbitmask.bcbinops.bcfloat.bcreg_test_structure_fields.bcnested_while.bc--- /dev/fd/63 2022-05-25 13:44:34.995471124 +0000
+++ /dev/fd/62 2022-05-25 13:44:34.995471124 +0000
@@ -36,7 +36,7 @@
}
}
}
- if ((int)val3 <= 10 || (int)val4 >= 20) {
+ if ((int)val4 >= 20 || (int)val3 <= 10) {
while (1U)
{
val8 = var1; vectors.bcfuncptr.bcinttoptr.bcshort.bctrunc.bcissue_4.bcissue_123_uint128_t.bcfizzbuzz_stateful.bcissue_94_strncmp.bcnested_struct.bczext.bcbyval_struct.bcfunc_cond_two_arg.bcassert.bcloop.bcswitch.bcbranch.bctemplate_parameter_pack.bcbyval_tail_nogep.llbyval_tail_gep.ll |
123b5a8
to
b0d51dd
Compare
See the diff generated by this PR for the tests here: https://github.com/lifting-bits/rellic/actions/runs/2384966492 fizzbuzz.bc--- /dev/fd/63 2022-05-25 14:19:12.703708178 +0000
+++ /dev/fd/62 2022-05-25 14:19:12.703708178 +0000
@@ -31,10 +31,10 @@
call5 = printf(_str);
}
}
- if ((int)val3 % 3 != 0U || !((int)val4 % 5 == 0U || (int)val3 % 3 != 0U)) {
- if (!((int)val2 >= 30 || (int)val3 % 3 == 0U) || !((int)val4 % 5 == 0U || (int)val2 >= 30 || (int)val3 % 3 != 0U)) {
+ if ((int)val3 % 3 != 0U || !((int)val3 % 3 != 0U || (int)val4 % 5 == 0U)) {
+ if (!((int)val2 >= 30 || (int)val3 % 3 == 0U) || !((int)val2 >= 30 || (int)val3 % 3 != 0U || (int)val4 % 5 == 0U)) {
val6 = var1;
- if ((int)val6 % 3 != 0U) {
+ if ((!((int)val2 >= 30 || (int)val3 % 3 == 0U) || !((int)val4 % 5 == 0U || (int)val2 >= 30 || (int)val3 % 3 != 0U)) && (int)val6 % 3 != 0U) {
val8 = var1;
if ((int)val8 % 5 != 0U) {
val10 = var1;
@@ -43,7 +43,9 @@
call9 = printf(_str_2);
}
} else {
- call7 = printf(_str_1);
+ if ((!((int)val2 >= 30 || (int)val3 % 3 == 0U) || !((int)val4 % 5 == 0U || (int)val2 >= 30 || (int)val3 % 3 != 0U)) && (int)val6 % 3 == 0U) {
+ call7 = printf(_str_1);
+ }
}
}
} typedefs_of_typedefs.bcswitch_loop.bcfunc_cond_zero_arg.bcfcmp.bcconflicting_names.bcstruct.bcissue_183_literal_structs.bczeroinit.bcissue_127_uint128_t_lit.bcstruct_swap.bcglobal_using_function_decl.bcinit_list.bcret0.bcgoto_loop.bcbool.bcbitops.bccast.bcnullptr.bcconflicting_global.bcarray_swap.bcbitmask.bcbinops.bcfloat.bcreg_test_structure_fields.bcnested_while.bcvectors.bcfuncptr.bcinttoptr.bcshort.bctrunc.bcissue_4.bcissue_123_uint128_t.bcfizzbuzz_stateful.bcissue_94_strncmp.bcnested_struct.bczext.bcbyval_struct.bcfunc_cond_two_arg.bcassert.bcloop.bcswitch.bcbranch.bctemplate_parameter_pack.bcbyval_tail_nogep.llbyval_tail_gep.ll |
b0d51dd
to
47f41ac
Compare
Repeated conditions tested in
|
Simplifying a bit, that condition becomes |
See the diff generated by this PR for the tests here: https://github.com/lifting-bits/rellic/actions/runs/2691851036 fizzbuzz.bc--- /dev/fd/63 2022-07-18 16:19:25.683939689 +0000
+++ /dev/fd/62 2022-07-18 16:19:25.683939689 +0000
@@ -1,5 +1,5 @@
unsigned int main();
-unsigned int printf(unsigned char *arg0, ...);
+unsigned int printf(void *arg0, ...);
unsigned char _str[10] = "fizzbuzz\n\000";
unsigned char _str_1[6] = "fizz\n\000";
unsigned char _str_2[6] = "buzz\n\000";
@@ -28,22 +28,22 @@
if ((int)val3 % 3 == 0U) {
val4 = var1;
if ((int)val4 % 5 == 0U) {
- call5 = printf("fizzbuzz\n");
+ call5 = printf(_str);
}
}
- if ((int)val3 % 3 != 0U || !((int)val3 % 3 != 0U || (int)val4 % 5 == 0U)) {
- val6 = var1;
- if (((int)val3 % 3 != 0U || !((int)val4 % 5 == 0U || (int)val3 % 3 != 0U)) && (int)val6 % 3 != 0U) {
- val8 = var1;
- if ((int)val8 % 5 != 0U) {
- val10 = var1;
- call11 = printf("%d\n", val10);
+ if (!((int)val3 % 3 != 0U || (int)val4 % 5 == 0U) || (int)val3 % 3 != 0U) {
+ if (!((int)val2 >= 30 || (int)val3 % 3 != 0U || (int)val4 % 5 == 0U) || !((int)val2 >= 30 || (int)val3 % 3 == 0U)) {
+ val6 = var1;
+ if ((int)val6 % 3 != 0U) {
+ val8 = var1;
+ if ((int)val8 % 5 != 0U) {
+ val10 = var1;
+ call11 = printf(_str_3, val10);
+ } else {
+ call9 = printf(_str_2);
+ }
} else {
- call9 = printf("buzz\n");
- }
- } else {
- if (((int)val3 % 3 != 0U || !((int)val4 % 5 == 0U || (int)val3 % 3 != 0U)) && (int)val6 % 3 == 0U) {
- call7 = printf("fizz\n");
+ call7 = printf(_str_1);
}
}
} typedefs_of_typedefs.bc--- /dev/fd/63 2022-07-18 16:19:26.427953408 +0000
+++ /dev/fd/62 2022-07-18 16:19:26.427953408 +0000
@@ -1,5 +1,5 @@
unsigned int main();
-unsigned int printf(unsigned char *arg0, ...);
+unsigned int printf(void *arg0, ...);
unsigned char _str[11] = "a=[%d %d]\n\000";
unsigned char _str_1[29] = "array=[%lld %lld %lld %lld]\n\000";
unsigned long array[4] = {};
@@ -11,16 +11,16 @@
__attribute__((__vector_size__(2 * sizeof(unsigned long)))) unsigned long var4;
__attribute__((__vector_size__(2 * sizeof(unsigned long)))) unsigned long var5;
__attribute__((__vector_size__(2 * sizeof(unsigned long)))) unsigned long var6;
- unsigned int *var7;
+ void *var7;
__attribute__((__vector_size__(2 * sizeof(unsigned long)))) unsigned long val8;
__attribute__((__vector_size__(2 * sizeof(unsigned long)))) unsigned long val9;
__attribute__((__vector_size__(2 * sizeof(unsigned long)))) unsigned long val10;
__attribute__((__vector_size__(2 * sizeof(unsigned long)))) unsigned long val11;
__attribute__((__vector_size__(2 * sizeof(unsigned long)))) unsigned long val12;
__attribute__((__vector_size__(2 * sizeof(unsigned long)))) unsigned long val13;
- unsigned int *val14;
+ void *val14;
unsigned int val15;
- unsigned int *val16;
+ void *val16;
unsigned int val17;
unsigned int call18;
unsigned long val19;
@@ -42,16 +42,16 @@
val12 = var2;
val13 = var3;
var1 = val11 * val12 + val13;
- var7 = (unsigned int *)(&var1);
+ var7 = (&var1);
val14 = var7;
- val15 = *val14;
+ val15 = *((unsigned int *)val14);
val16 = var7;
- val17 = val16[1UL];
- call18 = printf("a=[%d %d]\n", val15, val17);
+ val17 = ((unsigned int *)val16)[1UL];
+ call18 = printf(_str, val15, val17);
val19 = *array;
val20 = array[1UL];
val21 = array[2UL];
val22 = array[3UL];
- call23 = printf("array=[%lld %lld %lld %lld]\n", val19, val20, val21, val22);
+ call23 = printf(_str_1, val19, val20, val21, val22);
return 0U;
} switch_loop.bc--- /dev/fd/63 2022-07-18 16:19:26.539955475 +0000
+++ /dev/fd/62 2022-07-18 16:19:26.543955548 +0000
@@ -1,5 +1,5 @@
unsigned int main();
-unsigned int printf(unsigned char *arg0, ...);
+unsigned int printf(void *arg0, ...);
unsigned char _str[4] = "%d\n\000";
unsigned int main() {
unsigned int var0;
@@ -22,16 +22,16 @@
if (!(val3 != 1U && val3 != 2U && val3 != 3U)) {
if (val3 == 3U) {
val8 = var1;
- call9 = printf("%d\n", val8);
+ call9 = printf(_str, val8);
break;
}
if (val3 == 2U) {
val6 = var1;
- call7 = printf("%d\n", val6);
+ call7 = printf(_str, val6);
}
if (val3 == 1U) {
val4 = var1;
- call5 = printf("%d\n", val4);
+ call5 = printf(_str, val4);
}
}
} while (!(val3 != 1U && val3 != 2U && val3 != 3U)); func_cond_zero_arg.bcfcmp.bc--- /dev/fd/63 2022-07-18 16:19:27.187967431 +0000
+++ /dev/fd/62 2022-07-18 16:19:27.187967431 +0000
@@ -1,6 +1,6 @@
unsigned int main();
-float atof(unsigned char *arg0);
-unsigned int printf(unsigned char *arg0, ...);
+float atof(void *arg0);
+unsigned int printf(void *arg0, ...);
unsigned char _str[2] = "3\000";
unsigned char _str_1[2] = "2\000";
unsigned char _str_2[19] = "%d %d %d %d %d %d\n\000";
@@ -38,9 +38,9 @@
unsigned int val30;
unsigned int call31;
var0 = __builtin_nan("");
- call10 = atof("3");
+ call10 = atof(_str);
var1 = call10;
- call11 = atof("2");
+ call11 = atof(_str_1);
var2 = call11;
val12 = var1;
var3 = -val12;
@@ -68,6 +68,6 @@
val28 = var7;
val29 = var8;
val30 = var9;
- call31 = printf("%d %d %d %d %d %d\n", val25, val26, val27, val28, val29, val30);
+ call31 = printf(_str_2, val25, val26, val27, val28, val29, val30);
return 0U;
} conflicting_names.bc--- /dev/fd/63 2022-07-18 16:19:27.303969571 +0000
+++ /dev/fd/62 2022-07-18 16:19:27.303969571 +0000
@@ -1,7 +1,7 @@
unsigned int foo();
unsigned int bar();
unsigned int main();
-unsigned int atoi(unsigned char *arg0);
+unsigned int atoi(void *arg0);
unsigned int foo() {
unsigned int var0;
unsigned int val1;
@@ -19,14 +19,14 @@
unsigned int main() {
unsigned int var0;
unsigned int var1;
- unsigned char **var2;
+ void *var2;
unsigned int var3;
unsigned int var4;
unsigned int var5;
unsigned int var6;
unsigned int val7;
- unsigned char **val8;
- unsigned char *val9;
+ void *val8;
+ void *val9;
unsigned int call10;
unsigned int val11;
unsigned int val12;
@@ -43,7 +43,7 @@
var3 = val13;
} else {
val8 = var2;
- val9 = val8[1UL];
+ val9 = ((void **)val8)[1UL];
call10 = atoi(val9);
var4 = call10;
val11 = var4; struct.bcissue_183_literal_structs.bc--- /dev/fd/63 2022-07-18 16:19:27.727977394 +0000
+++ /dev/fd/62 2022-07-18 16:19:27.727977394 +0000
@@ -11,35 +11,35 @@
struct union_anon field2;
struct union_anon_0 field3;
};
+unsigned int main();
+unsigned int printf(void *arg0, ...);
+unsigned char _str[4] = "%d\n\000";
struct literal_struct_0 {
unsigned long field0;
unsigned long field1;
};
-unsigned int main();
-unsigned int printf(unsigned char *arg0, ...);
-unsigned char _str[4] = "%d\n\000";
unsigned int bar(unsigned long arg0, unsigned long arg1) {
struct struct_foo_t var0;
- struct literal_struct_0 *val1;
+ void *val1;
unsigned int val2;
- val1 = (struct literal_struct_0 *)(&var0);
- val1->field0 = arg0;
- val1->field1 = arg1;
- val2 = *(unsigned int *)(&var0.field3);
+ val1 = (&var0);
+ ((struct literal_struct_0 *)val1)->field0 = arg0;
+ ((struct literal_struct_0 *)val1)->field1 = arg1;
+ val2 = *(unsigned int *)(void *)(&var0.field3);
return val2;
}
unsigned int main() {
struct struct_foo_t var0;
- struct literal_struct_0 *val1;
+ void *val1;
unsigned long val2;
unsigned long val3;
unsigned int call4;
unsigned int call5;
- *(unsigned int *)(&var0.field3) = 3U;
- val1 = (struct literal_struct_0 *)(&var0);
- val2 = val1->field0;
- val3 = val1->field1;
+ *(unsigned int *)(void *)(&var0.field3) = 3U;
+ val1 = (&var0);
+ val2 = ((struct literal_struct_0 *)val1)->field0;
+ val3 = ((struct literal_struct_0 *)val1)->field1;
call4 = bar(val2, val3);
- call5 = printf("%d\n", call4);
+ call5 = printf(_str, call4);
return 0U;
} issue_127_uint128_t_lit.bcstruct_swap.bcinit_list.bcreg_test_structure_fields.bcret0.bcgoto_loop.bc--- /dev/fd/63 2022-07-18 16:19:28.415990089 +0000
+++ /dev/fd/62 2022-07-18 16:19:28.415990089 +0000
@@ -1,5 +1,5 @@
unsigned int main();
-unsigned int printf(unsigned char *arg0, ...);
+unsigned int printf(void *arg0, ...);
unsigned char _str[4] = "%d\n\000";
unsigned int main() {
unsigned int var0;
@@ -24,14 +24,14 @@
val3 = var1;
if (val3 == 1U) {
val4 = var1;
- call5 = printf("%d\n", val4);
+ call5 = printf(_str, val4);
} else {
val6 = var1;
if (val6 != 2U) {
break;
} else {
val7 = var1;
- call8 = printf("%d\n", val7);
+ call8 = printf(_str, val7);
}
}
}
@@ -39,7 +39,7 @@
val9 = var1;
if (val9 == 3U) {
val10 = var1;
- call11 = printf("%d\n", val10);
+ call11 = printf(_str, val10);
}
val12 = var0;
return val12; bool.bcshort.bccast.bcnullptr.bc--- /dev/fd/63 2022-07-18 16:19:29.272005883 +0000
+++ /dev/fd/62 2022-07-18 16:19:29.272005883 +0000
@@ -1,8 +1,8 @@
unsigned int main();
-unsigned int *ptr = (void *)0U;
+void *ptr = (void *)0U;
unsigned int main() {
unsigned int var0;
- unsigned int *val1;
+ void *val1;
unsigned int val2;
var0 = 0U;
val1 = ptr; conflicting_global.bc--- /dev/fd/63 2022-07-18 16:19:29.460009351 +0000
+++ /dev/fd/62 2022-07-18 16:19:29.460009351 +0000
@@ -1,5 +1,5 @@
unsigned int main();
-unsigned int printf(unsigned char *arg0, ...);
+unsigned int printf(void *arg0, ...);
unsigned int a = 3U;
unsigned char _str[4] = "%d\n\000";
unsigned int main() {
@@ -10,8 +10,8 @@
unsigned int call4;
var0 = 4U;
val1 = var0;
- call2 = printf("%d\n", val1);
+ call2 = printf(_str, val1);
val3 = a;
- call4 = printf("%d\n", val3);
+ call4 = printf(_str, val3);
return 0U;
} array_swap.bcbitmask.bcbinops.bcfloat.bczeroinit.bc--- /dev/fd/63 2022-07-18 16:19:30.452027655 +0000
+++ /dev/fd/62 2022-07-18 16:19:30.452027655 +0000
@@ -4,7 +4,7 @@
unsigned int field1;
};
struct struct__person {
- unsigned char *field0;
+ void *field0;
unsigned char field1;
};
struct struct__record { funcptr.bc--- /dev/fd/63 2022-07-18 16:19:30.716032526 +0000
+++ /dev/fd/62 2022-07-18 16:19:30.716032526 +0000
@@ -26,9 +26,9 @@
}
unsigned int main() {
unsigned int var0;
- unsigned int (*var1)(unsigned int, unsigned int);
+ void *var1;
unsigned int val2;
- unsigned int (*val3)(unsigned int, unsigned int);
+ void *val3;
unsigned int call4;
var0 = 0U;
val2 = x;
@@ -38,6 +38,6 @@
var1 = &add;
}
val3 = var1;
- call4 = val3(2U, 2U);
+ call4 = ((unsigned int (*)(unsigned int, unsigned int))val3)(2U, 2U);
return call4;
} inttoptr.bc--- /dev/fd/63 2022-07-18 16:19:30.912036142 +0000
+++ /dev/fd/62 2022-07-18 16:19:30.912036142 +0000
@@ -2,13 +2,13 @@
unsigned long a = 3735928559UL;
unsigned int main() {
unsigned int var0;
- unsigned int *var1;
+ void *var1;
unsigned long val2;
- unsigned int *val3;
+ void *val3;
unsigned int val4;
var0 = 0U;
val2 = a;
- var1 = (unsigned int *)val2;
+ var1 = (void *)val2;
val3 = var1;
if (val3 == (void *)0U) {
var0 = 0U; branch.bc--- /dev/fd/63 2022-07-18 16:19:31.104039685 +0000
+++ /dev/fd/62 2022-07-18 16:19:31.104039685 +0000
@@ -1,5 +1,5 @@
unsigned int main();
-unsigned int printf(unsigned char *arg0, ...);
+unsigned int printf(void *arg0, ...);
unsigned int a = 0U;
unsigned int c = 1U;
unsigned char _str[39] = "Global variable 'a' of value %u is at \000";
@@ -29,23 +29,23 @@
val3 = c;
if (val3 == 0U) {
val9 = c;
- call10 = printf("Global variable 'c' of value %u is at ", val9);
+ call10 = printf(_str_3, val9);
val11 = var2;
if (val11 % 2UL != 0UL) {
- call13 = printf("odd ");
+ call13 = printf(_str_2);
} else {
- call12 = printf("even ");
+ call12 = printf(_str_1);
}
} else {
val4 = a;
- call5 = printf("Global variable 'a' of value %u is at ", val4);
+ call5 = printf(_str, val4);
val6 = var1;
if (val6 % 2UL != 0UL) {
- call8 = printf("odd ");
+ call8 = printf(_str_2);
} else {
- call7 = printf("even ");
+ call7 = printf(_str_1);
}
}
- call14 = printf("address.\n");
+ call14 = printf(_str_4);
return 0U;
} bitops.bctrunc.bcvectors.bc--- /dev/fd/63 2022-07-18 16:19:31.848053412 +0000
+++ /dev/fd/62 2022-07-18 16:19:31.848053412 +0000
@@ -1,5 +1,5 @@
unsigned int main();
-unsigned int printf(unsigned char *arg0, ...);
+unsigned int printf(void *arg0, ...);
unsigned char _str[17] = "a=[%d %d %d %d]\n\000";
unsigned int main() {
unsigned int var0;
@@ -9,20 +9,20 @@
__attribute__((__vector_size__(4 * sizeof(unsigned int)))) unsigned int var4;
__attribute__((__vector_size__(4 * sizeof(unsigned int)))) unsigned int var5;
__attribute__((__vector_size__(4 * sizeof(unsigned int)))) unsigned int var6;
- unsigned int *var7;
+ void *var7;
__attribute__((__vector_size__(4 * sizeof(unsigned int)))) unsigned int val8;
__attribute__((__vector_size__(4 * sizeof(unsigned int)))) unsigned int val9;
__attribute__((__vector_size__(4 * sizeof(unsigned int)))) unsigned int val10;
__attribute__((__vector_size__(4 * sizeof(unsigned int)))) unsigned int val11;
__attribute__((__vector_size__(4 * sizeof(unsigned int)))) unsigned int val12;
__attribute__((__vector_size__(4 * sizeof(unsigned int)))) unsigned int val13;
- unsigned int *val14;
+ void *val14;
unsigned int val15;
- unsigned int *val16;
+ void *val16;
unsigned int val17;
- unsigned int *val18;
+ void *val18;
unsigned int val19;
- unsigned int *val20;
+ void *val20;
unsigned int val21;
unsigned int call22;
var0 = 0U;
@@ -39,15 +39,15 @@
val12 = var2;
val13 = var3;
var1 = val11 * val12 + val13;
- var7 = (unsigned int *)(&var1);
+ var7 = (&var1);
val14 = var7;
- val15 = *val14;
+ val15 = *((unsigned int *)val14);
val16 = var7;
- val17 = val16[1UL];
+ val17 = ((unsigned int *)val16)[1UL];
val18 = var7;
- val19 = val18[2UL];
+ val19 = ((unsigned int *)val18)[2UL];
val20 = var7;
- val21 = val20[3UL];
- call22 = printf("a=[%d %d %d %d]\n", val15, val17, val19, val21);
+ val21 = ((unsigned int *)val20)[3UL];
+ call22 = printf(_str, val15, val17, val19, val21);
return 0U;
} issue_4.bcissue_123_uint128_t.bcfizzbuzz_stateful.bc--- /dev/fd/63 2022-07-18 16:19:32.304061826 +0000
+++ /dev/fd/62 2022-07-18 16:19:32.304061826 +0000
@@ -1,5 +1,5 @@
void fizzbuzz();
-unsigned int printf(unsigned char *arg0, ...);
+unsigned int printf(void *arg0, ...);
unsigned int main();
unsigned int i = 0U;
unsigned char _str[5] = "fizz\000";
@@ -23,18 +23,18 @@
val2 = i;
if ((int)val2 % 3 == 0U) {
i = 4U;
- call3 = printf("fizz");
+ call3 = printf(_str);
}
val4 = i;
if ((int)val4 % 5 == 0U) {
- call5 = printf("buzz");
+ call5 = printf(_str_1);
}
val6 = i;
if ((int)val6 % 3 != 0U) {
val7 = i;
if ((int)val7 % 5 != 0U) {
val8 = i;
- call9 = printf("%d", val8);
+ call9 = printf(_str_2, val8);
}
}
val10 = var0;
@@ -53,7 +53,7 @@
val1 = i;
if ((int)val1 < 16) {
fizzbuzz();
- call2 = printf("\n");
+ call2 = printf(_str_3);
val3 = i;
i = val3 + 1U;
} issue_94_strncmp.bc--- /dev/fd/63 2022-07-18 16:19:32.736069797 +0000
+++ /dev/fd/62 2022-07-18 16:19:32.736069797 +0000
@@ -1,7 +1,7 @@
unsigned int main();
-unsigned char *strcpy(unsigned char *arg0, unsigned char *arg1);
-unsigned int strncmp(unsigned char *arg0, unsigned char *arg1, unsigned long arg2);
-unsigned int printf(unsigned char *arg0, ...);
+void *strcpy(void *arg0, void *arg1);
+unsigned int strncmp(void *arg0, void *arg1, unsigned long arg2);
+unsigned int printf(void *arg0, ...);
unsigned char _str[6] = "hello\000";
unsigned char _str_1[12] = "helLO WORLD\000";
unsigned char _str_2[70] = "ASCII value of first unmatched character of str1 is greater than str2\000";
@@ -11,26 +11,26 @@
unsigned int var0;
unsigned char var1[20];
unsigned char var2[20];
- unsigned char *call3;
- unsigned char *call4;
+ void *call3;
+ void *call4;
unsigned int call5;
unsigned int call6;
unsigned int call7;
unsigned int call8;
unsigned int call9;
var0 = 0U;
- call3 = strcpy(var1, "hello");
- call4 = strcpy(var2, "helLO WORLD");
+ call3 = strcpy(var1, _str);
+ call4 = strcpy(var2, _str_1);
call5 = strncmp(var1, var2, 3UL);
if ((int)call5 <= 0) {
call7 = strncmp(var1, var2, 3UL);
if ((int)call7 >= 0) {
- call9 = printf("Both the strings str1 and str2 are equal");
+ call9 = printf(_str_4);
} else {
- call8 = printf("ASCII value of first unmatched character of str1 is less than str2");
+ call8 = printf(_str_3);
}
} else {
- call6 = printf("ASCII value of first unmatched character of str1 is greater than str2");
+ call6 = printf(_str_2);
}
return 0U;
} nested_struct.bc--- /dev/fd/63 2022-07-18 16:19:33.012074889 +0000
+++ /dev/fd/62 2022-07-18 16:19:33.012074889 +0000
@@ -1,12 +1,12 @@
unsigned int main();
-unsigned int printf(unsigned char *arg0, ...);
+unsigned int printf(void *arg0, ...);
unsigned char _str[4] = "Bob\000";
struct struct__pair {
unsigned int field0;
unsigned int field1;
};
struct struct__person {
- unsigned char *field0;
+ void *field0;
unsigned char field1;
};
struct struct__record {
@@ -14,16 +14,16 @@
struct struct__pair field1;
struct struct__person field2;
};
-struct struct__record r1 = {14U, {33U, 42U}, {"Bob", (unsigned char)66U}};
+struct struct__record r1 = {14U, {33U, 42U}, {_str, (unsigned char)66U}};
unsigned char _str_1[9] = "Name: %s\000";
unsigned int main() {
unsigned int var0;
- unsigned char *val1;
+ void *val1;
unsigned int call2;
unsigned int val3;
var0 = 0U;
val1 = r1.field2.field0;
- call2 = printf("Name: %s", val1);
+ call2 = printf(_str_1, val1);
val3 = r1.field1.field1;
return val3;
} global_using_function_decl.bc--- /dev/fd/63 2022-07-18 16:19:33.128077029 +0000
+++ /dev/fd/62 2022-07-18 16:19:33.128077029 +0000
@@ -1,14 +1,14 @@
void some_func(unsigned int arg0);
unsigned int main();
-void (*afunc_pointer)(unsigned int) = &some_func;
+void *afunc_pointer = &some_func;
void some_func(unsigned int arg0) {
unsigned int var0;
var0 = arg0;
return;
}
unsigned int main() {
- void (*val0)(unsigned int);
+ void *val0;
val0 = afunc_pointer;
- val0(0U);
+ ((void (*)(unsigned int))val0)(0U);
return 0U;
} byval_struct.bc--- /dev/fd/63 2022-07-18 16:19:33.244079170 +0000
+++ /dev/fd/62 2022-07-18 16:19:33.244079170 +0000
@@ -6,8 +6,8 @@
};
unsigned long get_3x(struct struct_foo arg0);
unsigned int main();
-unsigned int atoi(unsigned char *arg0);
-unsigned int printf(unsigned char *arg0, ...);
+unsigned int atoi(void *arg0);
+unsigned int printf(void *arg0, ...);
unsigned char _str[2] = "1\000";
unsigned char _str_1[2] = "2\000";
unsigned char _str_2[2] = "3\000";
@@ -16,10 +16,10 @@
unsigned long get_3x(struct struct_foo arg0) {
unsigned long val0;
unsigned long val1;
- struct struct_foo *arg0_ptr = &arg0;
- val0 = arg0_ptr->field0;
- arg0_ptr->field0 = val0 * 3UL;
- val1 = arg0_ptr->field0;
+ void *arg0_ptr = &arg0;
+ val0 = ((struct struct_foo *)arg0_ptr)->field0;
+ ((struct struct_foo *)arg0_ptr)->field0 = val0 * 3UL;
+ val1 = ((struct struct_foo *)arg0_ptr)->field0;
return val1;
}
unsigned int main() {
@@ -33,18 +33,18 @@
unsigned long val7;
unsigned long val8;
unsigned int call9;
- call2 = atoi("1");
+ call2 = atoi(_str);
var0.field0 = (long)call2;
- call3 = atoi("2");
+ call3 = atoi(_str_1);
var0.field1 = (long)call3;
- call4 = atoi("3");
+ call4 = atoi(_str_2);
var0.field2 = (long)call4;
- call5 = atoi("4");
+ call5 = atoi(_str_3);
var0.field3 = (long)call5;
call6 = get_3x(var0);
var1 = call6;
val7 = var0.field0;
val8 = var1;
- call9 = printf("%lld %lld\n", val7, val8);
+ call9 = printf(_str_4, val7, val8);
return 0U;
} nested_while.bc--- /dev/fd/63 2022-07-18 16:19:33.360081310 +0000
+++ /dev/fd/62 2022-07-18 16:19:33.360081310 +0000
@@ -1,6 +1,6 @@
unsigned int main();
-unsigned int atoi(unsigned char *arg0);
-unsigned int printf(unsigned char *arg0, ...);
+unsigned int atoi(void *arg0);
+unsigned int printf(void *arg0, ...);
unsigned char _str[2] = "5\000";
unsigned char _str_1[13] = "loop1 x: %d\n\000";
unsigned char _str_2[13] = "loop2 x: %d\n\000";
@@ -19,31 +19,39 @@
unsigned int call11;
unsigned int val12;
var0 = 0U;
- call2 = atoi("5");
+ call2 = atoi(_str);
var1 = call2;
val3 = var1;
if ((int)val3 > 10) {
- do {
- val4 = var1;
- if ((int)val4 < 20) {
- val5 = var1;
- var1 = val5 + 1U;
- val6 = var1;
- call7 = printf("loop1 x: %d\n", val6);
+ while (1U)
+ {
+ val4 = var1;
+ if ((int)val4 >= 20) {
+ break;
+ } else {
+ val5 = var1;
+ var1 = val5 + 1U;
+ val6 = var1;
+ call7 = printf(_str_1, val6);
+ }
}
- } while ((int)val4 < 20);
}
if ((int)val4 >= 20 || (int)val3 <= 10) {
- do {
- val8 = var1;
- if ((int)val8 < 20) {
- val9 = var1;
- var1 = val9 + 1U;
- val10 = var1;
- call11 = printf("loop2 x: %d\n", val10);
+ while (1U)
+ {
+ val8 = var1;
+ if ((int)val8 >= 20) {
+ break;
+ } else {
+ val9 = var1;
+ var1 = val9 + 1U;
+ val10 = var1;
+ call11 = printf(_str_2, val10);
+ }
}
- } while ((int)val8 < 20);
- val12 = var0;
- return val12;
+ if ((int)val8 >= 20) {
+ val12 = var0;
+ return val12;
+ }
}
} func_cond_two_arg.bczext.bcassert.bc--- /dev/fd/63 2022-07-18 16:19:34.144095776 +0000
+++ /dev/fd/62 2022-07-18 16:19:34.144095776 +0000
@@ -1,5 +1,5 @@
unsigned int main();
-void __assert_fail(unsigned char *arg0, unsigned char *arg1, unsigned int arg2, unsigned char *arg3);
+void __assert_fail(void *arg0, void *arg1, unsigned int arg2, void *arg3);
unsigned long a = 1UL;
unsigned char _str[6] = "a % 3\000";
unsigned char _str_1[9] = "assert.c\000";
@@ -14,15 +14,15 @@
var0 = 0U;
val1 = a;
if (val1 % 3UL == 0UL) {
- __assert_fail("a % 3", "assert.c", 6U, "int main(void)");
+ __assert_fail(_str, _str_1, 6U, __PRETTY_FUNCTION___main);
} else {
val2 = a;
if (val2 % 7UL == 0UL) {
- __assert_fail("a % 7", "assert.c", 7U, "int main(void)");
+ __assert_fail(_str_2, _str_1, 7U, __PRETTY_FUNCTION___main);
} else {
val3 = a;
if (val3 % 15UL == 0UL) {
- __assert_fail("a % 15", "assert.c", 8U, "int main(void)");
+ __assert_fail(_str_3, _str_1, 8U, __PRETTY_FUNCTION___main);
} else {
return 0U;
} loop.bc--- /dev/fd/63 2022-07-18 16:19:34.532102882 +0000
+++ /dev/fd/62 2022-07-18 16:19:34.532102882 +0000
@@ -1,5 +1,5 @@
unsigned int main();
-unsigned int printf(unsigned char *arg0, ...);
+unsigned int printf(void *arg0, ...);
unsigned char _str[19] = "Variable at %d is \000";
unsigned char _str_1[7] = "even.\n\000";
unsigned char _str_2[6] = "odd.\n\000";
@@ -19,12 +19,12 @@
val2 = var1;
if (val2 != 10U) {
val3 = var1;
- call4 = printf("Variable at %d is ", val3);
+ call4 = printf(_str, val3);
val5 = var1;
if (val5 % 2U != 0U) {
- call7 = printf("odd.\n");
+ call7 = printf(_str_2);
} else {
- call6 = printf("even.\n");
+ call6 = printf(_str_1);
}
val8 = var1;
var1 = val8 + 1U; switch.bctemplate_parameter_pack.bc--- /dev/fd/63 2022-07-18 16:19:35.040112154 +0000
+++ /dev/fd/62 2022-07-18 16:19:35.040112154 +0000
@@ -1,5 +1,5 @@
unsigned int main();
-unsigned int printf(unsigned char *arg0, ...);
+unsigned int printf(void *arg0, ...);
unsigned int _Z3sumIiJiiiiEET_S0_DpT0_(unsigned int arg0, unsigned int arg1, unsigned int arg2, unsigned int arg3, unsigned int arg4);
unsigned int _Z3sumIiJiiiEET_S0_DpT0_(unsigned int arg0, unsigned int arg1, unsigned int arg2, unsigned int arg3);
unsigned int _Z3sumIiJiiEET_S0_DpT0_(unsigned int arg0, unsigned int arg1, unsigned int arg2);
@@ -9,7 +9,7 @@
unsigned int call0;
unsigned int call1;
call0 = _Z3sumIiJiiiiEET_S0_DpT0_(1U, 2U, 3U, 4U, 5U);
- call1 = printf("%d\n", call0);
+ call1 = printf(_str, call0);
return 0U;
}
unsigned int _Z3sumIiJiiiiEET_S0_DpT0_(unsigned int arg0, unsigned int arg1, unsigned int arg2, unsigned int arg3, unsigned int arg4) { byval_tail_nogep.ll--- /dev/fd/63 2022-07-18 16:19:35.128113760 +0000
+++ /dev/fd/62 2022-07-18 16:19:35.128113760 +0000
@@ -5,7 +5,7 @@
double _Z3bar8big_base(struct struct_big_base arg0);
double _Z3foo8big_base(struct struct_big_base x) {
double call0;
- struct struct_big_base *x_ptr = &x;
- call0 = _Z3bar8big_base(*x_ptr);
+ void *x_ptr = &x;
+ call0 = _Z3bar8big_base(*(struct struct_big_base *)x_ptr);
return call0;
} byval_tail_gep.ll--- /dev/fd/63 2022-07-18 16:19:35.216115367 +0000
+++ /dev/fd/62 2022-07-18 16:19:35.216115367 +0000
@@ -8,7 +8,7 @@
double _Z3bar8big_base(struct struct_big_base arg0);
double _Z3foo11big_derived(struct struct_big_derived x) {
double call0;
- struct struct_big_derived *x_ptr = &x;
- call0 = _Z3bar8big_base(x_ptr->field0);
+ void *x_ptr = &x;
+ call0 = _Z3bar8big_base(((struct struct_big_derived *)x_ptr)->field0);
return call0;
} |
No description provided.