From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 37B923858D35; Thu, 25 Jun 2020 07:22:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 37B923858D35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1593069746; bh=/hrT/lVWa0YWN6c+w610KaTdZtUgxoP6ckCc5n+AsgI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Xlz/bKjj+aoJm3+P8BqFM8/iOSRmLo1FKvKadnoyJJR19LvlznvPg74pJz5Tkbd09 QxryIaTu7YFH80n/L9x70KBln5mO+zlpldWRff7fgAtFfV6GP50versn4AoOJzNNS4 BYe1PjsnpOWGJlDu6pU/lPp+weV8DSVBdBX3+hHs= From: "dev-zero at gentoo dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug preprocessor/95889] corrupt size vs. prev_size and hang when using __has_include with -traditional-cpp Date: Thu, 25 Jun 2020 07:22:26 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: preprocessor X-Bugzilla-Version: 10.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: dev-zero at gentoo dot 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: 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-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jun 2020 07:22:26 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95889 --- Comment #1 from Tiziano M=C3=BCller --- Unfortunately `__has_include` is even being parsed (in traditional-cpp mode= ) if enclosed in a `if 0 ... endif`: ****snip**** #if 0 #if __has_include() #endif #endif ****snip**** which gives: ****snip**** # 32 "" 2 # 1 "test2.h" test2.h:3: error: missing '(' before "__has_include" operand 3 | #if __has_include() |=20 test2.h:3: error: operator "__has_include" requires a header-name *** Error in `/data/tiziano/cp2k/tools/toolchain/install/gcc-10.1.0/lib/gcc/x86_64-pc-li= nux-gnu/10.1.0/cc1': corrupted size vs. prev_size: 0x000000000249a7e0 *** test2.h:1: confused by earlier errors, bailing out ****snip**** while enclosing it in parenthesis at least fixes that, such that the follow= ing parses fine: ****snip**** #if 0 #if (__has_include()) #endif #endif ****snip****=