Unified · Split
| @@ -136,7 +136,8 @@ void o(unsigned long i) · 135 unmodified lines | ||
| 136 | 136 | static unsigned long stuff_const(unsigned long op,unsigned long c) |
| 137 | 137 | { |
| 138 | 138 | int try_neg=0; |
| 139 | − unsigned long nc,negop; | |
| 139 | + unsigned long nc = 0,negop = 0; | |
| 140 | + | |
| 140 | 141 | switch(op&0x1F00000) |
| 141 | 142 | { |
| 142 | 143 | case 0x800000: //add |
| @@ -901,8 +902,8 @@ int gtst(int inv, int t) · 758 unmodified lines | ||
| 901 | 902 | /* generate an integer binary operation */ |
| 902 | 903 | void gen_opi(int op) |
| 903 | 904 | { |
| 904 | − int c, func; | |
| 905 | − unsigned long opc,r,fr; | |
| 905 | + int c, func = 0; | |
| 906 | + unsigned long opc = 0,r,fr; | |
| 906 | 907 | |
| 907 | 908 | c=0; |
| 908 | 909 | switch(op) { |
| @@ -989,6 +990,7 @@ void gen_opi(int op) · 80 unmodified lines | ||
| 989 | 990 | default: |
| 990 | 991 | opc = 0x15; |
| 991 | 992 | c=1; |
| 993 | + break; | |
| 992 | 994 | } |
| 993 | 995 | switch(c) { |
| 994 | 996 | case 1: |
| @@ -1551,7 +1551,7 @@ void C67_SHR(int r, int v) · 1550 unmodified lines | ||
| 1551 | 1551 | /* load 'r' from value 'sv' */ |
| 1552 | 1552 | void load(int r, SValue * sv) |
| 1553 | 1553 | { |
| 1554 | − int v, t, ft, fc, fr, size, element; | |
| 1554 | + int v, t, ft, fc, fr, size = 0, element; | |
| 1555 | 1555 | BOOL Unsigned = false; |
| 1556 | 1556 | SValue v1; |
| 1557 | 1557 | |
| @@ -1873,7 +1873,7 @@ static void gcall_or_jmp(int is_jmp) · 315 unmodified lines | ||
| 1873 | 1873 | context. Stack entry is popped */ |
| 1874 | 1874 | void gfunc_call(int nb_args) |
| 1875 | 1875 | { |
| 1876 | − int i, r, size; | |
| 1876 | + int i, r, size = 0; | |
| 1877 | 1877 | int args_sizes[NoCallArgsPassedOnStack]; |
| 1878 | 1878 | |
| 1879 | 1879 | if (nb_args > NoCallArgsPassedOnStack) { |
| @@ -2518,12 +2518,14 @@ void gen_cvt_ftof(int t) · 638 unmodified lines | ||
| 2518 | 2518 | |
| 2519 | 2519 | r = vtop->r; |
| 2520 | 2520 | |
| 2521 | − if (r == TREG_EAX) // make sure the paired reg is avail | |
| 2521 | + if (r == TREG_EAX) { // make sure the paired reg is avail | |
| 2522 | 2522 | r2 = get_reg(RC_ECX); |
| 2523 | − else if (r == TREG_EDX) | |
| 2523 | + } else if (r == TREG_EDX) { | |
| 2524 | 2524 | r2 = get_reg(RC_ST0); |
| 2525 | − else | |
| 2525 | + } else { | |
| 2526 | 2526 | ALWAYS_ASSERT(FALSE); |
| 2527 | + r2 = 0; /* avoid warning */ | |
| 2528 | + } | |
| 2527 | 2529 | |
| 2528 | 2530 | C67_SPDP(r, r); // convert it to DP same register |
| 2529 | 2531 | C67_NOP(1); |
| @@ -448,9 +448,12 @@ static void relocate_section(TCCState *s1, Section *s) · 447 unmodified lines | ||
| 448 | 448 | Section *sr; |
| 449 | 449 | Elf32_Rel *rel, *rel_end, *qrel; |
| 450 | 450 | Elf32_Sym *sym; |
| 451 | − int type, sym_index, esym_index; | |
| 451 | + int type, sym_index; | |
| 452 | 452 | unsigned char *ptr; |
| 453 | 453 | unsigned long val, addr; |
| 454 | +#if defined(TCC_TARGET_I386) | |
| 455 | + int esym_index; | |
| 456 | +#endif | |
| 454 | 457 | |
| 455 | 458 | sr = s->reloc; |
| 456 | 459 | rel_end = (Elf32_Rel *)(sr->data + sr->data_offset); |
| @@ -662,10 +665,12 @@ static void put32(unsigned char *p, uint32_t val) · 205 unmodified lines | ||
| 662 | 665 | p[3] = val >> 24; |
| 663 | 666 | } |
| 664 | 667 | |
| 668 | +#if defined(TCC_TARGET_I386) || defined(TCC_TARGET_ARM) | |
| 665 | 669 | static uint32_t get32(unsigned char *p) |
| 666 | 670 | { |
| 667 | 671 | return p[0] | (p[1] << 8) | (p[2] << 16) | (p[3] << 24); |
| 668 | 672 | } |
| 673 | +#endif | |
| 669 | 674 | |
| 670 | 675 | static void build_got(TCCState *s1) |
| 671 | 676 | { |