This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Fix PR c++/28343: ICE with invalid asm specifier for struct member
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Volker Reichelt <reichelt at igpm dot rwth-aachen dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 13 Jul 2006 11:31:56 -0700
- Subject: Re: [patch] Fix PR c++/28343: ICE with invalid asm specifier for struct member
- References: <tkrat.d50737ba4949ff88@igpm.rwth-aachen.de>
Volker Reichelt wrote:
> The following invalid code triggers an ICE since GCC 4.0.0:
>
> struct A
> {
> static int i __asm__(int);
> };
>
> bug.cc:3: error: expected string-literal before 'int'
> bug.cc:3: error: expected `(' before 'int'
> bug.cc:3: internal compiler error: tree check: expected string_cst, have error_mark in grokfield, at cp/decl2.c:841
> Please submit a full bug report, [etc.]
>
> This is because the frontend tries to extract the asmspec string from
> asmspec_tree using TREE_STRING_POINTER. However, this macro cannot handle
> error_mark_nodes and we get an ICE.
> The patch fixes the ICE by not trying to extract a string from an
> error_mark_node. asmspec remains NULL in this case.
>
> Bootstrapped and regtested on x86_64-unknown-linux-gnu.
> Ok for mainline, 4.1 branch, and 4.0 branch?
Yes, thanks.
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713