From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4207 invoked by alias); 9 Jan 2008 15:37:21 -0000 Received: (qmail 2682 invoked by uid 48); 9 Jan 2008 15:36:37 -0000 Date: Wed, 09 Jan 2008 15:54:00 -0000 Message-ID: <20080109153637.2681.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug rtl-optimization/31944] [4.1/4.2/4.3 Regression] Endless loop while building a 64-bit 2.6.20 kernel In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "rguenth at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-01/txt/msg00869.txt.bz2 ------- Comment #19 from rguenth at gcc dot gnu dot org 2008-01-09 15:36 ------- (reg:DI 66 [ type.0+-4 ]) is entered twice in the table. During flushing we hit: Breakpoint 5, flush_hash_table () at /space/rguenther/src/svn/trunk/gcc/cse.c:1634 1634 if (REG_P (p->exp)) (reg:DI 66 [ type.0+-4 ]) $14 = 1 $15 = (struct table_elt *) 0x1159440 ... Breakpoint 5, flush_hash_table () at /space/rguenther/src/svn/trunk/gcc/cse.c:1634 1634 if (REG_P (p->exp)) (reg:DI 66 [ type.0+-4 ]) $32 = 5 $33 = (struct table_elt *) 0x11594a0 (gdb) print *p $34 = {exp = 0x2ac6c01389a0, canon_exp = 0x0, next_same_hash = 0x0, prev_same_hash = 0x0, next_same_value = 0x0, prev_same_value = 0x0, first_same_value = 0x11594a0, related_value = 0x0, cost = 0, regcost = 1, mode = SImode, in_memory = 0 '\0', is_const = 0 '\0', flag = -1 '�'} and the hash of this reg is 29, not 5. But for the first entry we come along the hash is 1 and matches. So I suppose we have twice the same pseudo in the table, but as we only have one QTY per pseudo, the hash gets messed up. Indeed, the time we try to remove the second entry the QTY is actually invalid: $74 = {timestamp = 1, reg_qty = -67, reg_tick = 3, reg_in_table = -1, subreg_ticked = 4294967295} Reduced testcase: int type; void stuck(int res) { if (type == 1) { if (res == 0) asm volatile("nop"); } else if (type == 0) { if (res == 0) asm volatile("nop" : : "i" (0)); } } fails with -O2 on x86_64 -> hppa64-linux cross. Steven - do you have an idea where to look further? Thx. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31944