This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Fix PR c++/28343: ICE with invalid asm specifier for struct member


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]