From patchwork Wed May 4 08:32:50 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 93993 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 09E991007D1 for ; Wed, 4 May 2011 18:33:03 +1000 (EST) Received: (qmail 886 invoked by alias); 4 May 2011 08:33:00 -0000 Received: (qmail 873 invoked by uid 22791); 4 May 2011 08:32:59 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (194.98.77.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 04 May 2011 08:32:45 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 8FB97CB01EC for ; Wed, 4 May 2011 10:32:44 +0200 (CEST) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NIe92I8VmUbW for ; Wed, 4 May 2011 10:32:41 +0200 (CEST) Received: from new-host.home (ADijon-552-1-151-3.w86-213.abo.wanadoo.fr [86.213.234.3]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id 7FA18CB024B for ; Wed, 4 May 2011 10:32:41 +0200 (CEST) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: [patch] Remove error from variable_size Date: Wed, 4 May 2011 10:32:50 +0200 User-Agent: KMail/1.9.9 MIME-Version: 1.0 Message-Id: <201105041032.50190.ebotcazou@adacore.com> Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 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 * stor-layout.c (variable_size): Do not issue errors. 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;