Patchwork Remove error from variable_size

login
register
mail settings
Submitter Eric Botcazou
Date May 4, 2011, 8:32 a.m.
Message ID <201105041032.50190.ebotcazou@adacore.com>
Download mbox | patch
Permalink /patch/93993/
State New
Headers show

Comments

Eric Botcazou - May 4, 2011, 8:32 a.m.
Hi,

on the heels of the discussion with Joseph, the attached patch removes the 
error issued by variable_size, as it appears to be totally useless at this 
point.  FEs should be responsible for catching errors here.

Tested on x86_64-suse-linux, OK for the mainline?


2011-05-04  Eric Botcazou  <ebotcazou@adacore.com>

	* stor-layout.c (variable_size): Do not issue errors.
Richard Guenther - May 4, 2011, 9:42 a.m.
On Wed, May 4, 2011 at 10:32 AM, Eric Botcazou <ebotcazou@adacore.com> wrote:
> Hi,
>
> on the heels of the discussion with Joseph, the attached patch removes the
> error issued by variable_size, as it appears to be totally useless at this
> point.  FEs should be responsible for catching errors here.
>
> Tested on x86_64-suse-linux, OK for the mainline?

Ok.

Thanks,
Richard.

>
> 2011-05-04  Eric Botcazou  <ebotcazou@adacore.com>
>
>        * stor-layout.c (variable_size): Do not issue errors.
>
>
> --
> Eric Botcazou
>

Patch

Index: stor-layout.c
===================================================================
--- stor-layout.c	(revision 173209)
+++ stor-layout.c	(working copy)
@@ -152,16 +152,6 @@  variable_size (tree size)
        that determine sizes for variable size objects.  Trust it.  */
     return size;
 
-  if (lang_hooks.decls.global_bindings_p ())
-    {
-      if (TREE_CONSTANT (size))
-	error ("type size can%'t be explicitly evaluated");
-      else
-	error ("variable-size type declared outside of any function");
-
-      return size_one_node;
-    }
-
   put_pending_size (save);
 
   return size;