Fix handling --prefix.
1 [lightly edited to fit my patch directory - dank]
3 From: kaz Kojima <kkojima@rr.iij4u.or.jp>
4 Date: Sat, 09 Aug 2003 09:46:21 +0900
9 I've come back from the vacation and looked glibc string test
10 failures on sh4. This looks a gcc problem. gcc-3.3/3.4 doesn't
11 compile these tests correctly. The attached testcase aborts on
12 gcc-3.3/3.4 -O2 but exits normally gcc-3.2 and gcc-3.0.
13 The option -O2 is not essential but it makes the testcase small.
14 The failed string tests include the same pattern of the code with
15 f=random to generate ramdom strings but they get strings with
16 embedded NULL characters :-(
19 I've got a workaround below for this bug, though it might merely
20 paper over the real bug. Anyway, I'd like to send a PR for this.
27 int f (void) { return val; }
40 a[0] = 1 + (f () & 127);
44 main (int argc, char **argv)
55 diff -u3prN ORIG/gcc/gcc/config/sh/sh.c LOCAL/gcc/gcc/config/sh/sh.c
56 --- gcc/gcc/config/sh/sh.c.old Fri Aug 8 18:39:02 2003
57 +++ gcc/gcc/config/sh/sh.c Fri Aug 8 22:31:02 2003
58 @@ -6657,6 +6657,19 @@ arith_reg_dest (op, mode)
59 return arith_reg_operand (op, mode);
62 +/* Like above, but for SImode compare destinations: forbid paradoxical
63 + subregs, because it would get the combiner confused. */
65 +arith_reg_cmp_dest (op, mode)
67 + enum machine_mode mode;
69 + if (mode == SImode && GET_CODE (op) == SUBREG
70 + && GET_MODE_SIZE (GET_MODE (SUBREG_REG (op))) < 4)
72 + return arith_reg_operand (op, mode);
76 int_gpr_dest (op, mode)
78 diff -u3prN ORIG/gcc/gcc/config/sh/sh.h LOCAL/gcc/gcc/config/sh/sh.h
79 --- gcc/gcc/config/sh/sh.h.old Fri Aug 8 18:39:02 2003
80 +++ gcc/gcc/config/sh/sh.h Fri Aug 8 22:31:02 2003
81 @@ -3365,6 +3365,7 @@ extern int rtx_equal_function_value_matt
82 {"and_operand", {SUBREG, REG, CONST_INT}}, \
83 {"any_register_operand", {SUBREG, REG}}, \
84 {"arith_operand", {SUBREG, REG, CONST_INT}}, \
85 + {"arith_reg_cmp_dest", {SUBREG, REG}}, \
86 {"arith_reg_dest", {SUBREG, REG}}, \
87 {"arith_reg_operand", {SUBREG, REG}}, \
88 {"arith_reg_or_0_operand", {SUBREG, REG, CONST_INT, CONST_VECTOR}}, \
90 --- gcc-3.3/gcc/config/sh/sh.md.orig Tue Apr 15 10:06:10 2003
91 +++ gcc-3.3/gcc/config/sh/sh.md Sat Aug 9 22:31:13 2003
96 - (eq:SI (and:SI (match_operand:SI 0 "arith_reg_operand" "z,r")
97 + (eq:SI (and:SI (match_operand:SI 0 "arith_reg_cmp_dest" "z,r")
98 (match_operand:SI 1 "arith_operand" "L,r"))
103 (define_insn "cmpeqsi_t"
105 - (eq:SI (match_operand:SI 0 "arith_reg_operand" "r,z,r")
106 + (eq:SI (match_operand:SI 0 "arith_reg_cmp_dest" "r,z,r")
107 (match_operand:SI 1 "arith_operand" "N,rI,r")))]
112 (define_insn "cmpgtsi_t"
114 - (gt:SI (match_operand:SI 0 "arith_reg_operand" "r,r")
115 + (gt:SI (match_operand:SI 0 "arith_reg_cmp_dest" "r,r")
116 (match_operand:SI 1 "arith_reg_or_0_operand" "r,N")))]
121 (define_insn "cmpgesi_t"
123 - (ge:SI (match_operand:SI 0 "arith_reg_operand" "r,r")
124 + (ge:SI (match_operand:SI 0 "arith_reg_cmp_dest" "r,r")
125 (match_operand:SI 1 "arith_reg_or_0_operand" "r,N")))]
130 (define_insn "cmpgeusi_t"
132 - (geu:SI (match_operand:SI 0 "arith_reg_operand" "r")
133 + (geu:SI (match_operand:SI 0 "arith_reg_cmp_dest" "r")
134 (match_operand:SI 1 "arith_reg_operand" "r")))]
139 (define_insn "cmpgtusi_t"
141 - (gtu:SI (match_operand:SI 0 "arith_reg_operand" "r")
142 + (gtu:SI (match_operand:SI 0 "arith_reg_cmp_dest" "r")
143 (match_operand:SI 1 "arith_reg_operand" "r")))]