From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 84849 invoked by alias); 28 Aug 2015 16:21:19 -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 84800 invoked by uid 48); 28 Aug 2015 16:21:15 -0000 From: "msebor at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/67386] New: missing diagnostic on a use of an undeclared function Date: Fri, 28 Aug 2015 16:21: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: 5.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: msebor 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: 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: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-08/txt/msg01956.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D67386 Bug ID: 67386 Summary: missing diagnostic on a use of an undeclared function Product: gcc Version: 5.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: msebor at gcc dot gnu.org Target Milestone: --- GCC isn't completely consistent in diagnosing references to undeclared functions. In the test case below, it issues an error for only the last th= ree out of the four definitions of foo. It issues a warning for the first one, even though it too references an undeclared identifier. Versions prior to 5.1 diagnosed only the second and fourth forms. $ (set -x && cat t.c && for i in 1 2 3 4; do ~/bin/gcc-5.1.0/bin/gcc -DFOO= =3D$i -c t.c; done) + cat t.c #if FOO =3D=3D 1 void* foo (int i) { return i ? foobar (i) : foobar; } #elif FOO =3D=3D 2 void* foo (int i) { return i ? 0 : foobar; } #elif FOO =3D=3D 3 void* foo (int i) { if (i) return foobar (i); else return foobar; } #else void* foo (int i) { if (i) return 0; else return foobar; } #endif + for i in 1 2 3 4 + /home/msebor/bin/gcc-5.1.0/bin/gcc -DFOO=3D1 -c t.c t.c: In function =E2=80=98foo=E2=80=99: t.c:3:16: warning: implicit declaration of function =E2=80=98foobar=E2=80=99 [-Wimplicit-function-declaration] return i ? foobar (i) : foobar; ^ t.c:3:27: warning: pointer/integer type mismatch in conditional expression return i ? foobar (i) : foobar; ^ + for i in 1 2 3 4 + /home/msebor/bin/gcc-5.1.0/bin/gcc -DFOO=3D2 -c t.c t.c: In function =E2=80=98foo=E2=80=99: t.c:7:20: error: =E2=80=98foobar=E2=80=99 undeclared (first use in this fun= ction) return i ? 0 : foobar; ^ t.c:7:20: note: each undeclared identifier is reported only once for each function it appears in + for i in 1 2 3 4 + /home/msebor/bin/gcc-5.1.0/bin/gcc -DFOO=3D3 -c t.c t.c: In function =E2=80=98foo=E2=80=99: t.c:12:16: warning: implicit declaration of function =E2=80=98foobar=E2=80= =99 [-Wimplicit-function-declaration] return foobar (i); ^ t.c:12:16: warning: return makes pointer from integer without a cast [-Wint-conversion] t.c:14:16: error: =E2=80=98foobar=E2=80=99 undeclared (first use in this fu= nction) return foobar; ^ t.c:14:16: note: each undeclared identifier is reported only once for each function it appears in + for i in 1 2 3 4 + /home/msebor/bin/gcc-5.1.0/bin/gcc -DFOO=3D4 -c t.c t.c: In function =E2=80=98foo=E2=80=99: t.c:21:16: error: =E2=80=98foobar=E2=80=99 undeclared (first use in this fu= nction) return foobar; ^ t.c:21:16: note: each undeclared identifier is reported only once for each function it appears in >>From gcc-bugs-return-495815-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Aug 28 16:23:50 2015 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 89777 invoked by alias); 28 Aug 2015 16:23:50 -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 89686 invoked by uid 55); 28 Aug 2015 16:23:46 -0000 From: "law at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug lto/66752] spec2000 255.vortex performance compiled with GCC is ~20% lower than with CLANG Date: Fri, 28 Aug 2015 16:23:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: lto X-Bugzilla-Version: 6.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: law at gcc dot gnu.org X-Bugzilla-Status: REOPENED 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: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-08/txt/msg01957.txt.bz2 Content-length: 1284 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66752 --- Comment #18 from Jeffrey A. Law --- Author: law Date: Fri Aug 28 16:23:12 2015 New Revision: 227307 URL: https://gcc.gnu.org/viewcvs?rev=227307&root=gcc&view=rev Log: [PATCH][lto/66752] Fix missed FSM jump thread PR lto/66752 * tree-ssa-threadedge.c (simplify_conrol_stmt_condition): If we are unable to find X NE 0 in the tables, return X as the simplified condition. (fsm_find_control_statement_thread_paths): If nodes in NEXT_PATH are in VISISTED_BBS, then return failure. Else add nodes from NEXT_PATH to VISISTED_BBS. * tree-ssa-threadupdate.c (duplicate_thread_path): Fix up edge flags after removing the control flow statement and unnecessary edges. PR lto/66752 * gcc.dg/tree-ssa/pr66752-2.c: New test. * gcc.dg/torture/pr66752-1.c: New test * g++.dg/torture/pr66752-2.C: New test. Added: trunk/gcc/testsuite/g++.dg/torture/pr66752-2.C trunk/gcc/testsuite/gcc.dg/torture/pr66752-1.c trunk/gcc/testsuite/gcc.dg/tree-ssa/pr66752-3.c Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-ssa-threadedge.c trunk/gcc/tree-ssa-threadupdate.c