public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/59257] usan/*san: Dpcumentation oddness of -fsanitize= / -fsanitize=shift
       [not found] <bug-59257-4@http.gcc.gnu.org/bugzilla/>
@ 2013-11-23 14:19 ` burnus at gcc dot gnu.org
  2013-11-23 21:05 ` manu at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 5+ messages in thread
From: burnus at gcc dot gnu.org @ 2013-11-23 14:19 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> ---
(In reply to Tobias Burnus from comment #0)
>            *<-fsanitize=shift>
>                This option enables checking that the result of a
> The < > look odd.
>   @item @option{-fsanitize=shift}
> Maybe there shouldn't be an @option{}?

Testing shows that it won't help for "man" but makes the string no longer bold.
Seems as if one has to live with it.


> Actually, I think several other options miss a @opindex entry, too.

Patch: http://gcc.gnu.org/ml/gcc-patches/2013-11/msg02981.html


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug middle-end/59257] usan/*san: Dpcumentation oddness of -fsanitize= / -fsanitize=shift
       [not found] <bug-59257-4@http.gcc.gnu.org/bugzilla/>
  2013-11-23 14:19 ` [Bug middle-end/59257] usan/*san: Dpcumentation oddness of -fsanitize= / -fsanitize=shift burnus at gcc dot gnu.org
@ 2013-11-23 21:05 ` manu at gcc dot gnu.org
  2013-11-28 12:23 ` mpolacek at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 5+ messages in thread
From: manu at gcc dot gnu.org @ 2013-11-23 21:05 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="UTF-8", Size: 6070 bytes --]

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |manu at gcc dot gnu.org

--- Comment #2 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
(In reply to Tobias Burnus from comment #1)
> (In reply to Tobias Burnus from comment #0)
> >            *<-fsanitize=shift>
> >                This option enables checking that the result of a
> > The < > look odd.
> >   @item @option{-fsanitize=shift}
> > Maybe there shouldn't be an @option{}?
> 
> Testing shows that it won't help for "man" but makes the string no longer
> bold. Seems as if one has to live with it.

Can you try with the following (plus your opindex fixes)?

Index: gcc/doc/invoke.texi
===================================================================
--- gcc/doc/invoke.texi (revision 205090)
+++ gcc/doc/invoke.texi (working copy)
@@ -5274,39 +5274,39 @@
 Various computations will be instrumented to detect undefined behavior
 at runtime.  Current suboptions are:

-@itemize @bullet
+@table @gcctabopt

-@item @option{-fsanitize=shift}
+@item -fsanitize=shift

 This option enables checking that the result of a shift operation is
 not undefined.  Note that what exactly is considered undefined differs
 slightly between C and C++, as well as between ISO C90 and C99, etc.

-@item @option{-fsanitize=integer-divide-by-zero}
+@item -fsanitize=integer-divide-by-zero

 Detect integer division by zero as well as @code{INT_MIN / -1} division.

-@item @option{-fsanitize=unreachable}
+@item -fsanitize=unreachable

 With this option, the compiler will turn the @code{__builtin_unreachable}
 call into a diagnostics message call instead.  When reaching the
 @code{__builtin_unreachable} call, the behavior is undefined.

-@item @option{-fsanitize=vla-bound}
+@item -fsanitize=vla-bound

 This option instructs the compiler to check that the size of a variable
 length array is positive.  This option does not have any effect in
 @option{-std=c++1y} mode, as the standard requires the exception be thrown
 instead.

-@item @option{-fsanitize=null}
+@item -fsanitize=null

 This option enables pointer checking.  Particularly, the application
 built with this option turned on will issue an error message when it
 tries to dereference a NULL pointer, or if a reference (possibly an
 rvalue reference) is bound to a NULL pointer.

-@end itemize
+@end table

 While @option{-ftrapv} causes traps for signed overflows to be emitted,
 @option{-fsanitize=undefined} gives a diagnostic message.
>From gcc-bugs-return-435657-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sat Nov 23 21:06:05 2013
Return-Path: <gcc-bugs-return-435657-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 4078 invoked by alias); 23 Nov 2013 21:06:05 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 4059 invoked by uid 48); 23 Nov 2013 21:06:01 -0000
From: "troomps01 at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/59267] New: gcc 4.8.2 optimizes code with side-effects away
Date: Sat, 23 Nov 2013 21:06:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Version: unknown
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: troomps01 at gmail dot com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter attachments.created
Message-ID: <bug-59267-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2013-11/txt/msg02434.txt.bz2
Content-length: 1472

http://gcc.gnu.org/bugzilla/show_bug.cgi?idY267

            Bug ID: 59267
           Summary: gcc 4.8.2 optimizes code with side-effects away
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: troomps01 at gmail dot com

Created attachment 31285
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id1285&actioníit
A very simple C++ program and Makefile that compiles without warning, but also
optimizes out some necessary code.

G++ version:
g++ (GCC) 4.8.2 20131017 (Red Hat 4.8.2-1)
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

OS: Linux
Distro: Fedora 19

Here's the fun: I don't have any optimization turned on in the compile line.

What the attached zip contains:
main.cpp
-- A simple C++ program that shows how stringstreams are optimized out during
compilation

Makefile
-- A makefile that has all of the flags I am using in another project where I
originally encountered the problem.

It is worth noting, that even if you don't have _any_ of the flags I provided
in the Makefile, the code is still optimized away. In fact, you could reduce
the Makefile to this "g++ -o main main.cpp" and the problem persists.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug middle-end/59257] usan/*san: Dpcumentation oddness of -fsanitize= / -fsanitize=shift
       [not found] <bug-59257-4@http.gcc.gnu.org/bugzilla/>
  2013-11-23 14:19 ` [Bug middle-end/59257] usan/*san: Dpcumentation oddness of -fsanitize= / -fsanitize=shift burnus at gcc dot gnu.org
  2013-11-23 21:05 ` manu at gcc dot gnu.org
@ 2013-11-28 12:23 ` mpolacek at gcc dot gnu.org
  2013-12-02 19:54 ` burnus at gcc dot gnu.org
  2013-12-02 19:55 ` burnus at gcc dot gnu.org
  4 siblings, 0 replies; 5+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2013-11-28 12:23 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-11-28
   Target Milestone|---                         |4.9.0
     Ever confirmed|0                           |1

--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
We have a patch and are waiting for a review.  Thanks Tobias and Manuel.
http://gcc.gnu.org/ml/gcc-patches/2013-11/msg03082.html


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug middle-end/59257] usan/*san: Dpcumentation oddness of -fsanitize= / -fsanitize=shift
       [not found] <bug-59257-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2013-11-28 12:23 ` mpolacek at gcc dot gnu.org
@ 2013-12-02 19:54 ` burnus at gcc dot gnu.org
  2013-12-02 19:55 ` burnus at gcc dot gnu.org
  4 siblings, 0 replies; 5+ messages in thread
From: burnus at gcc dot gnu.org @ 2013-12-02 19:54 UTC (permalink / raw)
  To: gcc-bugs

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

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #4 from Tobias Burnus <burnus at gcc dot gnu.org> ---
FIXED!

Manuel: Thanks for the suggestion/patchlet of comment 2.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug middle-end/59257] usan/*san: Dpcumentation oddness of -fsanitize= / -fsanitize=shift
       [not found] <bug-59257-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2013-12-02 19:54 ` burnus at gcc dot gnu.org
@ 2013-12-02 19:55 ` burnus at gcc dot gnu.org
  4 siblings, 0 replies; 5+ messages in thread
From: burnus at gcc dot gnu.org @ 2013-12-02 19:55 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Author: burnus
Date: Mon Dec  2 19:54:29 2013
New Revision: 205598

URL: http://gcc.gnu.org/viewcvs?rev=205598&root=gcc&view=rev
Log:
2013-12-02  Tobias Burnus  <burnus@net-b.de>
            Manuel López-Ibáñez  <manu@gcc.gnu.org>

        PR middle-end/59257
        * doc/invoke.texi: Add missing @opindex.
        (-fsanitize=): Use @gcctabopt instead of @itemize.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/doc/invoke.texi
>From gcc-bugs-return-436455-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 02 20:09:14 2013
Return-Path: <gcc-bugs-return-436455-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 10828 invoked by alias); 2 Dec 2013 20:09:13 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 10759 invoked by uid 48); 2 Dec 2013 20:09:06 -0000
From: "hjl.tools at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/59363] [4.9 Regression] r203886 miscompiles git
Date: Mon, 02 Dec 2013 20:09:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: target
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords: wrong-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: hjl.tools at gmail dot com
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P1
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.9.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-59363-4-C2xgsROGrB@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-59363-4@http.gcc.gnu.org/bugzilla/>
References: <bug-59363-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2013-12/txt/msg00110.txt.bz2
Content-length: 2353

http://gcc.gnu.org/bugzilla/show_bug.cgi?idY363

--- Comment #10 from H.J. Lu <hjl.tools at gmail dot com> ---
valgrind reports:

=\x13971== Memcheck, a memory error detector
=\x13971== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
=\x13971== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
=\x13971== Command: ./git-blame Makefile
=\x13971==\x13971== Jump to the invalid address stated on the next line
=\x13971==    at 0x0: ???
=\x13971==    by 0x50AE88: xdl_emit_hunk_hdr (xutils.c:460)
=\x13971==    by 0x50B566: xdl_emit_diff (xemit.c:237)
=\x13971==    by 0x5094DC: xdl_diff (xdiffi.c:601)
=\x13971==    by 0x5038E4: xdi_diff (xdiff-interface.c:136)
=\x13971==    by 0x41035E: diff_hunks (blame.c:104)
=\x13971==    by 0x41296B: cmd_blame (blame.c:815)
=\x13971==    by 0x405EF4: handle_internal_command (git.c:291)
=\x13971==    by 0x4056E0: main (git.c:551)
=\x13971==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
=\x13971==\x13971==\x13971== Process terminating with default action of signal 11 (SIGSEGV)
=\x13971==  Bad permissions for mapped region at address 0x0
=\x13971==    at 0x0: ???
=\x13971==    by 0x50AE88: xdl_emit_hunk_hdr (xutils.c:460)
=\x13971==    by 0x50B566: xdl_emit_diff (xemit.c:237)
=\x13971==    by 0x5094DC: xdl_diff (xdiffi.c:601)
=\x13971==    by 0x5038E4: xdi_diff (xdiff-interface.c:136)
=\x13971==    by 0x41035E: diff_hunks (blame.c:104)
=\x13971==    by 0x41296B: cmd_blame (blame.c:815)
=\x13971==    by 0x405EF4: handle_internal_command (git.c:291)
=\x13971==    by 0x4056E0: main (git.c:551)
=\x13971==\x13971== HEAP SUMMARY:
=\x13971==     in use at exit: 4,584,430 bytes in 4,375 blocks
=\x13971==   total heap usage: 7,936 allocs, 3,561 frees, 36,653,925 bytes
allocated
=\x13971==\x13971== LEAK SUMMARY:
=\x13971==    definitely lost: 162 bytes in 8 blocks
=\x13971==    indirectly lost: 0 bytes in 0 blocks
=\x13971==      possibly lost: 3,016 bytes in 2 blocks
=\x13971==    still reachable: 4,581,252 bytes in 4,365 blocks
=\x13971==         suppressed: 0 bytes in 0 blocks
=\x13971== Rerun with --leak-check=full to see details of leaked memory
=\x13971==\x13971== For counts of detected and suppressed errors, rerun with: -v
=\x13971== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 2 from 2)
[1]    13971 segmentation fault  valgrind ./git-blame Makefile >| /tmp/1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-12-02 19:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-59257-4@http.gcc.gnu.org/bugzilla/>
2013-11-23 14:19 ` [Bug middle-end/59257] usan/*san: Dpcumentation oddness of -fsanitize= / -fsanitize=shift burnus at gcc dot gnu.org
2013-11-23 21:05 ` manu at gcc dot gnu.org
2013-11-28 12:23 ` mpolacek at gcc dot gnu.org
2013-12-02 19:54 ` burnus at gcc dot gnu.org
2013-12-02 19:55 ` burnus at gcc dot gnu.org

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).