From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27994 invoked by alias); 16 Nov 2001 20:13:24 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 27942 invoked from network); 16 Nov 2001 20:13:21 -0000 Received: from unknown (HELO atrey.karlin.mff.cuni.cz) (195.113.31.123) by sourceware.cygnus.com with SMTP; 16 Nov 2001 20:13:21 -0000 Received: (from hubicka@localhost) by atrey.karlin.mff.cuni.cz (8.9.3/8.9.3/Debian 8.9.3-21) id VAA06902; Fri, 16 Nov 2001 21:13:23 +0100 Date: Tue, 13 Nov 2001 15:03:00 -0000 From: Jan Hubicka To: gcc-patches@gcc.gnu.org, gcc-pdo@atrey.karlin.mff.cuni.cz, rth@cygnus.com Subject: gcse fix Message-ID: <20011116211323.C5098@atrey.karlin.mff.cuni.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.20i X-SW-Source: 2001-11/txt/msg00390.txt.bz2 Hi, This bug hit me second time. The problem is that when we create REG_EQUAL note for insn in the fialed constant propagation, we do not copy the rtx properly getting rtl sharing problems that can cause mysterious crashes later. I;'ve installed it to the branch. OK for mainline? Fri Nov 16 19:12:08 CET 2001 Jan Hubicka * gcse.c (try_replace_reg): Copy RTX before creating note. *** gcse.c.old Fri Nov 16 16:01:28 2001 --- gcse.c Fri Nov 16 17:36:26 2001 *************** try_replace_reg (from, to, insn) *** 3927,3936 **** } /* If we've failed to do replacement, have a single SET, and don't already ! have a note, add a REG_EQUAL note to not lose information. */ ! if (!success && note == 0 && set != 0) ! note = set_unique_reg_note (insn, REG_EQUAL, src); /* If there is already a NOTE, update the expression in it with our replacement. */ else if (note != 0) --- 3927,3938 ---- } /* If we've failed to do replacement, have a single SET, and don't already ! have a note, add a REG_EQUAL note to not lose information. + The copy is required, as simplify_replace_rtx does not copy the + parts that has not been touched. */ + if (!success && note == 0 && set != 0) + note = set_unique_reg_note (insn, REG_EQUAL, copy_rtx (src)); /* If there is already a NOTE, update the expression in it with our replacement. */ else if (note != 0)