public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "manu at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/44786] -fsanitize=undefined: Turn on runtime code generation to check for undefined behavior
Date: Thu, 08 Nov 2012 13:22:00 -0000	[thread overview]
Message-ID: <bug-44786-4-0NTkSr8OBu@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-44786-4@http.gcc.gnu.org/bugzilla/>


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

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|-fcatch-undefined-behavior: |-fsanitize=undefined: Turn
                   |Turn on runtime code        |on runtime code generation
                   |generation to check for     |to check for undefined
                   |undefined behavior          |behavior

--- Comment #7 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2012-11-08 13:21:54 UTC ---
> It didn't get very far (haven't looked deeper yet):

This PR is for implementing those checks in GCC. For things broken in GCC, you
should open new PRs.

BTW, Clang now supports all these checks:

    -fsanitize=alignment: Use of a misaligned pointer or creation of a
misaligned reference.
    -fsanitize=divide-by-zero: Division by zero.
    -fsanitize=float-cast-overflow: Conversion to, from, or between
floating-point types which would overflow the destination.
    -fsanitize=null: Use of a null pointer or creation of a null reference.
    -fsanitize=object-size: An attempt to use bytes which the optimizer can
determine are not part of the object being accessed. The sizes of objects are
determined using __builtin_object_size, and consequently may be able to detect
more problems at higher optimization levels.
    -fsanitize=return: In C++, reaching the end of a value-returning function
without returning a value.
    -fsanitize=shift: Shift operators where the amount shifted is greater or
equal to the promoted bit-width of the left hand side or less than zero, or
where the left hand side is negative. For a signed left shift, also checks for
signed overflow in C, and for unsigned overflow in C++.
    -fsanitize=signed-integer-overflow: Signed integer overflow, including all
the checks added by -ftrapv, and checking for overflow in signed division
(INT_MIN / -1).
    -fsanitize=unreachable: If control flow reaches __builtin_unreachable.
    -fsanitize=vla-bound: A variable-length array whose bound does not evaluate
to a positive value.
    -fsanitize=vptr: Use of an object whose vptr indicates that it is of the
wrong dynamic type, or that its lifetime has not begun or has ended.
Incompatible with -fno-rtti.


  parent reply	other threads:[~2012-11-08 13:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-44786-4@http.gcc.gnu.org/bugzilla/>
2012-04-08 12:11 ` [Bug c++/44786] -fcatch-undefined-behavior: " vanyacpp at gmail dot com
2012-04-08 14:06 ` redi at gcc dot gnu.org
2012-04-08 18:58 ` [Bug middle-end/44786] " pinskia at gcc dot gnu.org
2012-11-08 12:53 ` markus at trippelsdorf dot de
2012-11-08 13:22 ` manu at gcc dot gnu.org [this message]
2014-04-25  8:20 ` [Bug middle-end/44786] -fsanitize=undefined: " vincent-gcc at vinc17 dot net
2014-04-25  8:28 ` mpolacek at gcc dot gnu.org
2014-08-21  6:55 ` mpolacek 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-44786-4-0NTkSr8OBu@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).