1 $DragonFly: src/gnu/usr.bin/cc34/cc_prep/patches/combine.c.patch,v 1.3 2004/12/21 13:10:48 joerg Exp $
3 ===================================================================
4 RCS file: /home/joerg/wd/repository/dragonflybsd/src/contrib/gcc-3.4/gcc/combine.c,v
5 retrieving revision 1.2
6 diff -u -r1.2 combine.c
7 --- combine.c 20 Dec 2004 19:23:23 -0000 1.2
8 +++ combine.c 20 Dec 2004 20:48:09 -0000
10 && ! fixed_regs[REGNO (dest)]
11 && CLASS_LIKELY_SPILLED_P (REGNO_REG_CLASS (REGNO (dest))))))
13 + /* Never combine loads and stores protecting argument that use set insn
14 + with used flag on. */
15 + if (SET_VOLATILE_P (set))
20 @@ -3781,7 +3785,20 @@
21 rtx inner_op0 = XEXP (XEXP (x, 0), 1);
22 rtx inner_op1 = XEXP (x, 1);
26 +#ifndef FRAME_GROWS_DOWNWARD
27 + /* For the case where the frame grows upward,
28 + the stack protector keeps the offset of the frame pointer
29 + positive integer. */
30 + if (flag_propolice_protection
32 + && other == frame_pointer_rtx
33 + && GET_CODE (inner_op0) == CONST_INT
34 + && GET_CODE (inner_op1) == CONST_INT
35 + && INTVAL (inner_op0) > 0
36 + && INTVAL (inner_op0) + INTVAL (inner_op1) <= 0)
39 /* Make sure we pass the constant operand if any as the second
40 one if this is a commutative operation. */
41 if (CONSTANT_P (inner_op0) && GET_RTX_CLASS (code) == 'c')
42 @@ -4146,6 +4163,13 @@
43 they are now checked elsewhere. */
44 if (GET_CODE (XEXP (x, 0)) == PLUS
45 && CONSTANT_ADDRESS_P (XEXP (XEXP (x, 0), 1)))
46 +#ifndef FRAME_GROWS_DOWNWARD
47 + /* The stack protector keeps the addressing style of a local variable
48 + to be able to change its stack position. */
49 + if (! (flag_propolice_protection
50 + && XEXP (XEXP (x, 0), 0) == frame_pointer_rtx
51 + && GET_CODE (XEXP (XEXP (x, 0), 1)) == CONST_INT))
53 return gen_binary (PLUS, mode,
54 gen_binary (PLUS, mode, XEXP (XEXP (x, 0), 0),
56 @@ -4273,8 +4297,14 @@
59 /* Canonicalize (minus A (plus B C)) to (minus (minus A B) C) for
61 - if (GET_CODE (XEXP (x, 1)) == PLUS && INTEGRAL_MODE_P (mode))
64 + The stack protector keeps the addressing style of
65 + a local variable. */
66 + if (GET_CODE (XEXP (x, 1)) == PLUS && INTEGRAL_MODE_P (mode)
67 + && (! (flag_propolice_protection
68 + && XEXP (XEXP (x, 1), 0) == frame_pointer_rtx
69 + && GET_CODE (XEXP (XEXP (x, 1), 1)) == CONST_INT)))
70 return gen_binary (MINUS, mode,
71 gen_binary (MINUS, mode, XEXP (x, 0),
72 XEXP (XEXP (x, 1), 0)),