1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/patches/gcc/2.95.3/arm-linux.patch Tue May 22 20:48:39 2007 +0000
1.3 @@ -0,0 +1,647 @@
1.4 +--------- snip -------
1.5 +Downloaded from ftp://ftp.linux.org.uk/pub/armlinux/toolchain/src-2.95.3/gcc-2.95.3.diff.bz2
1.6 +Not sure what it fixes, but this appears to be The Patch used with gcc-2.95.3 on arm.
1.7 +--------- snip -------
1.8 +
1.9 +diff -urN gcc-2.95.3-orig/gcc/config/arm/arm.c gcc-2.95.3/gcc/config/arm/arm.c
1.10 +--- gcc-2.95.3-orig/gcc/config/arm/arm.c Thu Jan 25 15:03:24 2001
1.11 ++++ gcc-2.95.3/gcc/config/arm/arm.c Fri Jul 20 19:39:11 2001
1.12 +@@ -1529,27 +1529,34 @@
1.13 + return gen_rtx_PLUS (Pmode, base, offset);
1.14 + }
1.15 + else if (GET_CODE (orig) == LABEL_REF)
1.16 +- current_function_uses_pic_offset_table = 1;
1.17 +-
1.18 +- return orig;
1.19 +-}
1.20 ++ {
1.21 ++ current_function_uses_pic_offset_table = 1;
1.22 +
1.23 +-static rtx pic_rtx;
1.24 ++ if (NEED_PLT_GOT)
1.25 ++ {
1.26 ++ rtx pic_ref, address = gen_reg_rtx (Pmode);
1.27 ++
1.28 ++ emit_insn (gen_pic_load_addr (address, orig));
1.29 ++ pic_ref = gen_rtx_PLUS (Pmode, pic_offset_table_rtx,
1.30 ++ address);
1.31 ++ emit_move_insn (address, pic_ref);
1.32 ++ return address;
1.33 ++ }
1.34 ++ }
1.35 +
1.36 +-int
1.37 +-is_pic(x)
1.38 +- rtx x;
1.39 +-{
1.40 +- if (x == pic_rtx)
1.41 +- return 1;
1.42 +- return 0;
1.43 ++ return orig;
1.44 + }
1.45 +
1.46 ++/* Generate code to load the PIC register. PROLOGUE is true if
1.47 ++ called from arm_expand_prologue (in which case we want the
1.48 ++ generated insns at the start of the function); false if called
1.49 ++ by an exception receiver that needs the PIC register reloaded
1.50 ++ (in which case the insns are just dumped at the current location). */
1.51 + void
1.52 +-arm_finalize_pic ()
1.53 ++arm_finalize_pic (int prologue)
1.54 + {
1.55 + #ifndef AOF_ASSEMBLER
1.56 +- rtx l1, pic_tmp, pic_tmp2, seq;
1.57 ++ rtx l1, pic_tmp, pic_tmp2, seq, pic_rtx;
1.58 + rtx global_offset_table;
1.59 +
1.60 + if (current_function_uses_pic_offset_table == 0)
1.61 +@@ -1578,7 +1585,10 @@
1.62 +
1.63 + seq = gen_sequence ();
1.64 + end_sequence ();
1.65 +- emit_insn_after (seq, get_insns ());
1.66 ++ if (prologue)
1.67 ++ emit_insn_after (seq, get_insns ());
1.68 ++ else
1.69 ++ emit_insn (seq);
1.70 +
1.71 + /* Need to emit this whether or not we obey regdecls,
1.72 + since setjmp/longjmp can cause life info to screw up. */
1.73 +@@ -5327,7 +5337,13 @@
1.74 + if (frame_pointer_needed)
1.75 + live_regs += 4;
1.76 +
1.77 +- if (live_regs)
1.78 ++ if (live_regs == 1 && regs_ever_live[LR_REGNUM]
1.79 ++ && ! lr_save_eliminated && ! really_return)
1.80 ++ {
1.81 ++ output_asm_insn (reverse ? "ldr%?%D0\t%|lr, [%|sp}, #4"
1.82 ++ : "ldr%?%d0\t%|lr, [%|sp], #4", &operand);
1.83 ++ }
1.84 ++ else if (live_regs)
1.85 + {
1.86 + if (lr_save_eliminated || ! regs_ever_live[14])
1.87 + live_regs++;
1.88 +@@ -5446,7 +5462,7 @@
1.89 + rtx x;
1.90 +
1.91 + length = strlen (name);
1.92 +- alignlength = (length + 1) + 3 & ~3;
1.93 ++ alignlength = ((length + 1) + 3) & ~3;
1.94 +
1.95 + ASM_OUTPUT_ASCII (stream, name, length + 1);
1.96 + ASM_OUTPUT_ALIGN (stream, 2);
1.97 +@@ -5838,6 +5854,9 @@
1.98 + int store_arg_regs = 0;
1.99 + int volatile_func = (optimize > 0
1.100 + && TREE_THIS_VOLATILE (current_function_decl));
1.101 ++ rtx ip_rtx;
1.102 ++ int fp_offset = 0;
1.103 ++ rtx insn;
1.104 +
1.105 + /* Naked functions don't have prologues. */
1.106 + if (arm_naked_function_p (current_function_decl))
1.107 +@@ -5859,11 +5878,59 @@
1.108 + live_regs_mask |= 0x4000;
1.109 + }
1.110 +
1.111 ++ ip_rtx = gen_rtx_REG (SImode, IP_REGNUM);
1.112 ++
1.113 + if (frame_pointer_needed)
1.114 + {
1.115 ++ if (current_function_needs_context)
1.116 ++ {
1.117 ++ /* The Static chain register is the same as the IP register
1.118 ++ used as a scratch register during stack frame creation.
1.119 ++ To get around this need to find somewhere to store IP
1.120 ++ whilst the frame is being created. We try the following
1.121 ++ places in order:
1.122 ++
1.123 ++ 1. An unused argument register.
1.124 ++ 2. A slot on the stack above the frame. (This only
1.125 ++ works if the function is not a varargs function).
1.126 ++
1.127 ++ If neither of these places is available, we abort (for now). */
1.128 ++ if (regs_ever_live[3] == 0)
1.129 ++ {
1.130 ++ insn = gen_rtx_REG (SImode, 3);
1.131 ++ insn = gen_rtx_SET (SImode, insn, ip_rtx);
1.132 ++ insn = emit_insn (insn);
1.133 ++ RTX_FRAME_RELATED_P (insn) = 1;
1.134 ++ }
1.135 ++ else if (current_function_pretend_args_size == 0)
1.136 ++ {
1.137 ++ insn = gen_rtx_PRE_DEC (SImode, stack_pointer_rtx);
1.138 ++ insn = gen_rtx_MEM (SImode, insn);
1.139 ++ insn = gen_rtx_SET (VOIDmode, insn, ip_rtx);
1.140 ++ insn = emit_insn (insn);
1.141 ++ RTX_FRAME_RELATED_P (insn) = 1;
1.142 ++ fp_offset = 4;
1.143 ++ }
1.144 ++ else
1.145 ++ /* FIXME - the way to handle this situation is to allow
1.146 ++ the pretend args to be dumped onto the stack, then
1.147 ++ reuse r3 to save IP. This would involve moving the
1.148 ++ copying os SP into IP until after the pretend args
1.149 ++ have been dumped, but this is not too hard. */
1.150 ++ error ("Unable to find a temporary location for static chanin register");
1.151 ++ }
1.152 ++
1.153 + live_regs_mask |= 0xD800;
1.154 +- emit_insn (gen_movsi (gen_rtx_REG (SImode, 12),
1.155 +- stack_pointer_rtx));
1.156 ++ if (fp_offset)
1.157 ++ {
1.158 ++ insn = gen_rtx_PLUS (SImode, stack_pointer_rtx, GEN_INT (fp_offset));
1.159 ++ insn = gen_rtx_SET (SImode, ip_rtx, insn);
1.160 ++ }
1.161 ++ else
1.162 ++ insn = gen_movsi (ip_rtx, stack_pointer_rtx);
1.163 ++
1.164 ++ insn = emit_insn (insn);
1.165 ++ RTX_FRAME_RELATED_P (insn) = 1;
1.166 + }
1.167 +
1.168 + if (current_function_pretend_args_size)
1.169 +@@ -5927,9 +5994,31 @@
1.170 + }
1.171 +
1.172 + if (frame_pointer_needed)
1.173 +- emit_insn (gen_addsi3 (hard_frame_pointer_rtx, gen_rtx_REG (SImode, 12),
1.174 +- (GEN_INT
1.175 +- (-(4 + current_function_pretend_args_size)))));
1.176 ++ {
1.177 ++ insn = GEN_INT (-(4 + current_function_pretend_args_size + fp_offset));
1.178 ++ insn = emit_insn (gen_addsi3 (hard_frame_pointer_rtx, ip_rtx, insn));
1.179 ++ RTX_FRAME_RELATED_P (insn) = 1;
1.180 ++
1.181 ++ if (current_function_needs_context)
1.182 ++ {
1.183 ++ /* Recover the static chain register. */
1.184 ++ if (regs_ever_live [3] == 0)
1.185 ++ {
1.186 ++ insn = gen_rtx_REG (SImode, 3);
1.187 ++ insn = gen_rtx_SET (SImode, ip_rtx, insn);
1.188 ++ insn = emit_insn (insn);
1.189 ++ RTX_FRAME_RELATED_P (insn) = 1;
1.190 ++ }
1.191 ++ else /* if (current_function_pretend_args_size == 0) */
1.192 ++ {
1.193 ++ insn = gen_rtx_PLUS (SImode, hard_frame_pointer_rtx, GEN_INT (4));
1.194 ++ insn = gen_rtx_MEM (SImode, insn);
1.195 ++ insn = gen_rtx_SET (SImode, ip_rtx, insn);
1.196 ++ insn = emit_insn (insn);
1.197 ++ RTX_FRAME_RELATED_P (insn) = 1;
1.198 ++ }
1.199 ++ }
1.200 ++ }
1.201 +
1.202 + if (amount != const0_rtx)
1.203 + {
1.204 +diff -urN gcc-2.95.3-orig/gcc/config/arm/arm.h gcc-2.95.3/gcc/config/arm/arm.h
1.205 +--- gcc-2.95.3-orig/gcc/config/arm/arm.h Thu Jan 25 15:03:26 2001
1.206 ++++ gcc-2.95.3/gcc/config/arm/arm.h Fri Jul 20 19:39:11 2001
1.207 +@@ -601,14 +601,20 @@
1.208 + (TREE_CODE (EXP) == STRING_CST \
1.209 + && (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN))
1.210 +
1.211 ++#ifndef STRUCTURE_SIZE_BOUNDARY
1.212 + /* Every structures size must be a multiple of 32 bits. */
1.213 + /* This is for compatibility with ARMCC. ARM SDT Reference Manual
1.214 + (ARM DUI 0020D) page 2-20 says "Structures are aligned on word
1.215 + boundaries". */
1.216 +-#ifndef STRUCTURE_SIZE_BOUNDARY
1.217 +-#define STRUCTURE_SIZE_BOUNDARY 32
1.218 ++/* Setting this to 32 produces more efficient code, but the value set in previous
1.219 ++ versions of this toolchain was 8, which produces more compact structures. The
1.220 ++ command line option -mstructure_size_boundary=<n> can be used to change this
1.221 ++ value. */
1.222 ++#define STRUCTURE_SIZE_BOUNDARY arm_structure_size_boundary
1.223 + #endif
1.224 +
1.225 ++extern int arm_structure_size_boundary;
1.226 ++
1.227 + /* Used when parsing command line option -mstructure_size_boundary. */
1.228 + extern const char * structure_size_string;
1.229 +
1.230 +@@ -768,6 +774,9 @@
1.231 + /* Specify the registers used for certain standard purposes.
1.232 + The values of these macros are register numbers. */
1.233 +
1.234 ++/* Register which holds return address from a subroutine call. */
1.235 ++#define LR_REGNUM 14
1.236 ++
1.237 + /* Define this if the program counter is overloaded on a register. */
1.238 + #define PC_REGNUM 15
1.239 +
1.240 +@@ -777,6 +786,9 @@
1.241 + /* Base register for access to local variables of the function. */
1.242 + #define FRAME_POINTER_REGNUM 25
1.243 +
1.244 ++/* Scratch register - used in all kinds of places, eg trampolines. */
1.245 ++#define IP_REGNUM 12
1.246 ++
1.247 + /* Define this to be where the real frame pointer is if it is not possible to
1.248 + work out the offset between the frame pointer and the automatic variables
1.249 + until after register allocation has taken place. FRAME_POINTER_REGNUM
1.250 +@@ -798,7 +810,7 @@
1.251 + /* The native (Norcroft) Pascal compiler for the ARM passes the static chain
1.252 + as an invisible last argument (possible since varargs don't exist in
1.253 + Pascal), so the following is not true. */
1.254 +-#define STATIC_CHAIN_REGNUM 8
1.255 ++#define STATIC_CHAIN_REGNUM 12
1.256 +
1.257 + /* Register in which address to store a structure value
1.258 + is passed to a function. */
1.259 +@@ -1248,7 +1260,12 @@
1.260 + { \
1.261 + int volatile_func = arm_volatile_func (); \
1.262 + if ((FROM) == ARG_POINTER_REGNUM && (TO) == HARD_FRAME_POINTER_REGNUM)\
1.263 +- (OFFSET) = 0; \
1.264 ++ { \
1.265 ++ if (! current_function_needs_context || ! frame_pointer_needed) \
1.266 ++ (OFFSET) = 0; \
1.267 ++ else \
1.268 ++ (OFFSET) = 4; \
1.269 ++ } \
1.270 + else if ((FROM) == FRAME_POINTER_REGNUM \
1.271 + && (TO) == STACK_POINTER_REGNUM) \
1.272 + (OFFSET) = (current_function_outgoing_args_size \
1.273 +@@ -1379,8 +1396,10 @@
1.274 +
1.275 + On the ARM, allow any integer (invalid ones are removed later by insn
1.276 + patterns), nice doubles and symbol_refs which refer to the function's
1.277 +- constant pool XXX. */
1.278 +-#define LEGITIMATE_CONSTANT_P(X) (! label_mentioned_p (X))
1.279 ++ constant pool XXX.
1.280 ++
1.281 ++ When generating PIC code, allow anything. */
1.282 ++#define LEGITIMATE_CONSTANT_P(X) (flag_pic || ! label_mentioned_p (X))
1.283 +
1.284 + /* Symbols in the text segment can be accessed without indirecting via the
1.285 + constant pool; it may take an extra binary operation, but this is still
1.286 +@@ -1496,9 +1515,8 @@
1.287 + && INTVAL (op) <= 31) \
1.288 + goto LABEL; \
1.289 + } \
1.290 +- /* NASTY: Since this limits the addressing of unsigned byte loads */ \
1.291 + range = ((MODE) == HImode || (MODE) == QImode) \
1.292 +- ? (arm_arch4 ? 256 : 4095) : 4096; \
1.293 ++ ? (((MODE) == HImode && arm_arch4) ? 256 : 4095) : 4096; \
1.294 + if (code == CONST_INT && INTVAL (INDEX) < range \
1.295 + && INTVAL (INDEX) > -range) \
1.296 + goto LABEL; \
1.297 +@@ -1812,14 +1830,15 @@
1.298 + data addresses in memory. */
1.299 + #define PIC_OFFSET_TABLE_REGNUM arm_pic_register
1.300 +
1.301 +-#define FINALIZE_PIC arm_finalize_pic ()
1.302 ++#define FINALIZE_PIC arm_finalize_pic (1)
1.303 +
1.304 +-/* We can't directly access anything that contains a symbol,
1.305 ++/* We can't directly access anything that contains a symbol or label,
1.306 + nor can we indirect via the constant pool. */
1.307 + #define LEGITIMATE_PIC_OPERAND_P(X) \
1.308 +- (! symbol_mentioned_p (X) \
1.309 ++ (! symbol_mentioned_p (X) && ! label_mentioned_p (X) \
1.310 + && (! CONSTANT_POOL_ADDRESS_P (X) \
1.311 +- || ! symbol_mentioned_p (get_pool_constant (X))))
1.312 ++ || (! symbol_mentioned_p (get_pool_constant (X))) \
1.313 ++ && (! label_mentioned_p (get_pool_constant (X)))))
1.314 +
1.315 + /* We need to know when we are making a constant pool; this determines
1.316 + whether data needs to be in the GOT or can be referenced via a GOT
1.317 +@@ -2046,17 +2065,9 @@
1.318 + else output_addr_const(STREAM, X); \
1.319 + }
1.320 +
1.321 +-/* Handles PIC addr specially */
1.322 + #define OUTPUT_INT_ADDR_CONST(STREAM,X) \
1.323 + { \
1.324 +- if (flag_pic && GET_CODE(X) == CONST && is_pic(X)) \
1.325 +- { \
1.326 +- output_addr_const(STREAM, XEXP (XEXP (XEXP (X, 0), 0), 0)); \
1.327 +- fputs(" - (", STREAM); \
1.328 +- output_addr_const(STREAM, XEXP (XEXP (XEXP (X, 0), 1), 0)); \
1.329 +- fputs(")", STREAM); \
1.330 +- } \
1.331 +- else output_addr_const(STREAM, X); \
1.332 ++ output_addr_const(STREAM, X); \
1.333 + \
1.334 + /* Mark symbols as position independent. We only do this in the \
1.335 + .text segment, not in the .data segment. */ \
1.336 +@@ -2170,8 +2181,7 @@
1.337 + int arm_return_in_memory PROTO ((Tree));
1.338 + int legitimate_pic_operand_p PROTO ((Rtx));
1.339 + Rtx legitimize_pic_address PROTO ((Rtx, Mmode, Rtx));
1.340 +-int is_pic PROTO ((Rtx));
1.341 +-void arm_finalize_pic PROTO ((void));
1.342 ++void arm_finalize_pic PROTO ((int));
1.343 + int arm_rtx_costs RTX_CODE_PROTO ((Rtx, Rcode));
1.344 + int arm_adjust_cost PROTO ((Rtx, Rtx, Rtx, int));
1.345 + int const_double_rtx_ok_for_fpu PROTO ((Rtx));
1.346 +diff -urN gcc-2.95.3-orig/gcc/config/arm/arm.md gcc-2.95.3/gcc/config/arm/arm.md
1.347 +--- gcc-2.95.3-orig/gcc/config/arm/arm.md Thu Jan 25 15:03:27 2001
1.348 ++++ gcc-2.95.3/gcc/config/arm/arm.md Fri Jul 20 19:39:11 2001
1.349 +@@ -2629,7 +2629,8 @@
1.350 + : preserve_subexpressions_p ()));
1.351 + DONE;
1.352 + }
1.353 +- if (CONSTANT_P (operands[1]) && flag_pic)
1.354 ++ if ((CONSTANT_P (operands[1]) || symbol_mentioned_p (operands[1])
1.355 ++ || label_mentioned_p (operands[1])) && flag_pic)
1.356 + operands[1] = legitimize_pic_address (operands[1], SImode,
1.357 + ((reload_in_progress
1.358 + || reload_completed)
1.359 +@@ -2721,6 +2722,15 @@
1.360 + return \"add%?\\t%0, %|pc, %0\";
1.361 + ")
1.362 +
1.363 ++(define_expand "builtin_setjmp_receiver"
1.364 ++ [(label_ref (match_operand 0 "" ""))]
1.365 ++ "flag_pic"
1.366 ++ "
1.367 ++{
1.368 ++ arm_finalize_pic (0);
1.369 ++ DONE;
1.370 ++}")
1.371 ++
1.372 + ;; If copying one reg to another we can set the condition codes according to
1.373 + ;; its value. Such a move is common after a return from subroutine and the
1.374 + ;; result is being tested against zero.
1.375 +@@ -6184,15 +6194,20 @@
1.376 + abort ();
1.377 + return \"\";
1.378 + }
1.379 +- strcpy (pattern, \"stmfd\\t%m0!, {%1\");
1.380 +- for (i = 1; i < XVECLEN (operands[2], 0); i++)
1.381 ++ if (XVECLEN (operands[2], 0) > 1)
1.382 + {
1.383 +- strcat (pattern, \", %|\");
1.384 +- strcat (pattern, reg_names[REGNO (XEXP (XVECEXP (operands[2], 0, i),
1.385 ++ strcpy (pattern, \"stmfd\\t%m0!, {%1\");
1.386 ++ for (i = 1; i < XVECLEN (operands[2], 0); i++)
1.387 ++ {
1.388 ++ strcat (pattern, \", %|\");
1.389 ++ strcat (pattern, reg_names[REGNO (XEXP (XVECEXP (operands[2], 0, i),
1.390 + 0))]);
1.391 ++ }
1.392 ++ strcat (pattern, \"}\");
1.393 ++ output_asm_insn (pattern, operands);
1.394 + }
1.395 +- strcat (pattern, \"}\");
1.396 +- output_asm_insn (pattern, operands);
1.397 ++ else
1.398 ++ output_asm_insn (\"str\\t%1, [%m0, #-4]!\", operands);
1.399 + return \"\";
1.400 + }"
1.401 + [(set_attr "type" "store4")])
1.402 +diff -urN gcc-2.95.3-orig/gcc/config/arm/elf.h gcc-2.95.3/gcc/config/arm/elf.h
1.403 +--- gcc-2.95.3-orig/gcc/config/arm/elf.h Mon May 31 10:21:53 1999
1.404 ++++ gcc-2.95.3/gcc/config/arm/elf.h Fri Jul 20 19:39:11 2001
1.405 +@@ -167,15 +167,6 @@
1.406 + #define MULTILIB_DEFAULTS { "mlittle-endian", "msoft-float", "mapcs-32", "mno-thumb-interwork" }
1.407 + #endif
1.408 +
1.409 +-/* Setting this to 32 produces more efficient code, but the value set in previous
1.410 +- versions of this toolchain was 8, which produces more compact structures. The
1.411 +- command line option -mstructure_size_boundary=<n> can be used to change this
1.412 +- value. */
1.413 +-#undef STRUCTURE_SIZE_BOUNDARY
1.414 +-#define STRUCTURE_SIZE_BOUNDARY arm_structure_size_boundary
1.415 +-
1.416 +-extern int arm_structure_size_boundary;
1.417 +-
1.418 + /* A C expression whose value is nonzero if IDENTIFIER with arguments ARGS
1.419 + is a valid machine specific attribute for DECL.
1.420 + The attributes in ATTRIBUTES have previously been assigned to DECL. */
1.421 +diff -urN gcc-2.95.3-orig/gcc/config/arm/linux-gas.h gcc-2.95.3/gcc/config/arm/linux-gas.h
1.422 +--- gcc-2.95.3-orig/gcc/config/arm/linux-gas.h Mon Feb 22 17:47:57 1999
1.423 ++++ gcc-2.95.3/gcc/config/arm/linux-gas.h Fri Jul 20 19:39:11 2001
1.424 +@@ -1,6 +1,6 @@
1.425 + /* Definitions of target machine for GNU compiler.
1.426 + ARM Linux-based GNU systems version.
1.427 +- Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
1.428 ++ Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
1.429 + Contributed by Russell King <rmk92@ecs.soton.ac.uk>.
1.430 +
1.431 + This file is part of GNU CC.
1.432 +@@ -79,5 +79,7 @@
1.433 + register unsigned long _beg __asm ("a1") = (unsigned long) (BEG); \
1.434 + register unsigned long _end __asm ("a2") = (unsigned long) (END); \
1.435 + register unsigned long _flg __asm ("a3") = 0; \
1.436 +- __asm __volatile ("swi 0x9f0002"); \
1.437 ++ __asm __volatile ("swi 0x9f0002 @ sys_cacheflush" \
1.438 ++ : "=r" (_beg) \
1.439 ++ : "0" (_beg), "r" (_end), "r" (_flg)); \
1.440 + }
1.441 +diff -urN gcc-2.95.3-orig/gcc/config/arm/t-linux gcc-2.95.3/gcc/config/arm/t-linux
1.442 +--- gcc-2.95.3-orig/gcc/config/arm/t-linux Fri Mar 26 16:30:20 1999
1.443 ++++ gcc-2.95.3/gcc/config/arm/t-linux Fri Jul 20 20:46:19 2001
1.444 +@@ -1,6 +1,6 @@
1.445 + # Just for these, we omit the frame pointer since it makes such a big
1.446 + # difference. It is then pointless adding debugging.
1.447 +-TARGET_LIBGCC2_CFLAGS = -fomit-frame-pointer -fPIC
1.448 ++TARGET_LIBGCC2_CFLAGS = -fomit-frame-pointer -fPIC
1.449 + LIBGCC2_DEBUG_CFLAGS = -g0
1.450 +
1.451 + # Don't build enquire
1.452 +diff -urN gcc-2.95.3-orig/gcc/final.c gcc-2.95.3/gcc/final.c
1.453 +--- gcc-2.95.3-orig/gcc/final.c Mon Mar 12 13:07:59 2001
1.454 ++++ gcc-2.95.3/gcc/final.c Fri Jul 20 19:39:11 2001
1.455 +@@ -3652,8 +3652,9 @@
1.456 +
1.457 + output_addr_const (file, XEXP (x, 0));
1.458 + fprintf (file, "-");
1.459 +- if (GET_CODE (XEXP (x, 1)) == CONST_INT
1.460 +- && INTVAL (XEXP (x, 1)) < 0)
1.461 ++ if ((GET_CODE (XEXP (x, 1)) == CONST_INT
1.462 ++ && INTVAL (XEXP (x, 1)) < 0)
1.463 ++ || GET_CODE (XEXP (x, 1)) != CONST_INT)
1.464 + {
1.465 + fprintf (file, ASM_OPEN_PAREN);
1.466 + output_addr_const (file, XEXP (x, 1));
1.467 +diff -urN gcc-2.95.3-orig/gcc/function.c gcc-2.95.3/gcc/function.c
1.468 +--- gcc-2.95.3-orig/gcc/function.c Thu Jan 25 15:03:15 2001
1.469 ++++ gcc-2.95.3/gcc/function.c Fri Jul 20 19:39:10 2001
1.470 +@@ -3053,6 +3053,105 @@
1.471 + extracted by usage MEM with narrower mode. */
1.472 + static rtx purge_addressof_replacements;
1.473 +
1.474 ++/* Return 1 if X and Y are identical-looking rtx's.
1.475 ++ This is the Lisp function EQUAL for rtx arguments. */
1.476 ++
1.477 ++int
1.478 ++rtx_equal_for_addressof_p (x, y)
1.479 ++ rtx x, y;
1.480 ++{
1.481 ++ register int i;
1.482 ++ register int j;
1.483 ++ register enum rtx_code code;
1.484 ++ register char *fmt;
1.485 ++
1.486 ++ if (x == y)
1.487 ++ return 1;
1.488 ++ if (x == 0 || y == 0)
1.489 ++ return 0;
1.490 ++
1.491 ++ code = GET_CODE (x);
1.492 ++ /* Rtx's of different codes cannot be equal. */
1.493 ++ if (code != GET_CODE (y))
1.494 ++ return 0;
1.495 ++
1.496 ++ /* (MULT:SI x y) and (MULT:HI x y) are NOT equivalent.
1.497 ++ (REG:SI x) and (REG:HI x) are NOT equivalent.
1.498 ++ But (MEM:SI x) and (MEM:HI x) are equivalent for our purposes. */
1.499 ++
1.500 ++ if (code != MEM && (GET_MODE (x) != GET_MODE (y)))
1.501 ++ return 0;
1.502 ++
1.503 ++ /* REG, LABEL_REF, and SYMBOL_REF can be compared nonrecursively. */
1.504 ++
1.505 ++ if (code == REG)
1.506 ++ return REGNO (x) == REGNO (y);
1.507 ++ else if (code == LABEL_REF)
1.508 ++ return XEXP (x, 0) == XEXP (y, 0);
1.509 ++ else if (code == SYMBOL_REF)
1.510 ++ return XSTR (x, 0) == XSTR (y, 0);
1.511 ++ else if (code == SCRATCH || code == CONST_DOUBLE)
1.512 ++ return 0;
1.513 ++
1.514 ++ /* Compare the elements. If any pair of corresponding elements
1.515 ++ fail to match, return 0 for the whole things. */
1.516 ++
1.517 ++ fmt = GET_RTX_FORMAT (code);
1.518 ++ for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
1.519 ++ {
1.520 ++ switch (fmt[i])
1.521 ++ {
1.522 ++ case 'w':
1.523 ++ if (XWINT (x, i) != XWINT (y, i))
1.524 ++ return 0;
1.525 ++ break;
1.526 ++
1.527 ++ case 'n':
1.528 ++ case 'i':
1.529 ++ if (XINT (x, i) != XINT (y, i))
1.530 ++ return 0;
1.531 ++ break;
1.532 ++
1.533 ++ case 'V':
1.534 ++ case 'E':
1.535 ++ /* Two vectors must have the same length. */
1.536 ++ if (XVECLEN (x, i) != XVECLEN (y, i))
1.537 ++ return 0;
1.538 ++
1.539 ++ /* And the corresponding elements must match. */
1.540 ++ for (j = 0; j < XVECLEN (x, i); j++)
1.541 ++ if (rtx_equal_p (XVECEXP (x, i, j), XVECEXP (y, i, j)) == 0)
1.542 ++ return 0;
1.543 ++ break;
1.544 ++
1.545 ++ case 'e':
1.546 ++ if (rtx_equal_p (XEXP (x, i), XEXP (y, i)) == 0)
1.547 ++ return 0;
1.548 ++ break;
1.549 ++
1.550 ++ case 'S':
1.551 ++ case 's':
1.552 ++ if (strcmp (XSTR (x, i), XSTR (y, i)))
1.553 ++ return 0;
1.554 ++ break;
1.555 ++
1.556 ++ case 'u':
1.557 ++ /* These are just backpointers, so they don't matter. */
1.558 ++ break;
1.559 ++
1.560 ++ case '0':
1.561 ++ break;
1.562 ++
1.563 ++ /* It is believed that rtx's at this level will never
1.564 ++ contain anything but integers and other rtx's,
1.565 ++ except for within LABEL_REFs and SYMBOL_REFs. */
1.566 ++ default:
1.567 ++ abort ();
1.568 ++ }
1.569 ++ }
1.570 ++ return 1;
1.571 ++}
1.572 ++
1.573 + /* Helper function for purge_addressof. See if the rtx expression at *LOC
1.574 + in INSN needs to be changed. If FORCE, always put any ADDRESSOFs into
1.575 + the stack. */
1.576 +@@ -3133,7 +3232,7 @@
1.577 + for (tem = purge_bitfield_addressof_replacements;
1.578 + tem != NULL_RTX;
1.579 + tem = XEXP (XEXP (tem, 1), 1))
1.580 +- if (rtx_equal_p (x, XEXP (tem, 0)))
1.581 ++ if (rtx_equal_for_addressof_p (x, XEXP (tem, 0)))
1.582 + {
1.583 + *loc = XEXP (XEXP (tem, 1), 0);
1.584 + return;
1.585 +@@ -3143,7 +3242,7 @@
1.586 + for (tem = purge_addressof_replacements;
1.587 + tem != NULL_RTX;
1.588 + tem = XEXP (XEXP (tem, 1), 1))
1.589 +- if (rtx_equal_p (XEXP (x, 0), XEXP (tem, 0)))
1.590 ++ if (rtx_equal_for_addressof_p (XEXP (x, 0), XEXP (tem, 0)))
1.591 + {
1.592 + rtx z = XEXP (XEXP (tem, 1), 0);
1.593 +
1.594 +diff -urN gcc-2.95.3-orig/gcc/jump.c gcc-2.95.3/gcc/jump.c
1.595 +--- gcc-2.95.3-orig/gcc/jump.c Thu Oct 21 08:24:03 1999
1.596 ++++ gcc-2.95.3/gcc/jump.c Fri Jul 20 19:39:10 2001
1.597 +@@ -115,7 +115,7 @@
1.598 + static rtx delete_unreferenced_labels PROTO((rtx));
1.599 + static void delete_noop_moves PROTO((rtx));
1.600 + static int calculate_can_reach_end PROTO((rtx, int, int));
1.601 +-static int duplicate_loop_exit_test PROTO((rtx));
1.602 ++static int duplicate_loop_exit_test PROTO((rtx, int));
1.603 + static void find_cross_jump PROTO((rtx, rtx, int, rtx *, rtx *));
1.604 + static void do_cross_jump PROTO((rtx, rtx, rtx));
1.605 + static int jump_back_p PROTO((rtx, rtx));
1.606 +@@ -338,7 +338,7 @@
1.607 + && simplejump_p (temp1))
1.608 + {
1.609 + temp = PREV_INSN (insn);
1.610 +- if (duplicate_loop_exit_test (insn))
1.611 ++ if (duplicate_loop_exit_test (insn, after_regscan))
1.612 + {
1.613 + changed = 1;
1.614 + next = NEXT_INSN (temp);
1.615 +@@ -2548,8 +2548,9 @@
1.616 + values of regno_first_uid and regno_last_uid. */
1.617 +
1.618 + static int
1.619 +-duplicate_loop_exit_test (loop_start)
1.620 ++duplicate_loop_exit_test (loop_start, after_regscan)
1.621 + rtx loop_start;
1.622 ++ int after_regscan;
1.623 + {
1.624 + rtx insn, set, reg, p, link;
1.625 + rtx copy = 0, first_copy = 0;
1.626 +@@ -2662,6 +2663,9 @@
1.627 + reg_map[REGNO (reg)] = gen_reg_rtx (GET_MODE (reg));
1.628 + }
1.629 + }
1.630 ++
1.631 ++ if (after_regscan)
1.632 ++ reg_scan_update (exitcode, lastexit, max_reg);
1.633 +
1.634 + /* Now copy each insn. */
1.635 + for (insn = exitcode; insn != lastexit; insn = NEXT_INSN (insn))
1.636 +diff -urN gcc-2.95.3-orig/gcc/varasm.c gcc-2.95.3/gcc/varasm.c
1.637 +--- gcc-2.95.3-orig/gcc/varasm.c Mon Feb 19 15:02:02 2001
1.638 ++++ gcc-2.95.3/gcc/varasm.c Fri Jul 20 19:39:11 2001
1.639 +@@ -3286,7 +3286,10 @@
1.640 + value->un.addr.offset = - INTVAL (XEXP (x, 1));
1.641 + }
1.642 + else
1.643 +- abort ();
1.644 ++ {
1.645 ++ value->un.addr.base = x;
1.646 ++ value->un.addr.offset = 0;
1.647 ++ }
1.648 + break;
1.649 +
1.650 + default: