summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/Makefile20
-rwxr-xr-xgcc/function.c2
-rwxr-xr-xgcc/loop.c4
-rwxr-xr-xgcc/thumb.c4
-rwxr-xr-xgcc/unroll.c12
5 files changed, 36 insertions, 6 deletions
diff --git a/gcc/Makefile b/gcc/Makefile
index 358b1de..eb6d667 100644
--- a/gcc/Makefile
+++ b/gcc/Makefile
@@ -24,7 +24,7 @@ VPATH = $(srcdir)
CC = gcc
-CFLAGS = -g -std=gnu11 -Wunused-function -m32
+BASE_CFLAGS = -g -std=gnu11 -Wunused-function -m32
INCLUDES = -I. -I$(srcdir)
@@ -55,8 +55,17 @@ GENERATED = genrtl.c genrtl.h \
tree-check.h \
insn-config.h insn-flags.h insn-codes.h insn-attr.h
-agbcc: $(OBJS)
- $(CC) $(CFLAGS) -o $@ $(OBJS) $(RTL_OBJS) $(PRINT_OBJS) $(RTLANAL_OBJS)
+.PHONY: normal old clean
+
+# The usual compiler.
+normal: CFLAGS = $(BASE_CFLAGS)
+normal: $(OBJS)
+ $(CC) $(CFLAGS) -o agbcc $(OBJS) $(RTL_OBJS) $(PRINT_OBJS) $(RTLANAL_OBJS)
+
+# The old version of the compiler, used for building libgcc.
+old: CFLAGS = $(BASE_CFLAGS) -DOLD_COMPILER
+old: $(OBJS)
+ $(CC) $(CFLAGS) -o old_agbcc $(OBJS) $(RTL_OBJS) $(PRINT_OBJS) $(RTLANAL_OBJS)
# Clear suffixes.
.SUFFIXES:
@@ -84,10 +93,9 @@ $(DEPDIR)/%.d: ;
GEN = genemit genoutput genrecog genextract genflags gencodes genconfig \
genpeep gengenrtl gencheck genattr genattrtab genopinit
-.PHONY: clean
-
clean:
- $(RM) agbcc agbcc.exe $(OBJS) $(RTL_OBJS) $(RTLANAL_OBJS) $(PRINT_OBJS)
+ $(RM) agbcc agbcc.exe old_agbcc old_agbcc.exe
+ $(RM) $(OBJS) $(RTL_OBJS) $(RTLANAL_OBJS) $(PRINT_OBJS)
$(RM) $(GENERATED)
$(RM) $(GEN) $(addsuffix .exe,$(GEN)) $(addsuffix .o,$(GEN))
$(RM) s-config s-flags s-codes s-emit s-recog s-opinit s-extract s-peep \
diff --git a/gcc/function.c b/gcc/function.c
index d5ffd30..5119688 100755
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -6133,7 +6133,9 @@ expand_function_end (filename, line, end_bindings)
use_variable (outgoing);
}
+#ifndef OLD_COMPILER
use_return_register ();
+#endif
/* If this is an implementation of __throw, do what's necessary to
communicate between __builtin_eh_return and the epilogue. */
diff --git a/gcc/loop.c b/gcc/loop.c
index 17bf814..10ba3ed 100755
--- a/gcc/loop.c
+++ b/gcc/loop.c
@@ -7634,8 +7634,12 @@ check_dbra_loop (loop_end, insn_count, loop_start, loop_info)
}
}
}
+#ifndef OLD_COMPILER
else if (GET_CODE (bl->biv->add_val) == CONST_INT
&& INTVAL (bl->biv->add_val) > 0)
+#else
+ else if (INTVAL (bl->biv->add_val) > 0)
+#endif
{
/* Try to change inc to dec, so can apply above optimization. */
/* Can do this if:
diff --git a/gcc/thumb.c b/gcc/thumb.c
index 0310a51..a513436 100755
--- a/gcc/thumb.c
+++ b/gcc/thumb.c
@@ -1512,6 +1512,7 @@ arm_valid_machine_decl_attribute(tree decl, tree attributes, tree attr, tree arg
int
s_register_operand(rtx op, enum machine_mode mode)
{
+#ifndef OLD_COMPILER
if (GET_MODE(op) != mode && mode != VOIDmode)
return 0;
@@ -1524,4 +1525,7 @@ s_register_operand(rtx op, enum machine_mode mode)
return (GET_CODE(op) == REG
&& (REGNO(op) >= FIRST_PSEUDO_REGISTER
|| REGNO_REG_CLASS(REGNO(op)) != NO_REGS));
+#else
+ return register_operand(op, mode);
+#endif
}
diff --git a/gcc/unroll.c b/gcc/unroll.c
index 5ffb7d1..2017fdf 100755
--- a/gcc/unroll.c
+++ b/gcc/unroll.c
@@ -238,7 +238,9 @@ unroll_loop (loop_end, insn_count, loop_start, end_insert_before,
struct inline_remap *map;
char *local_label;
char *local_regno;
+#ifndef OLD_COMPILER
int max_local_regnum;
+#endif
int maxregnum;
int new_maxregnum;
rtx exit_label = 0;
@@ -756,8 +758,10 @@ unroll_loop (loop_end, insn_count, loop_start, end_insert_before,
/* The preconditioning code may allocate two new pseudo registers. */
maxregnum = max_reg_num ();
+#ifndef OLD_COMPILER
/* local_regno is only valid for regnos < max_local_regnum. */
max_local_regnum = maxregnum;
+#endif
/* Allocate and zero out the splittable_regs and addr_combined_regs
arrays. These must be zeroed here because they will be used if
@@ -1058,7 +1062,11 @@ unroll_loop (loop_end, insn_count, loop_start, end_insert_before,
if (local_label[j])
set_label_in_map (map, j, gen_label_rtx ());
+#ifndef OLD_COMPILER
for (j = FIRST_PSEUDO_REGISTER; j < max_local_regnum; j++)
+#else
+ for (j = FIRST_PSEUDO_REGISTER; j < maxregnum; j++)
+#endif
if (local_regno[j])
{
map->reg_map[j] = gen_reg_rtx (GET_MODE (regno_reg_rtx[j]));
@@ -1214,7 +1222,11 @@ unroll_loop (loop_end, insn_count, loop_start, end_insert_before,
if (local_label[j])
set_label_in_map (map, j, gen_label_rtx ());
+#ifndef OLD_COMPILER
for (j = FIRST_PSEUDO_REGISTER; j < max_local_regnum; j++)
+#else
+ for (j = FIRST_PSEUDO_REGISTER; j < maxregnum; j++)
+#endif
if (local_regno[j])
{
map->reg_map[j] = gen_reg_rtx (GET_MODE (regno_reg_rtx[j]));