public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: Bernhard Kaindl <bk@suse.de>
To: nobody@gcc.gnu.org
Cc: gcc-prs@gcc.gnu.org,
Subject: Re: optimization/7409: loop optimization
Date: Fri, 26 Jul 2002 05:16:00 -0000	[thread overview]
Message-ID: <20020726121602.13735.qmail@sources.redhat.com> (raw)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 3429 bytes --]

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

From: Bernhard Kaindl <bk@suse.de>
To: <hpenner@de.ibm.com>
Cc: <gcc-gnats@gcc.gnu.org>, <mark@codesourcery.com>,
	<uweigand@de.ibm.com>, <nobody@gcc.gnu.org>, <gcc-prs@gcc.gnu.org>,
	<gcc-bugs@gcc.gnu.org>, Reinhard Max <max@suse.de>
Subject: Re: optimization/7409: loop optimization 
Date: Fri, 26 Jul 2002 14:11:51 +0200 (CEST)

 On 25 Jul 2002 hpenner@de.ibm.com wrote:
 > >Description:
 > loop_optimize deletes an insn, which should not be deleted.
 > This leads to a abort of an application (tcl).
 
 Yes, it leads to an abort in different 8.x tcl versions when
 running the included testsuite on s390x with gcc-3.1.1-cvs,
 but it looks like it can be worked around by changing the
 -O1 in the Makefile ot -O0 or -O2.
 
 Just to bring all the info together, I append some mails
 also describing the problem, a testcase and a proposed fix.
 
 ---------- Forwarded message ----------
 From: Hartmut Penner <HPENNER@de.ibm.com>
 To: mark@codesourcery.com, gcc-patches@gcc.gnu.org
 Cc: uweigand@de.ibm.com
 Date: Thu, 25 Jul 2002 19:53:53 +0200
 Subject: PR 7409/Loop optimization bug patch
 
 A proposed patch for problem described in PR7409 is appended here.
 The problem was, that the usage of a register as a parameter was not taken
 into acount in the function find_single_use_in_loop.
 
 Index: loop.c
 ===================================================================
 RCS file: /cvs/gcc/gcc/gcc/loop.c,v
 retrieving revision 1.389.2.7
 diff -u -r1.389.2.7 loop.c
 --- loop.c      15 Jun 2002 01:12:04 -0000      1.389.2.7
 +++ loop.c      25 Jul 2002 17:41:28 -0000
 @@ -3448,6 +3448,19 @@
    const char *fmt = GET_RTX_FORMAT (code);
    int i, j;
 
 +  if (x == PATTERN (insn) && GET_CODE (insn) == CALL_INSN)
 +    {
 +      rtx link;
 +      for (link = CALL_INSN_FUNCTION_USAGE (insn); link; link = XEXP (link, 1))
 +       {
 +         rtx op, reg;
 +
 +         if (GET_CODE (op = XEXP (link, 0)) == USE
 +             && GET_CODE (reg = XEXP (op, 0)) == REG)
 +           regs->array[REGNO (reg)].single_usage = const0_rtx;
 +       }
 +    }
 +
    if (code == REG)
      regs->array[REGNO (x)].single_usage
        = (regs->array[REGNO (x)].single_usage != 0
 
 
 
 Mit freundlichem Gruß / Best regards,
 
 Hartmut Penner
 GCC for S/390 Development
 
 ---------- Forwarded message ----------
 
 The testcase is from Tcl and is accessibel there under the name tclUtil
 which is the file where the problem appears:
 
 http://www.suse.de/~bk/gcc/testcases/
 
 cc -S -g -O1 -fPIC tclUtil.i
 
 This is the assembler code generated to call TclFindElement (only one
 place in the file):
 
         lgfr    %r4,%r8
         la      %r1,184(%r15)
         stg     %r1,160(%r15)
         la      %r1,188(%r15)
         stg     %r1,168(%r15)
         lg      %r2,200(%r15)
         lgr     %r3,%r10
         la      %r5,192(%r15)
 +       la      %r6,176(%r15)
         brasl   %r14,TclFindElement@PLT
 
 Adding the line marked with + fixes the passing of a pointer onto the
 stack and fixes this particulare case.
 
 There are other cases on tcl which -O1 also cause segementation violations,
 I hope that the other cases are also fixed with the patch above, it's likely
 that the conditions of the other uses of TclFindElement are similar.
 
 Best Regards
 Bernhard Kaindl
 
 Research & Development  SuSE Linux S/390 and zSeries
 


             reply	other threads:[~2002-07-26 12:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-26  5:16 Bernhard Kaindl [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-10-15 10:04 uweigand
2002-07-25 10:36 hpenner

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=20020726121602.13735.qmail@sources.redhat.com \
    --to=bk@suse.de \
    --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).