This is the mail archive of the 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]

[c++ patch] Fix PRs 30849/30850/30851


These three bugs are to do with inline ASM statements containing
invalid inputs/outputs that trigger ICEs in various part of the
compiler not prepared to handle error_mark_nodes. Since all of these
bugs are very similiar in nature and the proposed fixes is both small
and touches the same piece of code, I have grouped them all together
rather than break them up into separate patches.

The attached patch catches these invalid statements in the parser by
adding two checks to cp_parser_asm_definition for the parsing of
inputs and outputs. In each case it looks to see if the parsed
statement was invalid, in which case an error will already have been
issued to that effect and discards those statements found to be
invalid. This approach seemed cleaner to me than adding in checks for
error_mark_nodes to the affected places but I can test a patch to do
that if it's deemed a better aproach.

Bootstrapped and regression tested on i686-pc-linux-gnu with no new
regressions. Ok for mainline and release branches?



	PR c++/30849
	PR c++/30850
	PR c++/30851
	* parser.c (cp_parser_asm_definition): Detect and discard asm
	statements with invalid inputs or outputs.

	PR c++/30849
	* g++.dg/parse/asm1.C: New test.

	PR c++/30850
	* g++.dg/parse/asm2.C: Likewise.

	PR c++/30851
	* g++.dg/parse/asm3.C: Likewise.

Attachment: patch.txt
Description: Text document

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