#! /bin/sh -e if [ $# -eq 3 -a "$2" = '-d' ]; then pdir="-d $3" elif [ $# -ne 1 ]; then echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" exit 1 fi case "$1" in -patch) patch $pdir -f --no-backup-if-mismatch -p0 < $0;; -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p0 < $0;; *) echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" exit 1 esac exit 0 # DP: From: David Huggins-Daines Sender: # DP: To: 55263@bugs.debian.org # DP: Subject: Bug#55263: [PATCH] fixed in 2.96 CVS, here's a backport of the diff # DP: Date: Wed, 01 Mar 2000 19:28:03 -0500 Hi, # DP: I've found the minimal set of optimization flags that will produce # DP: this error (the -O is necessary): # DP: # 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 # DP: ../ncurses/softscroll.c: In function `_nc_perform_scroll': # DP: ../ncurses/softscroll.c:257: internal error--unrecognizable insn: # DP: # DP: (insn 1213 1212 1215 (set (reg/v:DI 531) # DP: (mem/f:DI (symbol_ref:DI ("SP")) 0)) -1 (nil) # DP: (nil)) # DP: # DP: However, it seems that the bug is fixed in 2.96 from current CVS. # DP: Here is the diff from 2.95.2 to 2.96 that solves the problem (I've # DP: tested it, it seems to work): --- gcc/emit-rtl.c.2.95.2 Wed Mar 1 18:19:18 2000 +++ gcc/emit-rtl.c Wed Mar 1 18:23:29 2000 @@ -1856,25 +1728,17 @@ return x; case MEM: - /* A MEM is allowed to be shared if its address is constant - or is a constant plus one of the special registers. */ - if (CONSTANT_ADDRESS_P (XEXP (x, 0)) - || XEXP (x, 0) == virtual_stack_vars_rtx - || XEXP (x, 0) == virtual_incoming_args_rtx) + /* A MEM is allowed to be shared if its address is constant. + + We used to allow sharing of MEMs which referenced + virtual_stack_vars_rtx or virtual_incoming_args_rtx, but + that can lose. instantiate_virtual_regs will not unshare + the MEMs, and combine may change the structure of the address + because it looks safe and profitable in one context, but + in some other context it creates unrecognizable RTL. */ + if (CONSTANT_ADDRESS_P (XEXP (x, 0))) return x; - if (GET_CODE (XEXP (x, 0)) == PLUS - && (XEXP (XEXP (x, 0), 0) == virtual_stack_vars_rtx - || XEXP (XEXP (x, 0), 0) == virtual_incoming_args_rtx) - && CONSTANT_ADDRESS_P (XEXP (XEXP (x, 0), 1))) - { - /* This MEM can appear in more than one place, - but its address better not be shared with anything else. */ - if (! x->used) - XEXP (x, 0) = copy_rtx_if_shared (XEXP (x, 0)); - x->used = 1; - return x; - } break; default: -- David Huggins-Daines, Senior Linux Consultant, Linuxcare, Inc. 613.562.1239 tel dhuggins@linuxcare.com, http://www.linuxcare.com/ Linuxcare. Support for the revolution.