public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: "Joseph D. Wagner" <wagnerjd@prodigy.net> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, Subject: RE: optimization/8537: Optimizer Removes Code Necessary for Security Date: Fri, 22 Nov 2002 11:26:00 -0000 [thread overview] Message-ID: <20021117150601.9768.qmail@sources.redhat.com> (raw) The following reply was made to PR optimization/8537; it has been noted by GNATS. From: "Joseph D. Wagner" <wagnerjd@prodigy.net> To: <fw@gcc.gnu.org>, <gcc-bugs@gcc.gnu.org>, <gcc-prs@gcc.gnu.org>, <nobody@gcc.gnu.org>, <wagnerjd@prodigy.net>, <gcc-gnats@gcc.gnu.org> Cc: Subject: RE: optimization/8537: Optimizer Removes Code Necessary for Security Date: Sun, 17 Nov 2002 08:59:53 -0600 Direct quote from: http://gcc.gnu.org/onlinedocs/gcc-3.2/gcc/Bug-Criteria.html "If the compiler produces valid assembly code that does not correctly execute the input source code, that is a compiler bug." So to all you naysayers out there who claim this is a programming error or poor coding, YES, IT IS A BUG! From: http://gcc.gnu.org/ml/gcc/2002-01/msg00518.html > The problem is the standard gives wide latitude in what the optimizer can optimize Isn't this also the solution? Can't the optimizer check to see if the function is memset(), and if so check to see if the value is 0 or NULL, and if so leave it in? The optimizer could check if memset() is zeroing out memory by checking if the fill value is 0 or NULL. If the fill value is 0 or NULL, the optimizer can reasonably presume that this instance of memset() is for security and not optimize it out. Joseph Wagner -----Original Message----- From: fw@gcc.gnu.org [mailto:fw@gcc.gnu.org] Sent: Sunday, November 17, 2002 8:28 AM To: gcc-bugs@gcc.gnu.org; gcc-prs@gcc.gnu.org; nobody@gcc.gnu.org; wagnerjd@prodigy.net Subject: Re: optimization/8537: Optimizer Removes Code Necessary for Security Synopsis: Optimizer Removes Code Necessary for Security State-Changed-From-To: open->closed State-Changed-By: fw State-Changed-When: Sun Nov 17 06:28:05 2002 State-Changed-Why: This is not a bug in GCC. The call to memset() clear hasn't any externally visible effect according to the C language specification, so it can be removed by the optimizer. See the discussion around http://gcc.gnu.org/ml/gcc/2002-01/msg00518.html for additional information on a very similar topic. http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=g cc&pr=8537
next reply other threads:[~2002-11-17 15:06 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2002-11-22 11:26 Joseph D. Wagner [this message] -- strict thread matches above, loose matches on Subject: below -- 2002-11-22 11:36 Florian Weimer 2002-11-22 11:26 fw 2002-11-19 12:46 wagnerjd
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=20021117150601.9768.qmail@sources.redhat.com \ --to=wagnerjd@prodigy.net \ --cc=gcc-prs@gcc.gnu.org \ --cc=nobody@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: linkBe 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).