http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59257 Manuel López-Ibáñez changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |manu at gcc dot gnu.org --- Comment #2 from Manuel López-Ibáñez --- (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: 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: List-Archive: List-Post: List-Help: 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" 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: 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.