Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Mar 2003 17:37:55 -0800
From:      Marcel Moolenaar <marcel@xcllnt.net>
To:        Joe Marcus Clarke <marcus@marcuscom.com>
Cc:        Kris Kennaway <kris@obsecurity.org>, ia64@freebsd.org
Subject:   GCC patch [was: Re: AbiWord2 broken on ia64]
Message-ID:  <20030316013755.GA44480@dhcp01.pn.xcllnt.net>
In-Reply-To: <1047759253.81982.30.camel@shumai.marcuscom.com>
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>

next in thread | previous in thread | raw e-mail | index | archive | help

--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 <sourcefile>.25.rnreg that you don't
> > have on <sourcefile>.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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030316013755.GA44480>