From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30739 invoked by alias); 23 Jul 2015 13:20:51 -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 Received: (qmail 30686 invoked by uid 48); 23 Jul 2015 13:20:47 -0000 From: "manu at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/53431] C++ preprocessor ignores #pragma GCC diagnostic Date: Thu, 23 Jul 2015 13:20:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.7.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: minor X-Bugzilla-Who: manu at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: 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: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-07/txt/msg01997.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D53431 --- Comment #23 from Manuel L=C3=B3pez-Ib=C3=A1=C3=B1ez --- (In reply to Manuel L=C3=B3pez-Ib=C3=A1=C3=B1ez from comment #21) > Now that you posted a complete example here: > https://gcc.gnu.org/ml/gcc-help/2015-07/msg00070.html you seem to actually > be hitting PR66290, not this one. Sorry, I meant PR64079. >>From gcc-bugs-return-493108-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Jul 23 13:31:13 2015 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 63052 invoked by alias); 23 Jul 2015 13:31:13 -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 62998 invoked by uid 48); 23 Jul 2015 13:31:09 -0000 From: "manu at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/64079] %+D in diagnostics breaks pragma GCC diagnostic Date: Thu, 23 Jul 2015 13:31:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.9.2 X-Bugzilla-Keywords: diagnostic, easyhack X-Bugzilla-Severity: normal X-Bugzilla-Who: manu at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: 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: keywords Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-07/txt/msg01998.txt.bz2 Content-length: 513 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D64079 Manuel L=C3=B3pez-Ib=C3=A1=C3=B1ez changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |easyhack --- Comment #4 from Manuel L=C3=B3pez-Ib=C3=A1=C3=B1ez --- BTW, changes like the above are trivial to implement and test, thus this is= a nice easy-hack for beginners. >>From gcc-bugs-return-493109-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Jul 23 13:40:23 2015 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 126183 invoked by alias); 23 Jul 2015 13:40:23 -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 126120 invoked by uid 48); 23 Jul 2015 13:40:14 -0000 From: "noloader at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/53431] C++ preprocessor ignores #pragma GCC diagnostic Date: Thu, 23 Jul 2015 13:40:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.7.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: minor X-Bugzilla-Who: noloader at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: 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: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-07/txt/msg01999.txt.bz2 Content-length: 558 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D53431 --- Comment #24 from Jeffrey Walton --- (In reply to Manuel L=C3=B3pez-Ib=C3=A1=C3=B1ez from comment #23) > (In reply to Manuel L=C3=B3pez-Ib=C3=A1=C3=B1ez from comment #21) > > Now that you posted a complete example here: > > https://gcc.gnu.org/ml/gcc-help/2015-07/msg00070.html you seem to actua= lly > > be hitting PR66290, not this one. >=20 > Sorry, I meant PR64079. NP. In that example I posted, I meant GCC_DIAGNOSTIC_AWARE, not GCC_OPTIMIZE_AWARE. Sorry about that. >>From gcc-bugs-return-493110-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Jul 23 13:45:00 2015 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 5047 invoked by alias); 23 Jul 2015 13:45:00 -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 4635 invoked by uid 48); 23 Jul 2015 13:44:55 -0000 From: "olegendo at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/66930] [5 Regression]: gengtype.c is miscompiled during stage2 Date: Thu, 23 Jul 2015 13:45: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: 5.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: olegendo at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 5.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-07/txt/msg02000.txt.bz2 Content-length: 3821 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D66930 --- Comment #10 from Oleg Endo --- (In reply to Kazumoto Kojima from comment #6) > Created attachment 36040 [details] > .i file for gengtype.c >=20 > I've confirmed a miscompile for gengtype.c with -O1 on my 5/6 > compilers. With them, >=20 > if (union_p) > { > oprintf (d->of, "%*sbreak;\n", d->indent, ""); > d->indent -=3D 2; > } >=20 > lines in gengtype.c:walk_type function are compiled like as: >=20 > bf .L2253 > mov.l .L2593,r7 > mov.l @(36,r12),r6 > mov.l .L2580,r5 > mov.l .L2595,r1 > jsr @r1 > ... >=20 > i.e. the instruction testing union_p variable is removed. > The resulted gengtype produces files without "break" in many > cases. Although it's the other way around with the reported > full of "break" symptom, I think the both are the same issue. > The deletion has happened in sh_split_movrt_negc_to_movt_xor > which is called by movrt_negc insn_and_split. It seems that > that splitting is applied for the case >=20 > tst reg,reg > mov #-1,reg1 > negc reg1,reg1 > ... > call ... > ... > tst reg,reg >=20 > and the last tst was removed. Oleg, could you take a look into > this? Somehow I couldn't find the code patterns above in my version of the compil= ed code, so I've compared the compiled asm code of gengtype.ii with sh_split_movrt_negc_to_movt_xor and without (always returns false) at -O1 a= nd hit this diff: without: mov.l @(40,r15),r0 cmp/eq #5,r0 mov #-1,r0 negc r0,r0 mov.b r0,@(2,r8) mov r12,r5 mov.l .L2664,r1 jsr @r1 mov.l @(8,r10),r4 mov r14,r0 mov.b r0,@(2,r8) mov.l .L2631,r1 jsr @r1 mov r13,r4 mov.l @(40,r15),r0 cmp/eq #5,r0 bf .L2286 with: mov.l @(44,r15),r0 cmp/eq #5,r0 movt r0 xor #1,r0 mov.b r0,@(2,r8) mov r12,r5 mov.l .L2664,r1 jsr @r1 mov.l @(8,r10),r4 mov r14,r0 mov.b r0,@(2,r8) mov.l .L2631,r1 jsr @r1 mov r13,r4 bf .L2286 The original idea of this transformation is to not clobber the T bit with t= he negc-movrt insn and re-use the T bit later. It seems that it's missing the fact that the T bit is clobbered by calls. The following seems to fix it: Index: gcc/config/sh/sh.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- gcc/config/sh/sh.c (revision 225987) +++ gcc/config/sh/sh.c (working copy) @@ -13888,6 +13888,7 @@ && !sh_insn_operands_modified_between_p (t_before_negc.insn, t_before_negc.insn, t_after_negc.insn) + && !modified_between_p (get_t_reg_rtx (), curr_insn, t_after_negc.in= sn) && !sh_unspec_insn_p (t_after_negc.insn) && !volatile_insn_p (PATTERN (t_after_negc.insn)) && !side_effects_p (PATTERN (t_after_negc.insn)) I've added this code as part of PR 63986. I've checked with make -k check-= gcc RUNTESTFLAGS=3D"sh.exp --target_board=3Dsh-sim\{-m2a/-mb,-m4/-ml,-m4/-mb}" = that there are no new SH specific fails, so I assume the patch above should be OK (although all the checks should probably be combined to avoid walking the i= nsns repeatedly). Could you please add it to your test run? I'm sorry for this nasty bug. Obviously it's not only a problem for -O1 but for anything > -O= 0. >>From gcc-bugs-return-493111-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Jul 23 13:47:46 2015 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 29596 invoked by alias); 23 Jul 2015 13:47:46 -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 29455 invoked by uid 48); 23 Jul 2015 13:47:42 -0000 From: "anders.granlund.0 at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/66976] New: Compiler error for well-formed program with a definition of a constexpr function returning void Date: Thu, 23 Jul 2015 13:47:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: anders.granlund.0 at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: 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 target_milestone 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: 2015-07/txt/msg02001.txt.bz2 Content-length: 6034 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66976 Bug ID: 66976 Summary: Compiler error for well-formed program with a definition of a constexpr function returning void Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: anders.granlund.0 at gmail dot com Target Milestone: --- The following program (prog.cc in the command line below) is well-formed: constexpr void f() {} int main() {} Note that the return type void is a literal type according to [basic.types]/10: http://eel.is/c++draft/basic.types#10 I compiled the program with the following command line: gcc prog.cc -std=c++11 -pedantic-errors I expected to get no errors since the program is well-formed, but I got the following error: prog.cc: In function 'constexpr void f()': prog.cc:1:16: error: invalid return type 'void' of constexpr function 'constexpr void f()'constexpr void f() {} ^ For comparison Clang accepts the program without errors. Output for gcc -v (I think the bug quite independent of this however): Using built-in specs. COLLECT_GCC=/usr/local/gcc-head/bin/g++ COLLECT_LTO_WRAPPER=/usr/local/gcc-head/libexec/gcc/x86_64-unknown-linux-gnu/6.0.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: /home/heads/gcc/gcc-source/configure --prefix=/usr/local/gcc-head --enable-languages=c,c++ --enable-lto --disable-multilib --without-ppl --without-cloog-ppl --enable-checking=release --disable-nls Thread model: posix gcc version 6.0.0 20150722 (experimental) (GCC) COLLECT_GCC_OPTIONS='-o' 'prog.exe' '-std=c++11' '-pedantic-errors' '-v' '-shared-libgcc' '-mtune=generic' '-march=x86-64' /usr/local/gcc-head/libexec/gcc/x86_64-unknown-linux-gnu/6.0.0/cc1plus -quiet -v -imultiarch x86_64-linux-gnu -D_GNU_SOURCE prog.cc -quiet -dumpbase prog.cc -mtune=generic -march=x86-64 -auxbase prog -pedantic-errors -std=c++11 -version -o /tmp/ccE6wwKW.s GNU C++11 (GCC) version 6.0.0 20150722 (experimental) (x86_64-unknown-linux-gnu) compiled by GNU C version 6.0.0 20150722 (experimental), GMP version 5.1.2, MPFR version 3.1.2, MPC version 1.0.1 warning: GMP header version 5.1.2 differs from library version 5.0.2. warning: MPFR header version 3.1.2 differs from library version 3.1.0-p3. GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu" ignoring nonexistent directory "/usr/local/gcc-head/lib/gcc/x86_64-unknown-linux-gnu/6.0.0/../../../../x86_64-unknown-linux-gnu/include" #include "..." search starts here: #include <...> search starts here: /usr/local/gcc-head/lib/gcc/x86_64-unknown-linux-gnu/6.0.0/../../../../include/c++/6.0.0 /usr/local/gcc-head/lib/gcc/x86_64-unknown-linux-gnu/6.0.0/../../../../include/c++/6.0.0/x86_64-unknown-linux-gnu /usr/local/gcc-head/lib/gcc/x86_64-unknown-linux-gnu/6.0.0/../../../../include/c++/6.0.0/backward /usr/local/gcc-head/lib/gcc/x86_64-unknown-linux-gnu/6.0.0/include /usr/local/include /usr/local/gcc-head/include /usr/local/gcc-head/lib/gcc/x86_64-unknown-linux-gnu/6.0.0/include-fixed /usr/include/x86_64-linux-gnu /usr/include End of search list. GNU C++11 (GCC) version 6.0.0 20150722 (experimental) (x86_64-unknown-linux-gnu) compiled by GNU C version 6.0.0 20150722 (experimental), GMP version 5.1.2, MPFR version 3.1.2, MPC version 1.0.1 warning: GMP header version 5.1.2 differs from library version 5.0.2. warning: MPFR header version 3.1.2 differs from library version 3.1.0-p3. GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 Compiler executable checksum: 9115218d8690e08d2bbd8844106c0d12 COLLECT_GCC_OPTIONS='-o' 'prog.exe' '-std=c++11' '-pedantic-errors' '-v' '-shared-libgcc' '-mtune=generic' '-march=x86-64' as -v --64 -o /tmp/cc8TSYhs.o /tmp/ccE6wwKW.s GNU assembler version 2.22 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.22 COMPILER_PATH=/usr/local/gcc-head/libexec/gcc/x86_64-unknown-linux-gnu/6.0.0/:/usr/local/gcc-head/libexec/gcc/x86_64-unknown-linux-gnu/6.0.0/:/usr/local/gcc-head/libexec/gcc/x86_64-unknown-linux-gnu/:/usr/local/gcc-head/lib/gcc/x86_64-unknown-linux-gnu/6.0.0/:/usr/local/gcc-head/lib/gcc/x86_64-unknown-linux-gnu/ LIBRARY_PATH=/usr/local/gcc-head/lib/gcc/x86_64-unknown-linux-gnu/6.0.0/:/usr/local/gcc-head/lib/gcc/x86_64-unknown-linux-gnu/6.0.0/../../../../lib64/:/lib/x86_64-linux-gnu/:/lib/../lib64/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib64/:/usr/local/gcc-head/lib/gcc/x86_64-unknown-linux-gnu/6.0.0/../../../:/lib/:/usr/lib/ COLLECT_GCC_OPTIONS='-o' 'prog.exe' '-std=c++11' '-pedantic-errors' '-v' '-shared-libgcc' '-mtune=generic' '-march=x86-64' /usr/local/gcc-head/libexec/gcc/x86_64-unknown-linux-gnu/6.0.0/collect2 -plugin /usr/local/gcc-head/libexec/gcc/x86_64-unknown-linux-gnu/6.0.0/liblto_plugin.so -plugin-opt=/usr/local/gcc-head/libexec/gcc/x86_64-unknown-linux-gnu/6.0.0/lto-wrapper -plugin-opt=-fresolution=/tmp/cc4yk1QX.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o prog.exe /usr/lib/x86_64-linux-gnu/crt1.o /usr/lib/x86_64-linux-gnu/crti.o /usr/local/gcc-head/lib/gcc/x86_64-unknown-linux-gnu/6.0.0/crtbegin.o -L/usr/local/gcc-head/lib/gcc/x86_64-unknown-linux-gnu/6.0.0 -L/usr/local/gcc-head/lib/gcc/x86_64-unknown-linux-gnu/6.0.0/../../../../lib64 -L/lib/x86_64-linux-gnu -L/lib/../lib64 -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib64 -L/usr/local/gcc-head/lib/gcc/x86_64-unknown-linux-gnu/6.0.0/../../.. -rpath /usr/local/gcc-head/lib64 -lpthread /tmp/cc8TSYhs.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/local/gcc-head/lib/gcc/x86_64-unknown-linux-gnu/6.0.0/crtend.o /usr/lib/x86_64-linux-gnu/crtn.o