public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "mikpe at it dot uu dot se" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/38644] Optimization flag -O1 -fschedule-insns2 causes wrong code
Date: Wed, 26 May 2010 12:44:00 -0000	[thread overview]
Message-ID: <20100526124435.2718.qmail@sourceware.org> (raw)
In-Reply-To: <bug-38644-17122@http.gcc.gnu.org/bugzilla/>



------- Comment #15 from mikpe at it dot uu dot se  2010-05-26 12:44 -------
Created an attachment (id=20749)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20749&action=view)
proposed 4.6 fix for PR38644

PR38644 and its dupes are very similar to PowerPC PR44199 and PR30282.  PR44199
was recently fixed by conditionally emitting stack ties in epilogues.  I first
intended to simply clone that approach for Thumb1, but it turns out there's
already a conditional barrier in thumb1_expand_epilogue ().  So for now I
simply extended that condition to also trigger whenever there's stack pointer
adjustment in the epilogue.  I've confirmed that this fixes the test cases in
PR38644, PR42155, and PR44091.

I know that Richard Earnshaw has stated that he considers this a middle-end
rather than a back-end bug, and I agree with that.  However, given that this
wrong-code bug has been known for so long with no middle-end fix in sight, I
think solving it in the back-end is appropriate for now, at least for 4.4/4.5.

The current patch is a little too heavy in that it also blocks non memory
accesses from being scheduled past the stack pointer adjustment -- I saw an
example of that in the large PR44091 test case.  Using a stack tie instead of a
full barrier should hopefully fix that.

So far only tested with 4.4/4.5/4.6 crosses to armv5tel-unknown-linux-gnueabi. 
I'll try this in a 4.5 native bootstrap soonish (4.6 bootstraps are currently
broken on ARM, see PR44255).


-- 


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


  parent reply	other threads:[~2010-05-26 12:44 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-27 22:11 [Bug c/38644] New: " davejmurphy at me dot com
2008-12-27 22:11 ` [Bug c/38644] " davejmurphy at me dot com
2009-03-17  0:03 ` [Bug target/38644] " rearnsha at gcc dot gnu dot org
2009-11-23 16:42 ` pinskia at gcc dot gnu dot org
2009-12-21 21:47 ` pinskia at gcc dot gnu dot org
2009-12-22 11:16 ` [Bug rtl-optimization/38644] " rearnsha at gcc dot gnu dot org
2009-12-22 11:38 ` steven at gcc dot gnu dot org
2009-12-22 11:58 ` rearnsha at gcc dot gnu dot org
2009-12-22 12:07 ` jakub at gcc dot gnu dot org
2009-12-22 13:33 ` rearnsha at gcc dot gnu dot org
2009-12-22 14:08 ` steven at gcc dot gnu dot org
2009-12-22 14:35 ` cwang at rossvideo dot com
2009-12-22 14:58 ` pinskia at gcc dot gnu dot org
2010-05-13 14:22 ` pinskia at gcc dot gnu dot org
2010-05-17  9:05 ` sebastian dot huber at embedded-brains dot de
2010-05-26 12:44 ` mikpe at it dot uu dot se [this message]
2010-06-06 19:17 ` mikpe at it dot uu dot se
2010-06-10  7:14 ` sebastian dot huber at embedded-brains dot de
2010-08-12  8:19 ` sebastian dot huber at embedded-brains dot de
2010-08-12 10:00 ` [Bug rtl-optimization/38644] [4.3/4.4/4.5/4.6 Regression] " steven at gcc dot gnu dot org
2010-08-12 10:01 ` steven at gcc dot gnu dot org
2010-08-12 10:08 ` steven at gcc dot gnu dot org
2010-08-12 10:12 ` amonakov at gcc dot gnu dot org
2010-08-12 11:37 ` steven at gcc dot gnu dot org
2010-08-12 11:48 ` jakub at gcc dot gnu dot org
2010-08-12 12:00 ` amonakov at gcc dot gnu dot org
2010-08-12 12:04 ` rguenth at gcc dot gnu dot org
2010-08-12 12:13 ` rearnsha at gcc dot gnu dot org
2010-08-12 12:26 ` jakub at gcc dot gnu dot org
2010-08-12 12:31 ` rearnsha at gcc dot gnu dot org
2010-08-30 15:48 ` rguenth at gcc dot gnu dot org
2010-08-30 18:59 ` mikpe at it dot uu dot se

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=20100526124435.2718.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).