From patchwork Thu Jan 28 14:32:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 574751 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 79476140BCE for ; Fri, 29 Jan 2016 01:32:56 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=npTlqEuQ; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:reply-to:mime-version :content-type; q=dns; s=default; b=BtOXjarf61vOXljj/HypnaKi/F2Zt 9tW0cxWH/RuT2dokcAz1NnF74S/fTkLqd9MCkGwWNwqWKphYKJosmvndwTt9TR+f qK3f5D6f2Zp4nK+OkYfY64ZrcC9YQRTrgE4mNiYGPLSPt5swGQSpxYdF9QnJ1UpQ pl1b94jFijs7BA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:reply-to:mime-version :content-type; s=default; bh=qDPqiuuzIG0xEYXvxI+6pEizziE=; b=npT lqEuQugMZbA10MZYprTLfGuAbqL4ZdUddAHhY9YONY20eiHGR9Ja0MxkBeJkqNqJ Ly8/EY0CqYXeib4Qntvmmn5DVtRZkM0I5n+fsjAESplOMug5iPMqvbP69cAQWkES Zr0wwN7sYkwKglbCGYD5wGUrmhwAsSm4x120JukI= Received: (qmail 76404 invoked by alias); 28 Jan 2016 14:32:48 -0000 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 Received: (qmail 76393 invoked by uid 89); 28 Jan 2016 14:32:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=solely X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 28 Jan 2016 14:32:46 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 9961C33FF02; Thu, 28 Jan 2016 14:32:45 +0000 (UTC) Received: from tucnak.zalov.cz ([10.3.113.11]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u0SEWhCU006385 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 28 Jan 2016 09:32:44 -0500 Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id u0SEWfnR014666; Thu, 28 Jan 2016 15:32:42 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id u0SEWdjV014665; Thu, 28 Jan 2016 15:32:39 +0100 Date: Thu, 28 Jan 2016 15:32:39 +0100 From: Jakub Jelinek To: "Joseph S. Myers" , Marek Polacek , Dodji Seketeli Cc: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix PCH on systems where stdc-predef.h includes other headers (PR pch/68176) Message-ID: <20160128143239.GA3017@tucnak.redhat.com> Reply-To: Jakub Jelinek MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-IsSubscribed: yes Hi! As mentioned in the PR, most of the pch tests fail if stdc-predef.h header includes other headers. I don't have such a system, but changed my stdc-predef.h to include a dummy header bits/predef.h and this patch fixes all the tests that failed because of that. AFAIK file->implicit_preinclude flag is used solely for the PCH purposes, and this patch makes sure that headers included from implicit_preinclude headers are also implicit_preinclude. Bootstrapped/regtested on x86_64-linux, ok for trunk? 2016-01-28 Jakub Jelinek PR pch/68176 * files.c (_cpp_find_file): Set file->implicit_preinclude even if included from file->implicit_preinclude header. Jakub --- libcpp/files.c.jj 2016-01-08 07:42:49.000000000 +0100 +++ libcpp/files.c 2016-01-28 09:53:06.569750380 +0100 @@ -522,7 +522,10 @@ _cpp_find_file (cpp_reader *pfile, const return entry->u.file; file = make_cpp_file (pfile, start_dir, fname); - file->implicit_preinclude = implicit_preinclude; + file->implicit_preinclude + = (implicit_preinclude + || (pfile->buffer + && pfile->buffer->file->implicit_preinclude)); /* Try each path in the include chain. */ for (; !fake ;)