From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24606 invoked by alias); 26 Nov 2008 16:53:37 -0000 Received: (qmail 24304 invoked by uid 48); 26 Nov 2008 16:52:12 -0000 Date: Wed, 26 Nov 2008 16:53:00 -0000 Message-ID: <20081126165212.24303.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/38205] Tranformational function SUM rejected in initialization expressions In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "burnus at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-11/txt/msg02290.txt.bz2 ------- Comment #5 from burnus at gcc dot gnu dot org 2008-11-26 16:52 ------- > I think that patch is not enough (though useful!). I think one needs to add a > gfc_simplify_sum to simplify.c One probably needs an auxiliary function which iterates through an array either along a dim= (-> return a scalar) or if not present, it returns a expr->rank sized array. To be used with PRODUCT and SUM at least. gfc_simplify_reshape might give some idea, though that assumes that source is a rank == 1 array. (Maybe get_expr_storage_size gives also some ideas.) Currently not simplified are: - ALL/ANY/COUNT - cshift/eoshift - dot_product/matmul - (max|min)(loc|val) - note: (max|min)val is implemented for rank == 1 w/o dim - pack/unpack - spread - transpose -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38205