public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/61412] New: Warnings incorrectly suppressed when compiling previously preprocessed file
@ 2014-06-04 14:52 matt at godbolt dot org
  2014-06-04 15:31 ` [Bug c++/61412] " redi at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: matt at godbolt dot org @ 2014-06-04 14:52 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61412

            Bug ID: 61412
           Summary: Warnings incorrectly suppressed when compiling
                    previously preprocessed file
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: matt at godbolt dot org

Some warnings appear to be lost when compiling a previously-preprocessed source
file (e.g. as a result of using ccache, which caches the intermediate
preprocessed source). A minimal example (of a post-preprocessed file):

--begin example
# 88 "some/file.cpp" 3 4
struct Foo { int i, j; Foo() : j(1), i(0) {} };
--end example

compiled with: "g++ -c -Wall -Wextra -Werror -o /tmp/foo /tmp/pp.ii" there is
no warning or error about the reordered initializer.  However, removing the
first line (the # directive) to yield:

--begin example2
struct Foo { int i, j; Foo() : j(1), i(0) {} };
--end example2

gives the error, as expected:
/tmp/pp.ii: In constructor ‘Foo::Foo()’:
/tmp/pp.ii:2:21: error: ‘Foo::j’ will be initialized after [-Werror=reorder]
 struct Foo { int i, j; Foo() : j(1), i(0) {} };
                     ^
/tmp/pp.ii:2:18: error:   ‘int Foo::i’ [-Werror=reorder]
 struct Foo { int i, j; Foo() : j(1), i(0) {} };
                  ^
/tmp/pp.ii:2:24: error:   when initialized here [-Werror=reorder]
 struct Foo { int i, j; Foo() : j(1), i(0) {} };
                        ^

GCC version:
$ g++ -v
Using built-in specs.
COLLECT_GCC=/home/mgodbolt/.fighome/runtime/gcc/4.9.0-2/bin/g++
COLLECT_LTO_WRAPPER=/mnt/data/fighome/runtime/gcc/4.9.0-2/bin/../libexec/gcc/x86_64-linux-gnu/4.9.0/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../gcc-4.9.0/configure --prefix
/data/teamcity/work/sud-chibld05-002-RHEL6/9d49ff0b2777552a/scratch/gcc/4.9.0/staging
--build=x86_64-linux-gnu --disable-multilibs --enable-clocale=gnu
--enable-languages=c,c++ --enable-ld=yes --enable-gold=yes
--enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-linker-build-id
--enable-lto --enable-plugins --enable-threads=posix --host=x86_64-linux-gnu
--target=x86_64-linux-gnu --with-pkgversion=DRW-internal-build
--with-system-zlib --disable-werror
--with-libelf=/data/teamcity/work/sud-chibld05-002-RHEL6/9d49ff0b2777552a/scratch/gcc/4.9.0/build/libelf-0.8.13
Thread model: posix
gcc version 4.9.0 (DRW-internal-build) 

Running on Linux.  Does not happen with GCC 4.7.2.
>From gcc-bugs-return-453209-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Jun 04 15:01:42 2014
Return-Path: <gcc-bugs-return-453209-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 29400 invoked by alias); 4 Jun 2014 15:01:41 -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 29358 invoked by uid 48); 4 Jun 2014 15:01:38 -0000
From: "dominiq at lps dot ens.fr" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/61387] [4.10 Regression] ~900 test failures on on x86_64-apple-darwin13 for g++ with -m64 after r211088
Date: Wed, 04 Jun 2014 15:01: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.10.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: dominiq at lps dot ens.fr
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.10.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-61387-4-bEhHOcIbxB@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-61387-4@http.gcc.gnu.org/bugzilla/>
References: <bug-61387-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: 2014-06/txt/msg00291.txt.bz2
Content-length: 961

https://gcc.gnu.org/bugzilla/show_bug.cgi?ida387

--- Comment #5 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
(In reply to Iain Sandoe from comment #4)
> 3.
>
> Anyway, assuming that the intention is to unwrap the indirection from the call
> - something like: ...

The following patch fixes the failures (not counting new ones:
g++.dg/debug/dwarf2/imported-decl-2.C and g++.dg/tls/diag-1.C).

--- ../_clean/gcc/config/i386/i386.c    2014-06-04 00:42:24.000000000 +0200
+++ gcc/config/i386/i386.c    2014-06-04 15:05:42.000000000 +0200
@@ -38898,7 +38898,9 @@ x86_output_mi_thunk (FILE *file,
     {
       if (sibcall_insn_operand (fnaddr, word_mode))
     {
-      tmp = gen_rtx_CALL (VOIDmode, fnaddr, const0_rtx);
+      fnaddr = XEXP (DECL_RTL (function), 0);
+      tmp = gen_rtx_MEM (QImode, fnaddr);
+      tmp = gen_rtx_CALL (VOIDmode, tmp, const0_rtx);
           tmp = emit_call_insn (tmp);
           SIBLING_CALL_P (tmp) = 1;
     }


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

end of thread, other threads:[~2014-06-04 17:28 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-04 14:52 [Bug c++/61412] New: Warnings incorrectly suppressed when compiling previously preprocessed file matt at godbolt dot org
2014-06-04 15:31 ` [Bug c++/61412] " redi at gcc dot gnu.org
2014-06-04 15:33 ` matt at godbolt dot org
2014-06-04 15:34 ` redi at gcc dot gnu.org
2014-06-04 15:51 ` matt at godbolt dot org
2014-06-04 15:52 ` schwab@linux-m68k.org
2014-06-04 16:31 ` redi at gcc dot gnu.org
2014-06-04 17:10 ` redi at gcc dot gnu.org
2014-06-04 17:28 ` matt at godbolt dot 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).