public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Bernd Edlinger <bernd.edlinger@hotmail.de>
Cc: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>,
	       Richard Biener <richard.guenther@gmail.com>,
	Jeff Law <law@redhat.com>,
	       Eric Botcazou <ebotcazou@adacore.com>
Subject: Re: [RFC] Sanitize rtx_addr_can_trap_p_1
Date: Thu, 11 Jun 2015 08:40:00 -0000	[thread overview]
Message-ID: <20150611080203.GT10247@tucnak.redhat.com> (raw)
In-Reply-To: <DUB118-W34295B153A59B9B953311CE4BC0@phx.gbl>

On Thu, Jun 11, 2015 at 09:42:38AM +0200, Bernd Edlinger wrote:
> it was exactly to the day one year ago, when I posted this patch the first time:
> [PATCH] PR rtl-optimization/61047: https://gcc.gnu.org/ml/gcc-patches/2014-06/msg00996.html
> 
> The PR was suspended, but the discussion did not stop.  And I personally still see a bug like this
> as an in-acceptable security risk for embedded safety systems.
> 
> The problem is, that when rtx_addr_can_trap_p_1 returns 0, that means for the code generation
> that this instruction can be moved out of any guarding if-block when that seems profitable.
> 
> This is a latent wrong code generation bug, that happens mostly in machine generated compiler-test code,
> but the point is, we can never be sure, that this is impossible to happen in "real" code.
> 
> So I would like to fix this now, because there are quite a few duplicated reports of the same
> bug already, and because refusing to fix a known wrong code bug is just not our style.
> 
> 
> I have boot-strapped and regression tested the patch with all languages again on x86_64-linux-gnu.
> The patch still works unmodified, and all I would have to change on the original patch files
> will be the year: s/2014/2015/g ;)

IMHO the
#if 0
#endif
stuff doesn't belong to the patch.

Other than that, as I said already in the PR, I'm in favor of applying it to
the trunk (only, not release branches) and watching for performance and/or
wrong-code issues, but Eric is against it.  What do others think about it?

From John Regehr's talk at GCC Summit a few years ago I got the
impression that for people to be able to effectively report bugs in the
compiler through code generator it is important that discovered bugs in the
compiler are fixed timely, otherwise it makes life to the reporters much
harder, because then they'll run into the same still unfixed issue all the
time.

> gcc/ChangeLog:
> 2014-06-11  Bernd Edlinger  <bernd.edlinger@hotmail.de>
> 
> 	PR rtl-optimization/61047
> 	* rtlanal.c (get_initial_register_offset): New function.
> 	(rtx_addr_can_trap_p_1): Check offsets of stack references.
> 
> testsuite/ChangeLog:
> 2014-06-11  Bernd Edlinger  <bernd.edlinger@hotmail.de>
> 
> 	PR rtl-optimization/61047
> 	* gcc.c-torture/execute/20140611-1.c: New testcase.

	Jakub

  reply	other threads:[~2015-06-11  8:02 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-11  7:48 Bernd Edlinger
2015-06-11  8:40 ` Jakub Jelinek [this message]
2015-06-11 10:44   ` Bernd Edlinger
2015-06-11 10:57     ` Richard Biener
2015-06-11 16:04       ` Bernd Edlinger
2015-06-11 11:00     ` Jakub Jelinek
2015-06-11 14:38       ` Bernd Edlinger
2015-06-11 14:40         ` Richard Biener
2015-06-11 15:55           ` Bernd Edlinger
2015-06-11 11:29   ` Eric Botcazou
2015-06-11 11:57     ` Jakub Jelinek
2015-06-12  9:24     ` Bernd Edlinger
2015-06-15  9:03 ` Bernd Edlinger
2015-07-01 12:31   ` [PING] " Bernd Edlinger
2015-07-01 12:35     ` Jakub Jelinek

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=20150611080203.GT10247@tucnak.redhat.com \
    --to=jakub@redhat.com \
    --cc=bernd.edlinger@hotmail.de \
    --cc=ebotcazou@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=law@redhat.com \
    --cc=richard.guenther@gmail.com \
    /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).