public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: Richard Henderson <rth@redhat.com>
To: nobody@gcc.gnu.org
Cc: gcc-prs@gcc.gnu.org,
Subject: Re: optimization/8165: builtin string functions SEGV on alpha-pc-linux-gnu at -O2
Date: Fri, 11 Oct 2002 15:46:00 -0000	[thread overview]
Message-ID: <20021011224603.26413.qmail@sources.redhat.com> (raw)

The following reply was made to PR optimization/8165; it has been noted by GNATS.

From: Richard Henderson <rth@redhat.com>
To: Glen Nakamura <glen@imodulo.com>
Cc: gcc-gnats@gcc.gnu.org, gcc-bugs@gcc.gnu.org, gcc-patches@gcc.gnu.org
Subject: Re: optimization/8165: builtin string functions SEGV on alpha-pc-linux-gnu at -O2
Date: Fri, 11 Oct 2002 15:44:48 -0700

 You're right about the REG_EQUAL note being bogus, but as I feared,
 the fix was in the wrong place.  The problem has nothing to do with
 lo_sum in specific, but is a generic issue with local cprop failing
 to update notes.
 
 Addressed thus.
 
 
 r~
 
 
         * gcse.c (adjust_libcall_notes): Also adjust notes for INSN.
 
 Index: gcse.c
 ===================================================================
 RCS file: /cvs/gcc/gcc/gcc/gcse.c,v
 retrieving revision 1.220
 diff -u -p -r1.220 gcse.c
 --- gcse.c	30 Sep 2002 13:00:29 -0000	1.220
 +++ gcse.c	11 Oct 2002 07:51:06 -0000
 @@ -4251,6 +4251,7 @@ cprop_insn (insn, alter_jumps)
  
  /* LIBCALL_SP is a zero-terminated array of insns at the end of a libcall;
     their REG_EQUAL notes need updating.  */
 +
  static bool
  do_local_cprop (x, insn, alter_jumps, libcall_sp)
       rtx x;
 @@ -4260,10 +4261,12 @@ do_local_cprop (x, insn, alter_jumps, li
  {
    rtx newreg = NULL, newcnst = NULL;
  
 -  /* Rule out USE instructions and ASM statements as we don't want to change the hard registers mentioned.  */
 +  /* Rule out USE instructions and ASM statements as we don't want to
 +     change the hard registers mentioned.  */
    if (GET_CODE (x) == REG
        && (REGNO (x) >= FIRST_PSEUDO_REGISTER
 -          || (GET_CODE (PATTERN (insn)) != USE && asm_noperands (PATTERN (insn)) < 0)))
 +          || (GET_CODE (PATTERN (insn)) != USE
 +	      && asm_noperands (PATTERN (insn)) < 0)))
      {
        cselib_val *val = cselib_lookup (x, GET_MODE (x), 0);
        struct elt_loc_list *l;
 @@ -4327,17 +4330,23 @@ do_local_cprop (x, insn, alter_jumps, li
  
  /* LIBCALL_SP is a zero-terminated array of insns at the end of a libcall;
     their REG_EQUAL notes need updating to reflect that OLDREG has been
 -   replaced with NEWVAL in INSN.  Return true if all substitutions could
 -   be made.  */
 +   replaced with NEWVAL in INSN.  Also update the REG_EQUAL notes in INSN.
 +
 +   Return true if all substitutions could be made.  */
 +
  static bool
  adjust_libcall_notes (oldreg, newval, insn, libcall_sp)
       rtx oldreg, newval, insn, *libcall_sp;
  {
 -  rtx end;
 +  rtx end, note;
 +
 +  note = find_reg_equal_equiv_note (insn);
 +  if (note)
 +    XEXP (note, 0) = replace_rtx (XEXP (note, 0), oldreg, newval);
  
    while ((end = *libcall_sp++))
      {
 -      rtx note = find_reg_equal_equiv_note (end);
 +      note = find_reg_equal_equiv_note (end);
  
        if (! note)
  	continue;


             reply	other threads:[~2002-10-11 22:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-11 15:46 Richard Henderson [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-10-14 11:16 Richard Henderson
2002-10-12 11:46 Glen Nakamura
2002-10-11 17:56 Richard Henderson
2002-10-11 16:26 Glen Nakamura
2002-10-11 16:13 rth
2002-10-08 16:16 Glen Nakamura
2002-10-08 15:26 Richard Henderson
2002-10-07 18:26 Glen Nakamura
2002-10-07 17:56 glen

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=20021011224603.26413.qmail@sources.redhat.com \
    --to=rth@redhat.com \
    --cc=gcc-prs@gcc.gnu.org \
    --cc=nobody@gcc.gnu.org \
    /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).