public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jbuehler at spirentcom dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/32820] optimizer malfunction when mixed with asm statements
Date: Thu, 09 Aug 2007 11:38:00 -0000	[thread overview]
Message-ID: <20070809113824.12615.qmail@sourceware.org> (raw)
In-Reply-To: <bug-32820-14880@http.gcc.gnu.org/bugzilla/>



------- Comment #4 from jbuehler at spirentcom dot com  2007-08-09 11:38 -------
Created an attachment (id=14045)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14045&action=view)
gcc 4.0.4 global register variable optimizer patch

The attached patch fixes the optimizer bug for gcc 4.0.4 and allows GHC 6.6.1
to be compiled with optimization turned on.  The problem is that lifetime
analysis is marking global registers as REG_UNUSED and then the combiner pass
is eliminating them.  The fix is to not mark global registers as unused.

The fix is based on a review of the flow.c code for gcc 4.2.0.  Code was added
to flow.c somewhere after 4.0.4 to handle "stack registers" and no mark them as
REG_UNUSED.  This patch merely mimics "stack register" handling in flow.c for
global registers.

I am not a gcc expert and make no claims for the correctness of this patch --
it does fix my ghc compile though.


-- 


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


  parent reply	other threads:[~2007-08-09 11:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-19 13:16 [Bug c/32820] New: " jbuehler at spirentcom dot com
2007-07-25 13:09 ` [Bug middle-end/32820] " jbuehler at spirentcom dot com
2007-07-25 13:22 ` jbuehler at spirentcom dot com
2007-07-25 13:28 ` jbuehler at spirentcom dot com
2007-08-09 11:38 ` jbuehler at spirentcom dot com [this message]
2007-11-26 14:10 ` steven at gcc dot gnu dot org
2009-02-04  4:24 ` danglin at gcc dot gnu dot org
     [not found] <bug-32820-4@http.gcc.gnu.org/bugzilla/>
2010-10-11 19:18 ` siarhei.siamashka at gmail dot com
2010-10-25 10:18 ` siarhei.siamashka at gmail dot com

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