public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/49279] [4.5/4.6/4.7 Regression] Optimization incorrectly presuming constant variable inside loop in g++ 4.5 and 4.6 with -O2 and -O3 for x86_64 targets
Date: Thu, 06 Oct 2011 08:10:00 -0000	[thread overview]
Message-ID: <bug-49279-4-cBd70bR6wV@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-49279-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #14 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-10-06 08:09:51 UTC ---
(In reply to comment #11)
> Created attachment 25423 [details]
> CAST_RESTRICT removal
> 
> Attaching a test patch that just removed CAST_RESTRICT altogether, plus IRC
> discussion that lead to it.  The only testsuite regressions are Wobjsize-1.c
> and strlenopt-4gf.c which show an important security related problem - we
> probably shouldn't be folding builtins if DECL_INITIAL (fndecl) != NULL &&
> DECL_DECLARED_INLINE_P (fndecl) && cfun && !cfun->after_inlining,
> because then we happily fold e.g. char buf[2]; strcpy (buf, "abcd"); into
> __builtin_memcpy even when strcpy is always_inline inline wrapper that calls
> __builtin___strcpy_chk and would complain about the buffer overflow resp. add
> runtime checking.

The patch looks ok to me once we solved the folding issue (we probably have
to backport that as well then).


  parent reply	other threads:[~2011-10-06  8:10 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-03 21:23 [Bug c++/49279] New: " tcmartins at gmail dot com
2011-06-04 16:37 ` [Bug c++/49279] " hjl.tools at gmail dot com
2011-06-06  9:06 ` [Bug c++/49279] [4.5/4.6/4.7 Regression] " rguenth at gcc dot gnu.org
2011-06-06 13:01 ` rguenth at gcc dot gnu.org
2011-06-06 14:04 ` rguenth at gcc dot gnu.org
2011-08-01 14:03 ` rguenth at gcc dot gnu.org
2011-10-04 16:48 ` [Bug tree-optimization/49279] " jakub at gcc dot gnu.org
2011-10-04 16:59 ` jakub at gcc dot gnu.org
2011-10-05  8:09 ` jakub at gcc dot gnu.org
2011-10-05  9:06 ` jakub at gcc dot gnu.org
2011-10-05  9:43 ` rguenther at suse dot de
2011-10-05 14:39 ` rguenth at gcc dot gnu.org
2011-10-05 15:51 ` jakub at gcc dot gnu.org
2011-10-05 15:53 ` jakub at gcc dot gnu.org
2011-10-06  8:08 ` rguenth at gcc dot gnu.org
2011-10-06  8:10 ` rguenth at gcc dot gnu.org [this message]
2011-10-06 16:39 ` jakub at gcc dot gnu.org
2011-10-06 19:58 ` jakub at gcc dot gnu.org
2011-10-07  8:16 ` [Bug tree-optimization/49279] [4.5 " rguenth at gcc dot gnu.org
2011-10-12 15:27 ` matz at gcc dot gnu.org
2012-01-03 12:21 ` rguenth at gcc dot gnu.org
2012-01-03 13:56 ` rguenth at gcc dot gnu.org
2012-01-03 14:05 ` rguenth at gcc dot gnu.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=bug-49279-4-cBd70bR6wV@http.gcc.gnu.org/bugzilla/ \
    --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).