aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-decl.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-decl.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-decl.c')
-rw-r--r--gcc/c-decl.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index 9f65af4..262d9d9 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -7772,6 +7772,8 @@ finish_declspecs (struct c_declspecs *specs)
if (specs->saturating_p)
{
error ("%<_Sat%> is used without %<_Fract%> or %<_Accum%>");
+ if (!targetm.fixed_point_supported_p ())
+ error ("fixed-point types not supported for this target");
specs->typespec_word = cts_fract;
}
else if (specs->long_p || specs->short_p
@@ -7894,8 +7896,10 @@ finish_declspecs (struct c_declspecs *specs)
specs->type = dfloat128_type_node;
break;
case cts_fract:
- gcc_assert (!specs->complex_p);
- if (specs->saturating_p)
+ gcc_assert (!specs->complex_p);
+ if (!targetm.fixed_point_supported_p ())
+ specs->type = integer_type_node;
+ else if (specs->saturating_p)
{
if (specs->long_long_p)
specs->type = specs->unsigned_p
@@ -7913,7 +7917,7 @@ finish_declspecs (struct c_declspecs *specs)
specs->type = specs->unsigned_p
? sat_unsigned_fract_type_node
: sat_fract_type_node;
- }
+ }
else
{
if (specs->long_long_p)
@@ -7932,11 +7936,13 @@ finish_declspecs (struct c_declspecs *specs)
specs->type = specs->unsigned_p
? unsigned_fract_type_node
: fract_type_node;
- }
+ }
break;
case cts_accum:
- gcc_assert (!specs->complex_p);
- if (specs->saturating_p)
+ gcc_assert (!specs->complex_p);
+ if (!targetm.fixed_point_supported_p ())
+ specs->type = integer_type_node;
+ else if (specs->saturating_p)
{
if (specs->long_long_p)
specs->type = specs->unsigned_p
@@ -7954,7 +7960,7 @@ finish_declspecs (struct c_declspecs *specs)
specs->type = specs->unsigned_p
? sat_unsigned_accum_type_node
: sat_accum_type_node;
- }
+ }
else
{
if (specs->long_long_p)
@@ -7973,7 +7979,7 @@ finish_declspecs (struct c_declspecs *specs)
specs->type = specs->unsigned_p
? unsigned_accum_type_node
: accum_type_node;
- }
+ }
break;
default:
gcc_unreachable ();