public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: chris@lslsun.epfl.ch (Christian Iseli)
To: law@cygnus.com
Cc: egcs@cygnus.com
Subject: Re: Small problem in cse
Date: Tue, 02 Dec 1997 07:10:00 -0000	[thread overview]
Message-ID: <199712021510.QAA08509@lslsun17.epfl.ch> (raw)

> Sorry, I meant to say why is classp->first_same_value NULL?
> 
> From my review of the code I don't see that classp->first_same_value should
> ever be NULL -- thus I suspect something has gone wrong elsewhere that
> needs to be investigated.
> 
> But I could be wrong, since you've got a target & testcase which triggers
> this problem you'll need to do some of the analysis.

Sorry for the long delay...

Turns out you were right, the problem was elsewhere.

Basically, the code around line 74xx in cse.c tries to find some
equivalence in the table and then sets classp to be the
first_same_value of the equivalence chain.  However, no check was
done to ensure that this first_same_value was valid.  So when
remove_invalid_refs was called later, the element pointed to by
classp was deleted, leading to trouble...

The following patch cures the problem (I hope :-)

Cheers,
					Christian

Tue Dec  2 16:07:45 1997  Christian Iseli  <Christian.Iseli@lslsun.epfl.ch>

	* cse.c (cse_insn): Check for invalid entries when taking references.


*** cse.c~	Mon Nov 17 07:50:55 1997
--- cse.c	Tue Dec  2 15:49:50 1997
*************** cse_insn (insn, in_libcall_block)
*** 7428,7433 ****
--- 7428,7438 ----
  		  merge_equiv_classes (src_elt, classp);
  
  		classp = src_elt->first_same_value;
+ 		/* Ignore invalid entries.  */
+ 		while (classp
+ 		       && GET_CODE (classp->exp) != REG
+ 		       && ! exp_equiv_p (classp->exp, classp->exp, 1, 0))
+ 		  classp = classp->next_same_value;
  	      }
  	  }
        }

             reply	other threads:[~1997-12-02  7:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-12-02  7:10 Christian Iseli [this message]
1997-12-06  7:51 ` Jeffrey A Law
  -- strict thread matches above, loose matches on Subject: below --
1997-10-28  7:06 Christian Iseli
1997-10-28  7:11 ` Joern Rennecke
1997-10-26 23:47 Christian Iseli
1997-10-27  6:02 ` Joern Rennecke
1997-10-20  1:43 Christian Iseli
1997-10-20  9:43 ` Jeffrey A Law
1997-10-20 13:28   ` Christian Iseli
1997-10-17 13:44 Christian Iseli
1997-10-17 19:06 ` Jeffrey A Law

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199712021510.QAA08509@lslsun17.epfl.ch \
    --to=chris@lslsun.epfl.ch \
    --cc=egcs@cygnus.com \
    --cc=law@cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).