]> git.pld-linux.org Git - packages/gcc.git/blob - gcc-emit-rtl.patch
- allow bootstrap to work
[packages/gcc.git] / gcc-emit-rtl.patch
1 #! /bin/sh -e
2
3 if [ $# -eq 3 -a "$2" = '-d' ]; then
4     pdir="-d $3"
5 elif [ $# -ne 1 ]; then
6     echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
7     exit 1
8 fi
9 case "$1" in
10     -patch) patch $pdir -f --no-backup-if-mismatch -p0 < $0;;
11     -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p0 < $0;;
12     *)
13         echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
14         exit 1
15 esac
16 exit 0
17
18 # DP: From: David Huggins-Daines <dhuggins@linuxcare.com>
19 Sender: <dhd@thepuffingroup.com>
20 # DP: To: 55263@bugs.debian.org
21 # DP: Subject: Bug#55263: [PATCH] fixed in 2.96 CVS, here's a backport of the diff
22 # DP: Date: Wed, 01 Mar 2000 19:28:03 -0500
23
24 Hi,
25
26 # DP: I've found the minimal set of optimization flags that will produce
27 # DP: this error (the -O is necessary):
28 # DP: 
29 # DP: [dhd@doppelbock]:~/src/debian/ncurses4.2-4.2/obj_s$ cc -I../ncurses -I.  -DNDEBUG -I. -I../include -DHAVE_CONFIG_H -DTERMINFO=\"/usr/share/terminfo\" -O  -fcse-skip-blocks -fexpensive-optimizations -frerun-cse-after-loop -frerun-loop-opt -D_REENTRANT -fPIC -c ../ncurses/softscroll.c
30 # DP: ../ncurses/softscroll.c: In function `_nc_perform_scroll':
31 # DP: ../ncurses/softscroll.c:257: internal error--unrecognizable insn:
32 # DP: 
33 # DP: (insn 1213 1212 1215 (set (reg/v:DI 531)
34 # DP:         (mem/f:DI (symbol_ref:DI ("SP")) 0)) -1 (nil)
35 # DP:     (nil))
36 # DP: 
37 # DP: However, it seems that the bug is fixed in 2.96 from current CVS.
38 # DP: Here is the diff from 2.95.2 to 2.96 that solves the problem (I've
39 # DP: tested it, it seems to work):
40
41 --- gcc/emit-rtl.c.2.95.2       Wed Mar  1 18:19:18 2000
42 +++ gcc/emit-rtl.c      Wed Mar  1 18:23:29 2000
43 @@ -1856,25 +1728,17 @@
44        return x;
45  
46      case MEM:
47 -      /* A MEM is allowed to be shared if its address is constant
48 -        or is a constant plus one of the special registers.  */
49 -      if (CONSTANT_ADDRESS_P (XEXP (x, 0))
50 -         || XEXP (x, 0) == virtual_stack_vars_rtx
51 -         || XEXP (x, 0) == virtual_incoming_args_rtx)
52 +      /* A MEM is allowed to be shared if its address is constant.
53 +
54 +        We used to allow sharing of MEMs which referenced 
55 +        virtual_stack_vars_rtx or virtual_incoming_args_rtx, but
56 +        that can lose.  instantiate_virtual_regs will not unshare
57 +        the MEMs, and combine may change the structure of the address
58 +        because it looks safe and profitable in one context, but
59 +        in some other context it creates unrecognizable RTL.  */
60 +      if (CONSTANT_ADDRESS_P (XEXP (x, 0)))
61         return x;
62  
63 -      if (GET_CODE (XEXP (x, 0)) == PLUS
64 -         && (XEXP (XEXP (x, 0), 0) == virtual_stack_vars_rtx
65 -             || XEXP (XEXP (x, 0), 0) == virtual_incoming_args_rtx)
66 -         && CONSTANT_ADDRESS_P (XEXP (XEXP (x, 0), 1)))
67 -       {
68 -         /* This MEM can appear in more than one place,
69 -            but its address better not be shared with anything else.  */
70 -         if (! x->used)
71 -           XEXP (x, 0) = copy_rtx_if_shared (XEXP (x, 0));
72 -         x->used = 1;
73 -         return x;
74 -       }
75        break;
76  
77      default:
78
79
80
81 -- 
82 David Huggins-Daines, Senior Linux Consultant, Linuxcare, Inc.
83 613.562.1239 tel
84 dhuggins@linuxcare.com, http://www.linuxcare.com/
85 Linuxcare. Support for the revolution.
This page took 0.042661 seconds and 3 git commands to generate.