aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tccasm.c3
-rw-r--r--tccelf.c9
-rw-r--r--tccgen.c7
-rw-r--r--tccpp.c3
4 files changed, 14 insertions, 8 deletions
diff --git a/tccasm.c b/tccasm.c
index 263b0f5..36a5720 100644
--- a/tccasm.c
+++ b/tccasm.c
@@ -991,7 +991,7 @@ ST_FUNC void asm_instr(void)
{
CString astr, astr1;
ASMOperand operands[MAX_ASM_OPERANDS];
- int nb_inputs, nb_outputs, nb_operands, i, must_subst, out_reg;
+ int nb_outputs, nb_operands, i, must_subst, out_reg;
uint8_t clobber_regs[NB_ASM_REGS];
next();
@@ -1040,7 +1040,6 @@ ST_FUNC void asm_instr(void)
token after the assembler parsing */
if (tok != ';')
expect("';'");
- nb_inputs = nb_operands - nb_outputs;
/* save all values in the memory */
save_regs(0);
diff --git a/tccelf.c b/tccelf.c
index e6f4f8f..8d91daa 100644
--- a/tccelf.c
+++ b/tccelf.c
@@ -1033,7 +1033,7 @@ static void put_got_entry(TCCState *s1,
/* build GOT and PLT entries */
ST_FUNC void build_got_entries(TCCState *s1)
{
- Section *s, *symtab;
+ Section *s;
ElfW_Rel *rel, *rel_end;
ElfW(Sym) *sym;
int i, type, reloc_type, sym_index;
@@ -1045,7 +1045,6 @@ ST_FUNC void build_got_entries(TCCState *s1)
/* no need to handle got relocations */
if (s->link != symtab_section)
continue;
- symtab = s->link;
rel_end = (ElfW_Rel *)(s->data + s->data_offset);
for(rel = (ElfW_Rel *)s->data;
rel < rel_end;
@@ -1456,7 +1455,9 @@ static int elf_output_file(TCCState *s1, const char *filename)
ElfW(Sym) *sym;
int type, file_type;
unsigned long rel_addr, rel_size;
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
unsigned long bss_addr, bss_size;
+#endif
file_type = s1->output_type;
s1->nb_errors = 0;
@@ -1788,7 +1789,9 @@ static int elf_output_file(TCCState *s1, const char *filename)
rel_size = 0;
rel_addr = 0;
- bss_addr = bss_size = 0;
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ bss_addr = bss_size = 0;
+#endif
/* leave one program header for the program interpreter */
ph = &phdr[0];
if (interp)
diff --git a/tccgen.c b/tccgen.c
index a4897f6..2ce6820 100644
--- a/tccgen.c
+++ b/tccgen.c
@@ -647,7 +647,10 @@ static void gbound(void)
register value (such as structures). */
ST_FUNC int gv(int rc)
{
- int r, rc2, bit_pos, bit_size, size, align, i;
+ int r, bit_pos, bit_size, size, align, i;
+#ifndef TCC_TARGET_X86_64
+ int rc2;
+#endif
/* NOTE: get_reg can modify vstack[] */
if (vtop->type.t & VT_BITFIELD) {
@@ -718,9 +721,11 @@ ST_FUNC int gv(int rc)
#endif
r = vtop->r & VT_VALMASK;
+#ifndef TCC_TARGET_X86_64
rc2 = RC_INT;
if (rc == RC_IRET)
rc2 = RC_LRET;
+#endif
/* need to reload if:
- constant
- lvalue (need to dereference pointer)
diff --git a/tccpp.c b/tccpp.c
index feb533a..6aa067f 100644
--- a/tccpp.c
+++ b/tccpp.c
@@ -3011,7 +3011,6 @@ ST_FUNC void preprocess_new()
{
int i, c;
const char *p, *r;
- TokenSym *ts;
/* init isid table */
for(i=CH_EOF;i<256;i++)
@@ -3030,7 +3029,7 @@ ST_FUNC void preprocess_new()
if (c == '\0')
break;
}
- ts = tok_alloc(p, r - p - 1);
+ tok_alloc(p, r - p - 1);
p = r;
}
}