From owner-freebsd-ia64 Sat Mar 15 17:38: 2 2003 Delivered-To: freebsd-ia64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2987937B404 for ; Sat, 15 Mar 2003 17:37:59 -0800 (PST) Received: from ns1.xcllnt.net (209-128-86-226.BAYAREA.NET [209.128.86.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2144543F75 for ; Sat, 15 Mar 2003 17:37:57 -0800 (PST) (envelope-from marcel@xcllnt.net) Received: from dhcp01.pn.xcllnt.net (dhcp01.pn.xcllnt.net [192.168.4.201]) by ns1.xcllnt.net (8.12.8/8.12.8) with ESMTP id h2G1buSd072439; Sat, 15 Mar 2003 17:37:56 -0800 (PST) (envelope-from marcel@piii.pn.xcllnt.net) Received: from dhcp01.pn.xcllnt.net (localhost [127.0.0.1]) by dhcp01.pn.xcllnt.net (8.12.7/8.12.7) with ESMTP id h2G1bulO044554; Sat, 15 Mar 2003 17:37:56 -0800 (PST) (envelope-from marcel@dhcp01.pn.xcllnt.net) Received: (from marcel@localhost) by dhcp01.pn.xcllnt.net (8.12.7/8.12.7/Submit) id h2G1btVe044553; Sat, 15 Mar 2003 17:37:55 -0800 (PST) (envelope-from marcel) Date: Sat, 15 Mar 2003 17:37:55 -0800 From: Marcel Moolenaar To: Joe Marcus Clarke Cc: Kris Kennaway , ia64@freebsd.org Subject: GCC patch [was: Re: AbiWord2 broken on ia64] Message-ID: <20030316013755.GA44480@dhcp01.pn.xcllnt.net> References: <20030314170854.GF2611@rot13.obsecurity.org> <1047669110.317.54.camel@gyros> <20030314210743.GC777@dhcp01.pn.xcllnt.net> <1047676322.317.77.camel@gyros> <20030314235526.GB1283@dhcp01.pn.xcllnt.net> <1047688506.5788.0.camel@shumai.marcuscom.com> <20030315015849.GA1781@dhcp01.pn.xcllnt.net> <1047759253.81982.30.camel@shumai.marcuscom.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="liOOAslEiF7prFVr" Content-Disposition: inline In-Reply-To: <1047759253.81982.30.camel@shumai.marcuscom.com> User-Agent: Mutt/1.5.3i Sender: owner-freebsd-ia64@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org --liOOAslEiF7prFVr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, Mar 15, 2003 at 03:14:13PM -0500, Joe Marcus Clarke wrote: > On Fri, 2003-03-14 at 20:58, Marcel Moolenaar wrote: *snip* > > The bug is caused by the second run of the if-converter when the > > jump table of a switch statement is eliminated while the code to > > access it is still there and predicated. > > The best way to see if AbiWord2 is the same is by creating a > > preprocessed file and strip as much functions from it as is valid. > > Then, running the compiler with -da creates a dozen or so dump > > files. Look at a label in .25.rnreg that you don't > > have on .26.ce2. *snip* > > If your case is roughly the same, I may be able to hack up a quick > > and dirty patch... > > It appears my situation is similar. I have attached the offending > function as well as the missing code_label and jump_insn. Hope this > helps. It did. Attached the GCC patch that fixes my trigger case, by I could not test your trigger case because it's incomplete. Can you try the attached patch. The easiest way to test this is to do a buildworld (either cross or native) and wait for GCC to be built. Update your PATH to include /usr/obj/usr/src/ia64/usr/bin for a native build or /usr/obj/ia64/usr/src/i386/usr/bin for an i386 hosted cross build. That way you pick the patched compiler from within the object tree. Everything else works like normal (provided you waited until includes got installed before you nuked the buildworld :-) If the patch fixes your case as well, I'm going to create a FreeBSD PR for this that we can close if we upgrade to a fixed GCC and I'm also going to file a GCC PR they can close if they fix GCC. BTW: The patch is deliberately not production ready because I want to see if (and when) it kicks in. So it now emits: XXX: U-turn trying to merge BBs If you see that, armageddon has been prevented... I'll do an ia64 buildworld with this just for kicks. FYI, -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net --liOOAslEiF7prFVr Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="gcc.diff" Index: ifcvt.c =================================================================== RCS file: /home/ncvs/src/contrib/gcc/ifcvt.c,v retrieving revision 1.1.1.4 diff -u -r1.1.1.4 ifcvt.c --- ifcvt.c 1 Sep 2002 20:37:43 -0000 1.1.1.4 +++ ifcvt.c 16 Mar 2003 01:06:02 -0000 @@ -1938,12 +1938,18 @@ || join_bb->pred->pred_next == NULL) && join_bb != EXIT_BLOCK_PTR) { - /* We can merge the JOIN. */ - if (life_data_ok) - COPY_REG_SET (combo_bb->global_live_at_end, - join_bb->global_live_at_end); - merge_blocks_nomove (combo_bb, join_bb); - num_removed_blocks++; + /* The BBs must be adjacent in order to use merge_blocks_nomove. */ + if (NEXT_INSN(combo_bb->end) == join_bb->head) + { + /* We can merge the JOIN. */ + if (life_data_ok) + COPY_REG_SET (combo_bb->global_live_at_end, + join_bb->global_live_at_end); + merge_blocks_nomove (combo_bb, join_bb); + num_removed_blocks++; + } + else + fprintf(stderr, "XXX: U-turn trying to merge BBs\n"); } else { --liOOAslEiF7prFVr-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ia64" in the body of the message