Commit fe377a48 by Marek Polacek Committed by Marek Polacek

re PR c/77323 (Bad "defaults to 'int'" warning for unsupported types)

	PR c/77323
	* c-decl.c (declspecs_add_type): Set typespec_word even when __intN
	or _FloatN or _FloatNx is not supported.
	(finish_declspecs): Set type to integer_type_node when _FloatN or
	_FloatNx is not supported.

	* gcc.dg/pr77323.c: New test.

From-SVN: r239752
parent e627efef
2016-08-25 Marek Polacek <polacek@redhat.com>
PR c/77323
* c-decl.c (declspecs_add_type): Set typespec_word even when __intN
or _FloatN or _FloatNx is not supported.
(finish_declspecs): Set type to integer_type_node when _FloatN or
_FloatNx is not supported.
2016-08-19 Joseph Myers <joseph@codesourcery.com> 2016-08-19 Joseph Myers <joseph@codesourcery.com>
PR c/32187 PR c/32187
......
...@@ -10190,10 +10190,13 @@ declspecs_add_type (location_t loc, struct c_declspecs *specs, ...@@ -10190,10 +10190,13 @@ declspecs_add_type (location_t loc, struct c_declspecs *specs,
("both %<__int%d%> and %<short%> in " ("both %<__int%d%> and %<short%> in "
"declaration specifiers"), "declaration specifiers"),
int_n_data[specs->int_n_idx].bitsize); int_n_data[specs->int_n_idx].bitsize);
else if (! int_n_enabled_p [specs->int_n_idx]) else if (! int_n_enabled_p[specs->int_n_idx])
error_at (loc, {
"%<__int%d%> is not supported on this target", specs->typespec_word = cts_int_n;
int_n_data[specs->int_n_idx].bitsize); error_at (loc,
"%<__int%d%> is not supported on this target",
int_n_data[specs->int_n_idx].bitsize);
}
else else
{ {
specs->typespec_word = cts_int_n; specs->typespec_word = cts_int_n;
...@@ -10400,12 +10403,15 @@ declspecs_add_type (location_t loc, struct c_declspecs *specs, ...@@ -10400,12 +10403,15 @@ declspecs_add_type (location_t loc, struct c_declspecs *specs,
? "x" ? "x"
: "")); : ""));
else if (FLOATN_NX_TYPE_NODE (specs->floatn_nx_idx) == NULL_TREE) else if (FLOATN_NX_TYPE_NODE (specs->floatn_nx_idx) == NULL_TREE)
error_at (loc, {
"%<_Float%d%s%> is not supported on this target", specs->typespec_word = cts_floatn_nx;
floatn_nx_types[specs->floatn_nx_idx].n, error_at (loc,
(floatn_nx_types[specs->floatn_nx_idx].extended "%<_Float%d%s%> is not supported on this target",
? "x" floatn_nx_types[specs->floatn_nx_idx].n,
: "")); (floatn_nx_types[specs->floatn_nx_idx].extended
? "x"
: ""));
}
else else
{ {
specs->typespec_word = cts_floatn_nx; specs->typespec_word = cts_floatn_nx;
...@@ -10892,9 +10898,12 @@ finish_declspecs (struct c_declspecs *specs) ...@@ -10892,9 +10898,12 @@ finish_declspecs (struct c_declspecs *specs)
case cts_floatn_nx: case cts_floatn_nx:
gcc_assert (!specs->long_p && !specs->short_p gcc_assert (!specs->long_p && !specs->short_p
&& !specs->signed_p && !specs->unsigned_p); && !specs->signed_p && !specs->unsigned_p);
specs->type = (specs->complex_p if (FLOATN_NX_TYPE_NODE (specs->floatn_nx_idx) == NULL_TREE)
? COMPLEX_FLOATN_NX_TYPE_NODE (specs->floatn_nx_idx) specs->type = integer_type_node;
: FLOATN_NX_TYPE_NODE (specs->floatn_nx_idx)); else if (specs->complex_p)
specs->type = COMPLEX_FLOATN_NX_TYPE_NODE (specs->floatn_nx_idx);
else
specs->type = FLOATN_NX_TYPE_NODE (specs->floatn_nx_idx);
break; break;
case cts_dfloat32: case cts_dfloat32:
case cts_dfloat64: case cts_dfloat64:
......
2016-08-25 Marek Polacek <polacek@redhat.com>
PR c/77323
* gcc.dg/pr77323.c: New test.
2016-08-24 Paul Thomas <pault@gcc.gnu.org> 2016-08-24 Paul Thomas <pault@gcc.gnu.org>
PR fortran/77358 PR fortran/77358
......
/* PR c/77323 */
/* { dg-do compile { target ia32 } } */
/* { dg-options "" } */
__int128 a; /* { dg-error "not supported" } */
_Float128x b; /* { dg-error "not supported" } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment