From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19202 invoked by alias); 19 Oct 2012 14:31:20 -0000 Received: (qmail 19181 invoked by uid 22791); 19 Oct 2012 14:31:19 -0000 X-SWARE-Spam-Status: No, hits=-4.1 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,KHOP_RCVD_TRUST,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-vb0-f47.google.com (HELO mail-vb0-f47.google.com) (209.85.212.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 19 Oct 2012 14:31:13 +0000 Received: by mail-vb0-f47.google.com with SMTP id ez10so525097vbb.20 for ; Fri, 19 Oct 2012 07:31:12 -0700 (PDT) MIME-Version: 1.0 Received: by 10.221.12.9 with SMTP id pg9mr1741254vcb.68.1350657071592; Fri, 19 Oct 2012 07:31:11 -0700 (PDT) Received: by 10.58.128.36 with HTTP; Fri, 19 Oct 2012 07:31:11 -0700 (PDT) Date: Fri, 19 Oct 2012 14:50:00 -0000 Message-ID: Subject: [Patch, Fortran] PR 54224: [4.8 Regression] Bogus -Wunused-function warning with static function From: Janus Weil To: gfortran , gcc-patches Content-Type: multipart/mixed; boundary=bcaec54b4adaf7341904cc6a5ab5 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2012-10/txt/msg01802.txt.bz2 --bcaec54b4adaf7341904cc6a5ab5 Content-Type: text/plain; charset=ISO-8859-1 Content-length: 749 Hi all, this regression is haunting me a lot in real-world code. It's 'just' a bogus warning, but it can really swamp the output for modules with many private procedures. I have found a fix that is rather trivial in the sense that it's a one-liner. However, it may not be as trivial conceptually (in particular I'm not 100% sure what caused this regression in the first place; it might have been the the commit for PR40973). Anyway, it regtests cleanly and fixes the problem as advertised. Ok for trunk? Cheers, Janus 2012-10-19 Janus Weil PR fortran/54224 * trans-expr.c (conv_function_val): Set TREE_USED. 2012-10-19 Janus Weil PR fortran/54224 * gfortran.dg/warn_unused_function.f90: New. --bcaec54b4adaf7341904cc6a5ab5 Content-Type: application/octet-stream; name="pr54224.diff" Content-Disposition: attachment; filename="pr54224.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_h8he6mbx0 Content-length: 635 SW5kZXg6IGdjYy9mb3J0cmFuL3RyYW5zLWV4cHIuYwo9PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09Ci0tLSBnY2MvZm9ydHJhbi90cmFucy1leHByLmMJKHJldmlz aW9uIDE5MjYxMSkKKysrIGdjYy9mb3J0cmFuL3RyYW5zLWV4cHIuYwkod29y a2luZyBjb3B5KQpAQCAtMjY3NCw2ICsyNjc0LDggQEAgY29udl9mdW5jdGlv bl92YWwgKGdmY19zZSAqIHNlLCBnZmNfc3ltYm9sICogc3ltLAogICAgICAg aWYgKCFzeW0tPmJhY2tlbmRfZGVjbCkKIAlzeW0tPmJhY2tlbmRfZGVjbCA9 IGdmY19nZXRfZXh0ZXJuX2Z1bmN0aW9uX2RlY2wgKHN5bSk7CiAKKyAgICAg IFRSRUVfVVNFRCAoc3ltLT5iYWNrZW5kX2RlY2wpID0gMTsKKwogICAgICAg dG1wID0gc3ltLT5iYWNrZW5kX2RlY2w7CiAKICAgICAgIGlmIChzeW0tPmF0 dHIuY3JheV9wb2ludGVlKQo= --bcaec54b4adaf7341904cc6a5ab5 Content-Type: application/octet-stream; name="warn_unused_function.f90" Content-Disposition: attachment; filename="warn_unused_function.f90" Content-Transfer-Encoding: base64 X-Attachment-Id: f_h8he768n1 Content-length: 704 ISB7IGRnLWRvIGNvbXBpbGUgfQohIHsgZGctb3B0aW9ucyAiLVd1bnVzZWQt ZnVuY3Rpb24iIH0KIQohIFBSIDU0MjI0OiBbNC44IFJlZ3Jlc3Npb25dIEJv Z3VzIC1XdW51c2VkLWZ1bmN0aW9uIHdhcm5pbmcgd2l0aCBzdGF0aWMgZnVu Y3Rpb24KIQohIENvbnRyaWJ1dGVkIGJ5IFRvYmlhcyBCdXJudXMgPGJ1cm51 c0BnY2MuZ251Lm9yZz4KCm1vZHVsZSBtb2Rfc2F5X2hlbGxvCiAgICBwcml2 YXRlIDo6IGhlbGxvX2ludGVnZXIKY29udGFpbnMKICAgIHN1YnJvdXRpbmUg c2F5X2hlbGxvKCkKICAgICAgICBjYWxsIGhlbGxvX2ludGVnZXIoMTIzKQog ICAgZW5kIHN1YnJvdXRpbmUKCiAgICBzdWJyb3V0aW5lIGhlbGxvX2ludGVn ZXIoIGEgKQogICAgICAgIGludGVnZXIsIGludGVudChpbikgOjogIGEKICAg ICAgICBwcmludCAqLCAiSGVsbG8gIiwgYSwgIiEiCiAgICBlbmQgc3Vicm91 dGluZQplbmQgbW9kdWxlCgohIHsgZGctZmluYWwgeyBjbGVhbnVwLW1vZHVs ZXMgIm1vZF9zYXlfaGVsbG8iIH0gfQo= --bcaec54b4adaf7341904cc6a5ab5--