From patchwork Mon Mar 26 20:56:38 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Bosscher X-Patchwork-Id: 148834 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 7B3EDB6EEF for ; Tue, 27 Mar 2012 07:57:00 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1333400221; h=Comment: DomainKey-Signature:Received:Received:Received:Received: MIME-Version:Received:Received:Date:Message-ID:Subject:From:To: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=XD8Xrmx h386FUQdIt496VN8jkrY=; b=Gdplru6EzXhTF6B0JT2sr6R3xwGd8HSigpvFeVu pe532/R9poEtOEoSIhXAQJ8N9qDEbNUWJyqQdo92zMuGty54UQxwl2VP7wLNT/QQ tqePaC8ymhMwILHKypam4m9a6x1HRVxSguZUsTQ4xN2pVD31HpntG3KdlIrSh5JO BBzU= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:MIME-Version:Received:Received:Date:Message-ID:Subject:From:To:Content-Type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=cxH8l9G9SaHQpoDbznpGr9pM/yc7RgYE9d2+f8NJCdsQJGh4zQwJf3zzlCMPZ+ 2NucBoflUDOArQTxYJeU75x4J5/ONl3qCUF/R01ggDRs6dTTqZNKGguWc0iJxz7W DIPi7phbOntuhoWRYbf648JYIz2KxJLYzc/Du3MWJ6cOc=; Received: (qmail 22237 invoked by alias); 26 Mar 2012 20:56:58 -0000 Received: (qmail 22223 invoked by uid 22791); 26 Mar 2012 20:56:55 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-yx0-f175.google.com (HELO mail-yx0-f175.google.com) (209.85.213.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 26 Mar 2012 20:56:39 +0000 Received: by yenm3 with SMTP id m3so4450244yen.20 for ; Mon, 26 Mar 2012 13:56:39 -0700 (PDT) MIME-Version: 1.0 Received: by 10.236.200.197 with SMTP id z45mr23384372yhn.99.1332795399014; Mon, 26 Mar 2012 13:56:39 -0700 (PDT) Received: by 10.100.146.5 with HTTP; Mon, 26 Mar 2012 13:56:38 -0700 (PDT) Date: Mon, 26 Mar 2012 22:56:38 +0200 Message-ID: Subject: [patch][RFC] bail out after front-end errors From: Steven Bosscher To: GCC Mailing List , GCC Patches X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Hello, This patch is one way to address PR44982. I see no good reason to cgraph_finalize_compilation_unit if there were parse errors. As Richi already pointed out, GCC traditionally has proceeded after parse errors to preserve warnings and errors we generate from the middle-end and during semantic analysis. But it seems to me that those warnings are not very meaningful after parse errors (-Wuninitialized after a parse error??), and errors from the middle end are mostly for exotic code (involving asm()s and the like). Bailing out after parse errors is therefore IMHO the right thing to do for the common case. Thoughts? Comments? If the consensus is that this patch goes in, I'll also have to do some work on the test suite, because some warnings and errors disappear. List attached below. A lot of errors and warnings from g++ disappear. I suspect this is because they are only issued during gimplification. That is something I'll have to address before this patch could go in. Before I spend the effort, I'd like to know if there is consensus on the general direction proposed here... ;-) Ciao! Steven New failing tests: > FAIL: gcc.dg/asm-7.c (test for errors, line 15) > FAIL: gcc.dg/asm-7.c (test for errors, line 16) > FAIL: gcc.dg/declspec-10.c (test for warnings, line 19) > FAIL: gcc.dg/declspec-11.c (test for warnings, line 19) > FAIL: gcc.dg/declspec-9.c (test for errors, line 20) > FAIL: gcc.dg/gnu99-static-1.c (test for errors, line 21) > FAIL: gcc.dg/gnu99-static-1.c (test for errors, line 25) > FAIL: gcc.dg/pr48552-1.c (test for errors, line 16) > FAIL: gcc.dg/pr48552-1.c (test for errors, line 40) > FAIL: gcc.dg/pr48552-1.c (test for errors, line 52) > FAIL: gcc.dg/pr48552-2.c (test for errors, line 16) > FAIL: gcc.dg/pr48552-2.c (test for errors, line 40) > FAIL: gcc.dg/pr48552-2.c (test for errors, line 52) > FAIL: gcc.dg/redecl-10.c (test for warnings, line 15) > FAIL: gcc.dg/redecl-10.c (test for warnings, line 29) > FAIL: gcc.dg/gomp/block-2.c (test for errors, line 14) > FAIL: gcc.dg/gomp/block-2.c (test for errors, line 16) > FAIL: gcc.dg/gomp/block-7.c (test for errors, line 9) > FAIL: gcc.dg/gomp/block-7.c (test for errors, line 10) > FAIL: gcc.dg/gomp/block-7.c (test for errors, line 11) > FAIL: gcc.dg/gomp/block-7.c (test for errors, line 15) > FAIL: gcc.dg/gomp/block-7.c (test for errors, line 16) > FAIL: gcc.dg/gomp/block-7.c (test for errors, line 17) > FAIL: gcc.dg/gomp/pr27415.c (test for errors, line 9) > FAIL: gcc.dg/gomp/pr27415.c (test for errors, line 28) > FAIL: gcc.dg/gomp/pr27415.c (test for errors, line 37) > FAIL: c-c++-common/tm/safe-3.c (internal compiler error) > FAIL: c-c++-common/tm/safe-3.c (test for excess errors) > FAIL: gcc.dg/tm/pr52141.c (internal compiler error) > FAIL: gcc.dg/tm/pr52141.c (test for excess errors) > FAIL: g++.dg/cpp0x/constexpr-ex1.C (test for warnings, line 17) > FAIL: g++.dg/cpp0x/constexpr-function2.C (test for warnings, line 46) > FAIL: g++.dg/cpp0x/constexpr-neg1.C (test for warnings, line 5) > FAIL: g++.dg/cpp0x/lambda/lambda-ctor-neg.C (test for warnings, line 15) > FAIL: g++.dg/cpp0x/lambda/lambda-ctor-neg.C not an aggregate (test for errors, line 16) > FAIL: g++.dg/cpp0x/lambda/lambda-ctor-neg.C deleted default ctor (test for errors, line 17) > FAIL: g++.dg/cpp0x/lambda/lambda-ctor-neg.C deleted assignment op (test for errors, line 18) > FAIL: g++.dg/cpp0x/lambda/lambda-field-names.C no member named i (test for errors, line 11) > FAIL: g++.dg/cpp0x/noexcept15.C (test for errors, line 16) > FAIL: g++.dg/cpp0x/pr47416.C (test for errors, line 187) > FAIL: g++.dg/cpp0x/pr47416.C (test for warnings, line 213) > FAIL: g++.dg/cpp0x/pr47416.C (test for warnings, line 223) > FAIL: g++.dg/cpp0x/static_assert2.C (test for errors, line 14) > FAIL: g++.dg/cpp0x/union1.C (test for errors, line 17) > FAIL: g++.dg/cpp0x/union1.C (test for errors, line 18) > FAIL: g++.dg/cpp0x/union1.C (test for errors, line 28) > FAIL: g++.dg/cpp0x/union1.C (test for errors, line 29) > FAIL: g++.dg/cpp0x/vt-37737-2.C (test for warnings, line 4) > FAIL: g++.dg/cpp0x/vt-37737-2.C (test for errors, line 6) > FAIL: g++.dg/cpp0x/vt-37737-2.C candidate note (test for warnings, line 6) > FAIL: g++.dg/ext/case-range2.C -std=gnu++98 (test for errors, line 14) > FAIL: g++.dg/ext/case-range2.C -std=gnu++98 (test for errors, line 15) > FAIL: g++.dg/ext/case-range2.C -std=gnu++98 (test for warnings, line 25) > FAIL: g++.dg/ext/case-range2.C -std=gnu++11 (test for errors, line 14) > FAIL: g++.dg/ext/case-range2.C -std=gnu++11 (test for errors, line 15) > FAIL: g++.dg/ext/case-range2.C -std=gnu++11 (test for warnings, line 25) > FAIL: g++.dg/init/pr42844.C -std=c++98 (test for warnings, line 44) > FAIL: g++.dg/init/pr42844.C -std=c++98 (test for warnings, line 46) > FAIL: g++.dg/init/pr42844.C -std=c++98 (test for errors, line 51) > FAIL: g++.dg/init/pr42844.C -std=c++11 (test for warnings, line 44) > FAIL: g++.dg/init/pr42844.C -std=c++11 (test for warnings, line 46) > FAIL: g++.dg/init/pr42844.C -std=c++11 (test for errors, line 51) > FAIL: g++.dg/parse/template18.C -std=c++98 (test for errors, line 47) > FAIL: g++.dg/parse/template18.C -std=c++98 (test for warnings, line 52) > FAIL: g++.dg/parse/template18.C -std=c++11 (test for errors, line 47) > FAIL: g++.dg/parse/template18.C -std=c++11 (test for warnings, line 52) > FAIL: g++.dg/parse/typename7.C -std=c++98 (test for warnings, line 10) > FAIL: g++.dg/parse/typename7.C -std=c++98 (test for warnings, line 11) > FAIL: g++.dg/parse/typename7.C -std=c++98 candidate note (test for warnings, line 12) > FAIL: g++.dg/parse/typename7.C -std=c++98 candidate note (test for warnings, line 22) > FAIL: g++.dg/parse/typename7.C -std=c++11 (test for warnings, line 10) > FAIL: g++.dg/parse/typename7.C -std=c++11 (test for warnings, line 11) > FAIL: g++.dg/parse/typename7.C -std=c++11 candidate note (test for warnings, line 12) > FAIL: g++.dg/parse/typename7.C -std=c++11 candidate note (test for warnings, line 22) > FAIL: g++.dg/tc1/dr152.C -std=c++98 (test for warnings, line 22) > FAIL: g++.dg/tc1/dr152.C -std=c++98 (test for errors, line 27) > FAIL: g++.dg/tc1/dr152.C -std=c++98 matching (test for errors, line 33) > FAIL: g++.dg/tc1/dr152.C -std=c++98 candidate note (test for warnings, line 33) > FAIL: g++.dg/tc1/dr152.C -std=c++98 (test for warnings, line 37) > FAIL: g++.dg/tc1/dr152.C -std=c++11 (test for warnings, line 22) > FAIL: g++.dg/tc1/dr152.C -std=c++11 (test for errors, line 27) > FAIL: g++.dg/tc1/dr152.C -std=c++11 matching (test for errors, line 33) > FAIL: g++.dg/tc1/dr152.C -std=c++11 candidate note (test for warnings, line 33) > FAIL: g++.dg/tc1/dr152.C -std=c++11 (test for warnings, line 37) > FAIL: g++.dg/tc1/dr166.C -std=c++98 (test for errors, line 27) > FAIL: g++.dg/tc1/dr166.C -std=c++98 (test for warnings, line 35) > FAIL: g++.dg/tc1/dr166.C -std=c++98 (test for errors, line 44) > FAIL: g++.dg/tc1/dr166.C -std=c++98 (test for errors, line 45) > FAIL: g++.dg/tc1/dr166.C -std=c++11 (test for warnings, line 50) > FAIL: g++.dg/template/access2.C -std=c++98 (test for errors, line 8) > FAIL: g++.dg/template/access2.C -std=c++98 (test for errors, line 13) > FAIL: g++.dg/template/access2.C -std=c++98 (test for warnings, line 19) > FAIL: g++.dg/template/access2.C -std=c++11 (test for errors, line 8) > FAIL: g++.dg/template/access2.C -std=c++11 (test for errors, line 13) > FAIL: g++.dg/template/access2.C -std=c++11 (test for warnings, line 19) > FAIL: g++.dg/template/crash107.C -std=gnu++98 (test for warnings, line 13) > FAIL: g++.dg/template/crash107.C -std=gnu++98 (test for warnings, line 20) > FAIL: g++.dg/template/crash107.C -std=gnu++11 (test for warnings, line 13) > FAIL: g++.dg/template/crash107.C -std=gnu++11 (test for warnings, line 20) > FAIL: g++.dg/template/dependent-expr5.C -std=c++98 (test for errors, line 86) > FAIL: g++.dg/template/dependent-expr5.C -std=c++98 (test for errors, line 110) > FAIL: g++.dg/template/dependent-expr5.C -std=c++98 candidate note (test for warnings, line 110) > FAIL: g++.dg/template/dependent-expr5.C -std=c++98 (test for errors, line 112) > FAIL: g++.dg/template/dependent-expr5.C -std=c++98 candidate note (test for warnings, line 112) > FAIL: g++.dg/template/dependent-expr5.C -std=c++98 (test for errors, line 115) > FAIL: g++.dg/template/dependent-expr5.C -std=c++98 candidate note (test for warnings, line 115) > FAIL: g++.dg/template/dependent-expr5.C -std=c++98 (test for errors, line 123) > FAIL: g++.dg/template/dependent-expr5.C -std=c++98 candidate note (test for warnings, line 123) > FAIL: g++.dg/template/dependent-expr5.C -std=c++11 (test for errors, line 110) > FAIL: g++.dg/template/dependent-expr5.C -std=c++11 candidate note (test for warnings, line 110) > FAIL: g++.dg/template/dependent-expr5.C -std=c++11 (test for errors, line 112) > FAIL: g++.dg/template/dependent-expr5.C -std=c++11 candidate note (test for warnings, line 112) > FAIL: g++.dg/template/dependent-expr5.C -std=c++11 (test for errors, line 115) > FAIL: g++.dg/template/dependent-expr5.C -std=c++11 candidate note (test for warnings, line 115) > FAIL: g++.dg/template/dependent-expr5.C -std=c++11 (test for errors, line 123) > FAIL: g++.dg/template/dependent-expr5.C -std=c++11 candidate note (test for warnings, line 123) > FAIL: g++.dg/template/error15.C -std=c++98 (test for errors, line 21) > FAIL: g++.dg/template/error15.C -std=c++11 (test for errors, line 21) > FAIL: g++.dg/template/error43.C -std=c++98 (test for warnings, line 9) > FAIL: g++.dg/template/error43.C -std=c++11 (test for warnings, line 9) > FAIL: g++.dg/template/friend31.C -std=c++98 (test for errors, line 13) > FAIL: g++.dg/template/friend31.C -std=c++98 (test for errors, line 18) > FAIL: g++.dg/template/friend31.C -std=c++11 (test for errors, line 13) > FAIL: g++.dg/template/friend31.C -std=c++11 (test for errors, line 18) > FAIL: g++.dg/template/instantiate3.C -std=c++98 (test for errors, line 13) > FAIL: g++.dg/template/instantiate3.C -std=c++11 (test for errors, line 13) > FAIL: g++.dg/template/memfriend7.C -std=c++98 (test for errors, line 39) > FAIL: g++.dg/template/memfriend7.C -std=c++98 (test for errors, line 45) > FAIL: g++.dg/template/memfriend7.C -std=c++98 (test for errors, line 51) > FAIL: g++.dg/template/memfriend7.C -std=c++98 (test for errors, line 57) > FAIL: g++.dg/template/memfriend7.C -std=c++98 (test for errors, line 63) > FAIL: g++.dg/template/memfriend7.C -std=c++98 (test for errors, line 83) > FAIL: g++.dg/template/memfriend7.C -std=c++11 (test for errors, line 107) > FAIL: g++.dg/template/memfriend7.C -std=c++11 (test for warnings, line 119) > FAIL: g++.dg/template/memfriend7.C -std=c++11 (test for warnings, line 120) > FAIL: g++.dg/template/memfriend7.C -std=c++11 (test for warnings, line 121) > FAIL: g++.dg/template/memfriend7.C -std=c++11 (test for warnings, line 122) > FAIL: g++.dg/template/memfriend7.C -std=c++11 (test for warnings, line 123) > FAIL: g++.dg/template/memfriend7.C -std=c++11 (test for warnings, line 124) > FAIL: g++.dg/template/memfriend7.C -std=c++11 (test for warnings, line 127) > FAIL: g++.dg/template/memfriend7.C -std=c++11 (test for warnings, line 131) > FAIL: g++.dg/template/nontype12.C -std=c++98 (test for errors, line 27) > FAIL: g++.dg/template/nontype12.C -std=c++98 (test for warnings, line 30) > FAIL: g++.dg/template/nontype12.C -std=c++98 (test for warnings, line 34) > FAIL: g++.dg/template/nontype12.C -std=c++11 (test for errors, line 27) > FAIL: g++.dg/template/nontype12.C -std=c++11 (test for warnings, line 30) > FAIL: g++.dg/template/nontype12.C -std=c++11 (test for warnings, line 34) > FAIL: g++.dg/template/pseudodtor3.C -std=c++98 (test for errors, line 14) > FAIL: g++.dg/template/pseudodtor3.C -std=c++98 (test for errors, line 22) > FAIL: g++.dg/template/pseudodtor3.C -std=c++98 (test for errors, line 31) > FAIL: g++.dg/template/pseudodtor3.C -std=c++98 (test for errors, line 40) > FAIL: g++.dg/template/pseudodtor3.C -std=c++11 (test for errors, line 14) > FAIL: g++.dg/template/pseudodtor3.C -std=c++11 (test for errors, line 22) > FAIL: g++.dg/template/pseudodtor3.C -std=c++11 (test for errors, line 31) > FAIL: g++.dg/template/pseudodtor3.C -std=c++11 (test for errors, line 40) > FAIL: g++.dg/template/using16.C -std=c++98 (test for errors, line 14) > FAIL: g++.dg/template/using16.C -std=c++98 (test for errors, line 25) > FAIL: g++.dg/template/using16.C -std=c++98 (test for warnings, line 29) > FAIL: g++.dg/template/using16.C -std=c++11 (test for errors, line 14) > FAIL: g++.dg/template/using16.C -std=c++11 (test for errors, line 25) > FAIL: g++.dg/template/using16.C -std=c++11 (test for warnings, line 29) > FAIL: g++.dg/template/virtual3.C -std=c++98 (test for errors, line 8) > FAIL: g++.dg/gomp/block-1.C -std=c++98 (test for warnings, line 7) > FAIL: g++.dg/gomp/block-1.C -std=c++98 (test for warnings, line 9) > FAIL: g++.dg/gomp/block-1.C -std=c++11 (test for warnings, line 7) > FAIL: g++.dg/gomp/block-1.C -std=c++11 (test for warnings, line 9) > FAIL: g++.dg/gomp/block-2.C -std=c++98 (test for warnings, line 14) > FAIL: g++.dg/gomp/block-2.C -std=c++98 (test for warnings, line 16) > FAIL: g++.dg/gomp/block-2.C -std=c++11 (test for warnings, line 14) > FAIL: g++.dg/gomp/block-2.C -std=c++11 (test for warnings, line 16) > FAIL: g++.dg/gomp/block-3.C -std=c++98 (test for warnings, line 21) > FAIL: g++.dg/gomp/block-3.C -std=c++98 (test for warnings, line 26) > FAIL: g++.dg/gomp/block-3.C -std=c++98 (test for warnings, line 30) > FAIL: g++.dg/gomp/block-3.C -std=c++11 (test for warnings, line 21) > FAIL: g++.dg/gomp/block-3.C -std=c++11 (test for warnings, line 26) > FAIL: g++.dg/gomp/block-3.C -std=c++11 (test for warnings, line 30) > FAIL: g++.dg/gomp/block-5.C -std=c++98 (test for warnings, line 7) > FAIL: g++.dg/gomp/block-5.C -std=c++11 (test for warnings, line 7) > FAIL: g++.dg/gomp/for-19.C -std=gnu++98 (test for errors, line 11) > FAIL: g++.dg/gomp/for-19.C -std=gnu++98 (test for errors, line 29) > FAIL: g++.dg/gomp/for-19.C -std=gnu++98 (test for warnings, line 37) > FAIL: g++.dg/gomp/for-19.C -std=gnu++98 (test for warnings, line 40) > FAIL: g++.dg/gomp/for-19.C -std=gnu++11 (test for errors, line 11) > FAIL: g++.dg/gomp/for-19.C -std=gnu++11 (test for errors, line 29) > FAIL: g++.dg/gomp/for-19.C -std=gnu++11 (test for warnings, line 37) > FAIL: g++.dg/gomp/for-19.C -std=gnu++11 (test for warnings, line 40) > FAIL: g++.dg/gomp/pr27415.C -std=c++98 (test for errors, line 9) > FAIL: g++.dg/gomp/pr27415.C -std=c++98 (test for errors, line 28) > FAIL: g++.dg/gomp/pr27415.C -std=c++98 (test for errors, line 38) > FAIL: g++.dg/gomp/pr27415.C -std=c++11 (test for errors, line 9) > FAIL: g++.dg/gomp/pr27415.C -std=c++11 (test for errors, line 28) > FAIL: g++.dg/gomp/pr27415.C -std=c++11 (test for errors, line 38) > FAIL: c-c++-common/tm/safe-3.c -std=gnu++98 (internal compiler error) > FAIL: c-c++-common/tm/safe-3.c -std=gnu++98 (test for excess errors) > FAIL: c-c++-common/tm/safe-3.c -std=gnu++11 (internal compiler error) > FAIL: c-c++-common/tm/safe-3.c -std=gnu++11 (test for excess errors) > FAIL: g++.dg/tm/noexcept-2.C (test for errors, line 7) > FAIL: g++.dg/tm/noexcept-2.C (test for errors, line 8) > FAIL: g++.old-deja/g++.eh/spec6.C -std=c++98 (test for errors, line 24) > FAIL: g++.old-deja/g++.eh/spec6.C -std=c++98 (test for warnings, line 28) > FAIL: g++.old-deja/g++.eh/spec6.C -std=c++11 (test for errors, line 24) > FAIL: g++.old-deja/g++.eh/spec6.C -std=c++11 (test for warnings, line 28) > FAIL: g++.old-deja/g++.jason/report.C -std=gnu++98 (test for warnings, line 36) > FAIL: g++.old-deja/g++.jason/report.C -std=gnu++98 (test for warnings, line 65) > FAIL: g++.old-deja/g++.jason/report.C -std=gnu++11 (test for warnings, line 36) > FAIL: g++.old-deja/g++.jason/report.C -std=gnu++11 (test for warnings, line 65) > FAIL: g++.old-deja/g++.mike/net31.C -std=c++98 (test for errors, line 43) > FAIL: g++.old-deja/g++.mike/net31.C -std=c++11 (test for errors, line 43) > FAIL: g++.old-deja/g++.niklas/t135.C -std=c++98 (test for errors, line 11) > FAIL: g++.old-deja/g++.niklas/t135.C -std=c++98 (test for errors, line 19) > FAIL: g++.old-deja/g++.niklas/t135.C -std=c++11 (test for errors, line 11) > FAIL: g++.old-deja/g++.niklas/t135.C -std=c++11 (test for errors, line 19) > FAIL: g++.old-deja/g++.oliva/delete1.C -std=c++98 (test for warnings, line 31) > FAIL: g++.old-deja/g++.other/friend1.C -std=c++98 (test for errors, line 63) > FAIL: g++.old-deja/g++.other/friend1.C -std=c++98 (test for errors, line 82) > FAIL: g++.old-deja/g++.other/friend1.C -std=c++11 (test for errors, line 63) > FAIL: g++.old-deja/g++.other/friend1.C -std=c++11 (test for errors, line 82) > FAIL: g++.old-deja/g++.other/friend4.C -std=c++98 (test for errors, line 13) > FAIL: g++.old-deja/g++.other/friend4.C -std=c++98 (test for errors, line 17) > FAIL: g++.old-deja/g++.other/friend4.C -std=c++98 (test for errors, line 18) > FAIL: g++.old-deja/g++.other/friend4.C -std=c++11 (test for errors, line 13) > FAIL: g++.old-deja/g++.other/friend4.C -std=c++11 (test for errors, line 17) > FAIL: g++.old-deja/g++.other/friend4.C -std=c++11 (test for errors, line 18) > FAIL: g++.old-deja/g++.other/lineno1.C -std=gnu++98 (test for errors, line 9) > FAIL: g++.old-deja/g++.other/lineno1.C -std=gnu++11 (test for errors, line 9) > FAIL: g++.old-deja/g++.other/vaarg3.C -std=gnu++98 (test for warnings, line 24) > FAIL: g++.old-deja/g++.other/vaarg3.C -std=gnu++98 pass (test for warnings, line 24) > FAIL: g++.old-deja/g++.other/vaarg3.C -std=gnu++98 abort (test for warnings, line 24) > FAIL: g++.old-deja/g++.other/vaarg3.C -std=gnu++98 (test for warnings, line 28) > FAIL: g++.old-deja/g++.other/vaarg3.C -std=gnu++98 abort (test for warnings, line 28) > FAIL: g++.old-deja/g++.other/vaarg3.C -std=gnu++98 promote (test for warnings, line 30) > FAIL: g++.old-deja/g++.other/vaarg3.C -std=gnu++98 abort (test for warnings, line 30) > FAIL: g++.old-deja/g++.other/vaarg3.C -std=gnu++11 (test for warnings, line 24) > FAIL: g++.old-deja/g++.other/vaarg3.C -std=gnu++11 pass (test for warnings, line 24) > FAIL: g++.old-deja/g++.other/vaarg3.C -std=gnu++11 abort (test for warnings, line 24) > FAIL: g++.old-deja/g++.other/vaarg3.C -std=gnu++11 (test for warnings, line 28) > FAIL: g++.old-deja/g++.other/vaarg3.C -std=gnu++11 abort (test for warnings, line 28) > FAIL: g++.old-deja/g++.other/vaarg3.C -std=gnu++11 promote (test for warnings, line 30) > FAIL: g++.old-deja/g++.other/vaarg3.C -std=gnu++11 abort (test for warnings, line 30) > FAIL: g++.old-deja/g++.pt/crash36.C -std=c++98 (test for errors, line 6) > FAIL: g++.old-deja/g++.pt/crash36.C -std=c++98 (test for warnings, line 16) > FAIL: g++.old-deja/g++.pt/crash36.C -std=c++11 (test for errors, line 6) > FAIL: g++.old-deja/g++.pt/crash36.C -std=c++11 (test for warnings, line 16) > FAIL: g++.old-deja/g++.pt/explicit70.C -std=c++98 no def (test for errors, line 43) > FAIL: g++.old-deja/g++.pt/explicit70.C -std=c++98 inst (test for warnings, line 43) > FAIL: g++.old-deja/g++.pt/explicit70.C -std=c++11 no def (test for errors, line 43) > FAIL: g++.old-deja/g++.pt/explicit70.C -std=c++11 inst (test for warnings, line 43) > FAIL: g++.old-deja/g++.pt/instantiate8.C -std=c++98 (test for errors, line 36) > FAIL: g++.old-deja/g++.pt/instantiate8.C -std=c++11 (test for errors, line 36) > FAIL: g++.old-deja/g++.pt/vaarg3.C -std=c++98 (test for errors, line 17) > FAIL: g++.old-deja/g++.pt/vaarg3.C -std=c++98 inst (test for warnings, line 24) > FAIL: g++.old-deja/g++.pt/vaarg3.C -std=c++11 (test for errors, line 17) > FAIL: g++.old-deja/g++.pt/vaarg3.C -std=c++11 inst (test for warnings, line 24) > FAIL: g++.old-deja/g++.robertl/eb109.C -std=c++98 (test for errors, line 45) > FAIL: g++.old-deja/g++.robertl/eb109.C -std=c++98 (test for errors, line 47) > FAIL: g++.old-deja/g++.robertl/eb109.C -std=c++98 (test for errors, line 51) > FAIL: g++.old-deja/g++.robertl/eb109.C -std=c++98 (test for errors, line 52) > FAIL: g++.old-deja/g++.robertl/eb109.C -std=c++98 (test for errors, line 56) > FAIL: g++.old-deja/g++.robertl/eb109.C -std=c++11 (test for errors, line 45) > FAIL: g++.old-deja/g++.robertl/eb109.C -std=c++11 (test for errors, line 47) > FAIL: g++.old-deja/g++.robertl/eb109.C -std=c++11 (test for errors, line 51) > FAIL: g++.old-deja/g++.robertl/eb109.C -std=c++11 (test for errors, line 52) > FAIL: g++.old-deja/g++.robertl/eb109.C -std=c++11 (test for errors, line 56) > FAIL: objc.dg/property/dotsyntax-17.m -fgnu-runtime (test for errors, line 56) > FAIL: g++.old-deja/g++.other/vaarg3.C -std=gnu++98 (test for warnings, line 24) > FAIL: g++.old-deja/g++.other/vaarg3.C -std=gnu++98 pass (test for warnings, line 24) > FAIL: g++.old-deja/g++.other/vaarg3.C -std=gnu++98 abort (test for warnings, line 24) > FAIL: g++.old-deja/g++.other/vaarg3.C -std=gnu++98 (test for warnings, line 28) > FAIL: g++.old-deja/g++.other/vaarg3.C -std=gnu++98 abort (test for warnings, line 28) > FAIL: g++.old-deja/g++.other/vaarg3.C -std=gnu++98 promote (test for warnings, line 30) > FAIL: g++.old-deja/g++.other/vaarg3.C -std=gnu++98 abort (test for warnings, line 30) > FAIL: g++.old-deja/g++.other/vaarg3.C -std=gnu++11 (test for warnings, line 24) > FAIL: g++.old-deja/g++.other/vaarg3.C -std=gnu++11 pass (test for warnings, line 24) > FAIL: g++.old-deja/g++.other/vaarg3.C -std=gnu++11 abort (test for warnings, line 24) > FAIL: g++.old-deja/g++.other/vaarg3.C -std=gnu++11 (test for warnings, line 28) > FAIL: g++.old-deja/g++.other/vaarg3.C -std=gnu++11 abort (test for warnings, line 28) > FAIL: g++.old-deja/g++.other/vaarg3.C -std=gnu++11 promote (test for warnings, line 30) > FAIL: g++.old-deja/g++.other/vaarg3.C -std=gnu++11 abort (test for warnings, line 30) > FAIL: g++.old-deja/g++.pt/crash36.C -std=c++98 (test for errors, line 6) > FAIL: g++.old-deja/g++.pt/crash36.C -std=c++98 (test for warnings, line 16) > FAIL: g++.old-deja/g++.pt/crash36.C -std=c++11 (test for errors, line 6) > FAIL: g++.old-deja/g++.pt/crash36.C -std=c++11 (test for warnings, line 16) > FAIL: g++.old-deja/g++.pt/explicit70.C -std=c++98 no def (test for errors, line 43) > FAIL: g++.old-deja/g++.pt/explicit70.C -std=c++98 inst (test for warnings, line 43) > FAIL: g++.old-deja/g++.pt/explicit70.C -std=c++11 no def (test for errors, line 43) > FAIL: g++.old-deja/g++.pt/explicit70.C -std=c++11 inst (test for warnings, line 43) > FAIL: g++.old-deja/g++.pt/instantiate8.C -std=c++98 (test for errors, line 36) > FAIL: g++.old-deja/g++.pt/instantiate8.C -std=c++11 (test for errors, line 36) > FAIL: g++.old-deja/g++.pt/vaarg3.C -std=c++98 (test for errors, line 17) > FAIL: g++.old-deja/g++.pt/vaarg3.C -std=c++98 inst (test for warnings, line 24) > FAIL: g++.old-deja/g++.pt/vaarg3.C -std=c++11 (test for errors, line 17) > FAIL: g++.old-deja/g++.pt/vaarg3.C -std=c++11 inst (test for warnings, line 24) > FAIL: g++.old-deja/g++.robertl/eb109.C -std=c++98 (test for errors, line 45) > FAIL: g++.old-deja/g++.robertl/eb109.C -std=c++98 (test for errors, line 47) > FAIL: g++.old-deja/g++.robertl/eb109.C -std=c++98 (test for errors, line 51) > FAIL: g++.old-deja/g++.robertl/eb109.C -std=c++98 (test for errors, line 52) > FAIL: g++.old-deja/g++.robertl/eb109.C -std=c++98 (test for errors, line 56) > FAIL: g++.old-deja/g++.robertl/eb109.C -std=c++11 (test for errors, line 45) > FAIL: g++.old-deja/g++.robertl/eb109.C -std=c++11 (test for errors, line 47) > FAIL: g++.old-deja/g++.robertl/eb109.C -std=c++11 (test for errors, line 51) > FAIL: g++.old-deja/g++.robertl/eb109.C -std=c++11 (test for errors, line 52) > FAIL: g++.old-deja/g++.robertl/eb109.C -std=c++11 (test for errors, line 56) > FAIL: objc.dg/property/dotsyntax-17.m -fgnu-runtime (test for errors, line 56) > FAIL: objc.dg/property/dotsyntax-17.m -fgnu-runtime (test for errors, line 58) > FAIL: objc.dg/property/dotsyntax-17.m -fgnu-runtime (test for errors, line 60) > FAIL: objc.dg/property/dotsyntax-17.m -fgnu-runtime (test for errors, line 62) > FAIL: 20_util/unique_ptr/cons/ptr_deleter_neg.cc (test for errors, line 37) > FAIL: 20_util/unique_ptr/cons/ptr_deleter_neg.cc (test for errors, line 47) Index: toplev.c =================================================================== --- toplev.c (revision 185813) +++ toplev.c (working copy) @@ -561,9 +561,14 @@ compile_file (void) /* Compilation is now finished except for writing what's left of the symbol table output. */ - if (flag_syntax_only || flag_wpa) + /* If all we have to do is syntax checking, or if there were parse + errors, stop here. */ + if (flag_syntax_only || seen_error ()) return; + if (flag_wpa) + return; + timevar_start (TV_PHASE_GENERATE); ggc_protect_identifiers = false; @@ -571,12 +576,6 @@ compile_file (void) /* This must also call cgraph_finalize_compilation_unit. */ lang_hooks.decls.final_write_globals (); - if (seen_error ()) - { - timevar_stop (TV_PHASE_GENERATE); - return; - } - /* Compilation unit is finalized. When producing non-fat LTO object, we are basically finished. */ if (in_lto_p || !flag_lto || flag_fat_lto_objects)