aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-parser.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2009-02-03 18:26:28 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2009-02-03 18:26:28 +0100
commit754ccf7c7c9db6326708936242365c2df354ffae (patch)
treeb0a7814cdb76726cd1bc60f57e9f3dcfc99dd568 /gcc/c-parser.c
parenta36c33ebfc595336528780a71a2897d2b8dbdb94 (diff)
downloadgcc-754ccf7c7c9db6326708936242365c2df354ffae.zip
gcc-754ccf7c7c9db6326708936242365c2df354ffae.tar.gz
gcc-754ccf7c7c9db6326708936242365c2df354ffae.tar.bz2
re PR inline-asm/39059 (ICE with fixed-point type in inline-asm)
PR inline-asm/39059 * c-parser.c (c_parser_postfix_expression): If fixed point is not supported, don't accept FIXED_CSTs. * c-decl.c (finish_declspecs): Error if fixed point is not supported and _Sat is used without _Fract/_Accum. Set specs->type to integer_type_node for cts_fract/cts_accum if fixed point is not supported. * parser.c (cp_parser_primary_expression): Reject FIXED_CSTs. * gcc.dg/nofixed-point-2.c: New test. * g++.dg/ext/fixed1.C: Adjust expected diagnostics. * g++.dg/ext/fixed2.C: Likewise. * g++.dg/other/error25.C: Likewise. * g++.dg/lookup/crash7.C: Likewise. * g++.dg/cpp0x/decltype-38655.C: Likewise. From-SVN: r143900
Diffstat (limited to 'gcc/c-parser.c')
-rw-r--r--gcc/c-parser.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/c-parser.c b/gcc/c-parser.c
index 5cb1982..8844769 100644
--- a/gcc/c-parser.c
+++ b/gcc/c-parser.c
@@ -5089,6 +5089,17 @@ c_parser_postfix_expression (c_parser *parser)
switch (c_parser_peek_token (parser)->type)
{
case CPP_NUMBER:
+ expr.value = c_parser_peek_token (parser)->value;
+ expr.original_code = ERROR_MARK;
+ loc = c_parser_peek_token (parser)->location;
+ c_parser_consume_token (parser);
+ if (TREE_CODE (expr.value) == FIXED_CST
+ && !targetm.fixed_point_supported_p ())
+ {
+ error_at (loc, "fixed-point types not supported for this target");
+ expr.value = error_mark_node;
+ }
+ break;
case CPP_CHAR:
case CPP_CHAR16:
case CPP_CHAR32: