public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Mark Mitchell <mark@codesourcery.com>
To: Eric Botcazou <ebotcazou@libertysurf.fr>, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] PR c/8439
Date: Wed, 06 Nov 2002 22:32:00 -0000	[thread overview]
Message-ID: <15760000.1036643132@localhost> (raw)
In-Reply-To: <200211041508.53292.ebotcazou@libertysurf.fr>

> The proposed fix is to teach expand_increment not to emit insn when the
> increment is null. Bootstrapped/regtested (c,c++,objc,f77 mainline) on
> i586-redhat-linux-gnu.

This fix isn't correct; if the thing being incremented is volatile, we
should still access it.

The real problem is that validate_replace_rtx_1 is performing
simplifications; when we replace the virtual argument pointer with
the real one it tries to get rid of the plus in the following:

(set (mem/f:SI (reg/f:SI 53 virtual-incoming-args) [0 p+0 S4 A32])
  (plus:SI (mem/f:SI (reg/f:SI 53 virtual-incoming-args) [0 p+0 S4 A32])
    (const_int 0 [0x0])))

which makes the expression unrecognizable.

There's even a comment:

      /* If we have a PLUS whose second operand is now a CONST_INT, use
         plus_constant to try to simplify it.
         ??? We may want later to remove this, once simplification is
         separated from this function.  */

We should really be simplifying only if *both* arguments are now
CONST_INTs.  I'll try that for mainline.

I thought about trying to fix this as you suggested, or even earlier
in the production of trees, but the volatile thing makes it a bit
tricky, and the bottom line is that validate_replace_rtx_1 is broken.

So, we'll punt this one to another day; I can't see messing with anything
in the generic middle end code to fix a bug involving the GNU zero-sized
structure extension.  (Insert rant about extensions here.)

-- 
Mark Mitchell                mark@codesourcery.com
CodeSourcery, LLC            http://www.codesourcery.com

  parent reply	other threads:[~2002-11-07  6:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-04  6:12 Eric Botcazou
2002-11-04  6:17 ` Paolo Carlini
2002-11-06 22:32 ` Mark Mitchell [this message]
2002-11-08  4:41   ` Eric Botcazou
2002-11-08  9:07     ` Mark Mitchell
2002-11-08 15:51       ` Eric Botcazou
2002-11-10 21:37         ` Mark Mitchell
2002-11-22 13:39       ` Eric Botcazou
2002-11-22 13:48         ` Mark Mitchell

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=15760000.1036643132@localhost \
    --to=mark@codesourcery.com \
    --cc=ebotcazou@libertysurf.fr \
    --cc=gcc-patches@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).