Commit aea625dd by Eric Botcazou Committed by Arnaud Charlet

re PR ada/26315 (ACATS failures c43208b c85006a c85006d cd92001)

2006-02-17  Eric Botcazou  <botcazou@adacore.com>

	PR ada/26315

	* utils2.c (find_common_type): If both input types are BLKmode and
	have the same constant size, keep using the first one.

	* bindgen.adb: (Gen_Versions_Ada): Revert previous workaround.

	* decl.c (gnat_to_gnu_entity): Only check TREE_OVERFLOW for a constant.

	* misc.c (gnat_handle_option): New case for -Woverlength-strings.

From-SVN: r111183
parent 69e6a03e
...@@ -2538,13 +2538,7 @@ package body Bindgen is ...@@ -2538,13 +2538,7 @@ package body Bindgen is
end loop; end loop;
WBI (""); WBI ("");
Ubuf := "u00000";
-- We used to have more complex code: Ubuf := "u00000";
-- which was being miscompiled, so use simpler code instead:
for J in Ubuf'First + 1 .. Ubuf'Last loop
Ubuf (J) := '0';
end loop;
for U in Units.First .. Units.Last loop for U in Units.First .. Units.Last loop
Increment_Ubuf; Increment_Ubuf;
......
...@@ -3435,6 +3435,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) ...@@ -3435,6 +3435,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
a function that returns that type. This usage doesn't make a function that returns that type. This usage doesn't make
sense anyway, so give an error here. */ sense anyway, so give an error here. */
if (TYPE_SIZE_UNIT (gnu_return_type) if (TYPE_SIZE_UNIT (gnu_return_type)
&& TREE_CONSTANT (TYPE_SIZE_UNIT (gnu_return_type))
&& TREE_OVERFLOW (TYPE_SIZE_UNIT (gnu_return_type))) && TREE_OVERFLOW (TYPE_SIZE_UNIT (gnu_return_type)))
{ {
post_error ("cannot return type whose size overflows", post_error ("cannot return type whose size overflows",
......
...@@ -286,6 +286,7 @@ gnat_handle_option (size_t scode, const char *arg, int value ATTRIBUTE_UNUSED) ...@@ -286,6 +286,7 @@ gnat_handle_option (size_t scode, const char *arg, int value ATTRIBUTE_UNUSED)
case OPT_Wvariadic_macros: case OPT_Wvariadic_macros:
case OPT_Wold_style_definition: case OPT_Wold_style_definition:
case OPT_Wmissing_format_attribute: case OPT_Wmissing_format_attribute:
case OPT_Woverlength_strings:
break; break;
/* This is handled by the front-end. */ /* This is handled by the front-end. */
......
...@@ -232,9 +232,10 @@ find_common_type (tree t1, tree t2) ...@@ -232,9 +232,10 @@ find_common_type (tree t1, tree t2)
else if (TYPE_MODE (t2) != BLKmode) else if (TYPE_MODE (t2) != BLKmode)
return t2; return t2;
/* If both types have constant size, use the smaller one. */ /* If both types have constant size, use the smaller one. Keep returning
T1 if we have a tie, to be consistent with the other cases. */
if (TREE_CONSTANT (TYPE_SIZE (t1)) && TREE_CONSTANT (TYPE_SIZE (t2))) if (TREE_CONSTANT (TYPE_SIZE (t1)) && TREE_CONSTANT (TYPE_SIZE (t2)))
return tree_int_cst_lt (TYPE_SIZE (t1), TYPE_SIZE (t2)) ? t1 : t2; return tree_int_cst_lt (TYPE_SIZE (t2), TYPE_SIZE (t1)) ? t2 : t1;
/* Otherwise, if either type has a constant size, use it. */ /* Otherwise, if either type has a constant size, use it. */
else if (TREE_CONSTANT (TYPE_SIZE (t1))) else if (TREE_CONSTANT (TYPE_SIZE (t1)))
......
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