This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: PATCH for bogus loop optimization, part 2

>>>>> "Jeffrey" == Jeffrey A Law <> writes:

    >> Mark Mitchell wrote: > o Any comparison between pointers should
    >> be unsigned.
    Jeffrey> Consider a port where Pmode and POINTER_SIZE specify
    Jeffrey> different sized quantities.  This happens on the alpha,
    Jeffrey> mn102 and maybe other ports.

    Jeffrey> Does your patch still do the right thing when comparing
    Jeffrey> pointers on such machines?

This sentence confused me slightly.  I think that, even though you
replied to Bill, you were actually addressing me.  Under that
assumption, I'll take `your patch' to be this one:

  Thu Jul 16 10:31:23 1998  Mark Mitchell  <>

	  * loop.c (maybe_eliminate_biv_1): Avoid signed/unsigned comparison
	  confusion when setting cc0.

My patch really "does" nothing.  It simply disables (by putting a `0
&&' at the beginning of a test) an optimization in
maybe_eliminate_biv_1, since that optimization is unsafe.  Thus, all
that will happen is that fewer bivs will be eliminated.  I don't see
how this can "do the wrong thing" except in the sense that it may
generate worse code than you might wish.  The other alternative would
be to fix this optimization somehow.

    Jeffrey> jeff

Mark Mitchell
Mark Mitchell Consulting

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]