Redo the ProPolice patches, there were partly broken.
[dragonfly.git] / gnu / usr.bin / cc34 / cc_prep / patches / cse.c.patch
1 $DragonFly: src/gnu/usr.bin/cc34/cc_prep/patches/cse.c.patch,v 1.2 2004/06/20 00:10:52 joerg Exp $
2
3 diff -u ../gcc.orig/cse.c cse.c
4 --- ../gcc.orig/cse.c   2004-06-19 22:27:09.000000000 +0200
5 +++ cse.c       2004-06-20 01:16:04.000000000 +0200
6 @@ -4203,7 +4203,14 @@
7  
8               if (new_const == 0)
9                 break;
10 -
11 +#ifndef FRAME_GROWS_DOWNWARD
12 +             if (flag_propolice_protection
13 +                 && GET_CODE (y) == PLUS
14 +                 && XEXP (y, 0) == frame_pointer_rtx
15 +                 && INTVAL (inner_const) > 0
16 +                 && INTVAL (new_const) <= 0)
17 +               break;
18 +#endif
19               /* If we are associating shift operations, don't let this
20                  produce a shift of the size of the object or larger.
21                  This could occur when we follow a sign-extend by a right
22 @@ -4735,6 +4742,14 @@
23        if (SET_DEST (x) == pc_rtx
24           && GET_CODE (SET_SRC (x)) == LABEL_REF)
25         ;
26 +      /* cut the reg propagation of stack-protected argument.  */
27 +      else if (SET_VOLATILE_P (x)) {
28 +       rtx x1 = SET_DEST (x);
29 +       if (GET_CODE (x1) == SUBREG && GET_CODE (SUBREG_REG (x1)) == REG)
30 +         x1 = SUBREG_REG (x1);
31 +       if (! REGNO_QTY_VALID_P(REGNO (x1)))
32 +         make_new_qty (REGNO (x1), GET_MODE (x1));
33 +      }
34  
35        /* Don't count call-insns, (set (reg 0) (call ...)), as a set.
36          The hard function value register is used only once, to copy to