public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "wilson at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/25603] [4.1/4.2 Regression]: Miscompiled FORTRAN program
Date: Tue, 31 Jan 2006 03:49:00 -0000	[thread overview]
Message-ID: <20060131034909.21166.qmail@sourceware.org> (raw)
In-Reply-To: <bug-25603-682@http.gcc.gnu.org/bugzilla/>



------- Comment #7 from wilson at gcc dot gnu dot org  2006-01-31 03:49 -------
Things start going wrong in the reload inheritance code.  For reload 0, for
insn 11, we choose to inherit the value already in r14 in an inner loop in
choose_reload_regs.  Near the end, we double check to make sure we can still
inherit it, and notice we can't because the reload_reg_unavailable test fails. 
We cancel the inheritance, but we continue to use r14 as the reload reg.  We
then have to reload the value into r14, possibly hoping that post reload cse
can simplify the code.  Unfortunately, r14 is used in an auto-inc address in
this instruction which gets reloaded, so we have two reloads using the same
reg, one of which modifies the reg, and this fails miserably.

The inheritance code is calling find_equiv_reg, and then doing a number of
validity tests on the returned result.  One of the tests it does is to call
regno_clobbered_p.  This makes sure the reg isn't used in a clobber or set, but
it makes no attempt to look for other kinds of side-effects, such as auto-inc
addresses.  I think this is where the error lies.  If we modify
regno_clobberred_p to handle a REG_INC note the same as a clobber, then we
would get the right result here for this testcase, as reload 0 is
RELOAD_FOR_OPERAND_ADDRESS.  I'm not sure if this works in general though.  We
might need to be more strict for regs used in a REG_INC note, e.g. we might
need to disallow them always.

I'm curious whether Bernd's new reload-branch works for this testcase.  I don't
have a post-svn-conversion copy, so I had to check out a new copy and I'm doing
a build now.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25603


  parent reply	other threads:[~2006-01-31  3:49 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-30 17:35 [Bug target/25603] New: " hjl at lucon dot org
2005-12-30 17:40 ` [Bug target/25603] " hjl at lucon dot org
2005-12-30 17:53 ` pinskia at gcc dot gnu dot org
2005-12-30 18:42 ` hjl at lucon dot org
2006-01-02 13:57 ` jakub at gcc dot gnu dot org
2006-01-09 22:03 ` steven at gcc dot gnu dot org
2006-01-10 22:07 ` steven at gcc dot gnu dot org
2006-01-23 16:58 ` sje at cup dot hp dot com
2006-01-31  3:49 ` wilson at gcc dot gnu dot org [this message]
2006-02-08  6:40 ` grigory_zagorodnev at linux dot intel dot com
2006-02-10  2:03 ` wilson at gcc dot gnu dot org
2006-02-10  3:37 ` hjl at lucon dot org
2006-02-14 18:56 ` amylaar at gcc dot gnu dot org
2006-02-14 19:33 ` hjl at lucon dot org
2006-02-14 20:04 ` hjl at lucon dot org
2006-02-14 21:15 ` pinskia at gcc dot gnu dot org
2006-02-15 21:29 ` hjl at lucon dot org
2006-02-17  0:03 ` hjl at gcc dot gnu dot org
2006-02-20 17:46 ` [Bug target/25603] [4.1 " hjl at lucon dot org
2006-02-22 16:30 ` rguenth at gcc dot gnu dot org
2006-02-22 16:59 ` hjl at gcc dot gnu dot org
2006-02-22 17:04 ` hjl at lucon dot org
2006-02-22 22:51 ` mmitchel at gcc dot gnu dot org
2006-02-24  1:20 ` mmitchel at gcc dot gnu dot org
2006-02-24  1:37 ` mmitchel at gcc dot gnu dot org

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=20060131034909.21166.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).