public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/54224] New: [4.8 Regression] Bogus -Wunused-function warning with static function
@ 2012-08-10 15:44 burnus at gcc dot gnu.org
  2012-08-11  9:03 ` [Bug middle-end/54224] " burnus at gcc dot gnu.org
                   ` (25 more replies)
  0 siblings, 26 replies; 27+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-08-10 15:44 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54224

             Bug #: 54224
           Summary: [4.8 Regression] Bogus -Wunused-function warning with
                    static function
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: burnus@gcc.gnu.org
                CC: koen.poppe@cs.kuleuven.be
            Blocks: 54221


Split off from PR 54221.

GCC prints for the following program with -Wunused-function:

test.f90:8:0: warning: ‘hello_integer’ defined but not used [-Wunused-function]
     subroutine hello_integer( a )


However, the subroutine *is* used. (Note: "hello_integer" is marked with
TREE_PUBLIC(...) = 0.)


module mod_say_hello
    private :: hello_integer
contains
    subroutine say_hello()
        call hello_integer(123)
    end subroutine say_hello

    subroutine hello_integer( a )
        integer, intent(in) ::  a
        print *, "Hello ", a, "!"
    end subroutine hello_integer
end module mod_say_hello


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [Bug middle-end/54224] Bogus -Wunused-function warning with static function
  2012-08-10 15:44 [Bug middle-end/54224] New: [4.8 Regression] Bogus -Wunused-function warning with static function burnus at gcc dot gnu.org
@ 2012-08-11  9:03 ` burnus at gcc dot gnu.org
  2012-08-15 12:39 ` burnus at gcc dot gnu.org
                   ` (24 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-08-11  9:03 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54224

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |burnus at gcc dot gnu.org
            Summary|[4.8 Regression] Bogus      |Bogus -Wunused-function
                   |-Wunused-function warning   |warning with static
                   |with static function        |function

--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-08-11 09:03:06 UTC ---
I just realized that I misremembered the TREE_PUBLIC patch: It has been
committed after 4.7 was branched (cf. PR40973 and PR40973 / PR52916). Thus, it
is not a regression.


Another, possibly related question is: Why is the function "hello_integer" not
inlined into its only user? The compiler does realize that the variable is
local as in the "nm" output the "t" shows and the ".constprop.0" suffix with
-O2/-O3/-Ofast:

0000000000000000 t __mod_say_hello_MOD_hello_integer.constprop.0
0000000000000080 T __mod_say_hello_MOD_say_hello


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [Bug middle-end/54224] Bogus -Wunused-function warning with static function
  2012-08-10 15:44 [Bug middle-end/54224] New: [4.8 Regression] Bogus -Wunused-function warning with static function burnus at gcc dot gnu.org
  2012-08-11  9:03 ` [Bug middle-end/54224] " burnus at gcc dot gnu.org
@ 2012-08-15 12:39 ` burnus at gcc dot gnu.org
  2012-08-15 13:04 ` burnus at gcc dot gnu.org
                   ` (23 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-08-15 12:39 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54224

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |janus at gcc dot gnu.org

--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-08-15 12:38:21 UTC ---
*** Bug 54270 has been marked as a duplicate of this bug. ***


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [Bug middle-end/54224] Bogus -Wunused-function warning with static function
  2012-08-10 15:44 [Bug middle-end/54224] New: [4.8 Regression] Bogus -Wunused-function warning with static function burnus at gcc dot gnu.org
  2012-08-11  9:03 ` [Bug middle-end/54224] " burnus at gcc dot gnu.org
  2012-08-15 12:39 ` burnus at gcc dot gnu.org
@ 2012-08-15 13:04 ` burnus at gcc dot gnu.org
  2012-08-15 18:30 ` [Bug middle-end/54224] [4.8 Regression] " janus at gcc dot gnu.org
                   ` (22 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-08-15 13:04 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54224

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |missed-optimization

--- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-08-15 13:04:15 UTC ---
Some further observations:

a) Inlining: It fails according to -fdump-ipa-inline because of:
   not inlinable: say_hello/1 -> hello_integer/0,
                  --param large-stack-frame-growth limit reached
   Still, given that there is only one user of the function, one should expect
   that the function gets inlined.


For the following [(c) and (d)], I have the impression that the warning is
generated at the wrong spot.

b) I failed to generate a C version of the failing test case of comment 0.

c) For the program in comment 0, one enters rtx_for_function_call and one
properly calls those lines:

1678          if (!TREE_USED (fndecl) && fndecl != current_function_decl)
1679            TREE_USED (fndecl) = 1;

for <function_decl 0x2aaaac2a0300 hello_integer

However, that function is called *AFTER* check_global_declaration_1 and comes
thus too late.


d) There is no warning for internal procedures even though there should be:

     program test
     contains
       subroutine unused ()
       end subroutine unused
     end program test

   nor for the C version (compile with -std=gnu99 as nested functions is an
   extension):

     #include <stdio.h>

     int main ()
     {
       void foo() { };
       printf("Hello World!\n");
       return 0;
     }

  Given that "foo" and "unused" aren't global declarations, that's probably not
  surprising.


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [Bug middle-end/54224] [4.8 Regression] Bogus -Wunused-function warning with static function
  2012-08-10 15:44 [Bug middle-end/54224] New: [4.8 Regression] Bogus -Wunused-function warning with static function burnus at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2012-08-15 13:04 ` burnus at gcc dot gnu.org
@ 2012-08-15 18:30 ` janus at gcc dot gnu.org
  2012-08-16  9:57 ` burnus at gcc dot gnu.org
                   ` (21 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: janus at gcc dot gnu.org @ 2012-08-15 18:30 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54224

janus at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-08-15
            Summary|Bogus -Wunused-function     |[4.8 Regression] Bogus
                   |warning with static         |-Wunused-function warning
                   |function                    |with static function
     Ever Confirmed|0                           |1

--- Comment #4 from janus at gcc dot gnu.org 2012-08-15 18:30:26 UTC ---
(In reply to comment #1)
> I just realized that I misremembered the TREE_PUBLIC patch: It has been
> committed after 4.7 was branched (cf. PR40973 and PR40973 / PR52916). Thus, it
> is not a regression.

Well, the warning on the test case in comment 0 is certainly a regression, as
it does not appear with 4.7.


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [Bug middle-end/54224] [4.8 Regression] Bogus -Wunused-function warning with static function
  2012-08-10 15:44 [Bug middle-end/54224] New: [4.8 Regression] Bogus -Wunused-function warning with static function burnus at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2012-08-15 18:30 ` [Bug middle-end/54224] [4.8 Regression] " janus at gcc dot gnu.org
@ 2012-08-16  9:57 ` burnus at gcc dot gnu.org
  2012-08-16 11:07 ` rguenth at gcc dot gnu.org
                   ` (20 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-08-16  9:57 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54224

--- Comment #5 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-08-16 09:56:51 UTC ---
> c) For the program in comment 0, one enters rtx_for_function_call [...]
> However, that function is called *AFTER* check_global_declaration_1 and comes
> thus too late.

check_global_declaration_1 is called write_global_declarations via compile_file
via do_compile

While rtx_for_function_call is later also called via write_global_declarations
-> finalize_compilation_unit -> output_in_order -> expand_function ->
execute_pass_list -> execute_one_pass -> ... -> expand_call_stmt -> ...

In C, one has the same order - except that TREE_USED is already set. My
impression is that in C it gets set when the DECL is 'created' in the caller.

 * * *

Hence, I think one should think of handling it on Fortran FE level by setting
USE_TREE.

For procedures, I think we need to cover procedure calls, proc-pointer
assignments and proc-pointer assignments via initializers and default
initializers. On tree level, we could either plug into
gfc_trans_pointer_assignment and conv_function_val - or make some use of
attr.referenced (though, the latter seems to be also set for uncalled
functions).


Not as important as we do not currently get a bogus warning, but still nice to
have: A warning for PRIVATE module variables. For
  module m
    private
    integer, save :: var ! = 5
  end module m
we always set TREE_USED in gfc_finish_var_decl. One could check whether simply
not doing so for private variables is sufficient to get a warning, but I am not
sure whether we won't run into the problem of getting the diagnostic in
check_global_declaration_1

sym->referenced is always set: It is set before gfc_create_module_variable and
it is unconditionally set in that function. (EQUIVALENCE with PRIVATE/PUBLIC
has to be handled as well.)


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [Bug middle-end/54224] [4.8 Regression] Bogus -Wunused-function warning with static function
  2012-08-10 15:44 [Bug middle-end/54224] New: [4.8 Regression] Bogus -Wunused-function warning with static function burnus at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2012-08-16  9:57 ` burnus at gcc dot gnu.org
@ 2012-08-16 11:07 ` rguenth at gcc dot gnu.org
  2012-08-21  8:49 ` burnus at gcc dot gnu.org
                   ` (19 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-08-16 11:07 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54224

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.8.0


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [Bug middle-end/54224] [4.8 Regression] Bogus -Wunused-function warning with static function
  2012-08-10 15:44 [Bug middle-end/54224] New: [4.8 Regression] Bogus -Wunused-function warning with static function burnus at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2012-08-16 11:07 ` rguenth at gcc dot gnu.org
@ 2012-08-21  8:49 ` burnus at gcc dot gnu.org
  2012-09-15 17:42 ` [Bug fortran/54224] " janus at gcc dot gnu.org
                   ` (18 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-08-21  8:49 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54224

--- Comment #6 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-08-21 08:48:49 UTC ---
* Regarding the inlining issue: I think that's known, cf. bug 48636 comment 18.

* It seems as if the TREE_USED part should be handled on the Fortran FE side
  for both (PRIVATE) module variables and module procedures

* Internal procedures should also be warned for; it probably requires some
  Fortran FE work as well as some middle-end work as there is currently also
  no warning for the GNU C extension.


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [Bug fortran/54224] [4.8 Regression] Bogus -Wunused-function warning with static function
  2012-08-10 15:44 [Bug middle-end/54224] New: [4.8 Regression] Bogus -Wunused-function warning with static function burnus at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2012-08-21  8:49 ` burnus at gcc dot gnu.org
@ 2012-09-15 17:42 ` janus at gcc dot gnu.org
  2012-09-15 17:48 ` burnus at gcc dot gnu.org
                   ` (17 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: janus at gcc dot gnu.org @ 2012-09-15 17:42 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54224

janus at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|middle-end                  |fortran

--- Comment #7 from janus at gcc dot gnu.org 2012-09-15 17:41:29 UTC ---
(In reply to comment #6)
> * It seems as if the TREE_USED part should be handled on the Fortran FE side
>   for both (PRIVATE) module variables and module procedures

Here is a patch which should set TREE_USED for all procedure calls:


Index: gcc/fortran/trans-expr.c
===================================================================
--- gcc/fortran/trans-expr.c    (revision 191303)
+++ gcc/fortran/trans-expr.c    (working copy)
@@ -2455,6 +2455,8 @@ conv_function_val (gfc_se * se, gfc_symbol * sym,
       if (!sym->backend_decl)
     sym->backend_decl = gfc_get_extern_function_decl (sym);

+      TREE_USED (sym->backend_decl) = 1;
+
       tmp = sym->backend_decl;

       if (sym->attr.cray_pointee)


It makes the bogus warning on comment 0 go away.


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [Bug fortran/54224] [4.8 Regression] Bogus -Wunused-function warning with static function
  2012-08-10 15:44 [Bug middle-end/54224] New: [4.8 Regression] Bogus -Wunused-function warning with static function burnus at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2012-09-15 17:42 ` [Bug fortran/54224] " janus at gcc dot gnu.org
@ 2012-09-15 17:48 ` burnus at gcc dot gnu.org
  2012-09-15 18:26 ` janus at gcc dot gnu.org
                   ` (16 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-09-15 17:48 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54224

--- Comment #8 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-09-15 17:47:37 UTC ---
(In reply to comment #7)
> Here is a patch which should set TREE_USED for all procedure calls:

Does it still allow to optimize unused PRIVATE module procedures away?


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [Bug fortran/54224] [4.8 Regression] Bogus -Wunused-function warning with static function
  2012-08-10 15:44 [Bug middle-end/54224] New: [4.8 Regression] Bogus -Wunused-function warning with static function burnus at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2012-09-15 17:48 ` burnus at gcc dot gnu.org
@ 2012-09-15 18:26 ` janus at gcc dot gnu.org
  2012-09-19 14:25 ` rguenth at gcc dot gnu.org
                   ` (15 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: janus at gcc dot gnu.org @ 2012-09-15 18:26 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54224

--- Comment #10 from janus at gcc dot gnu.org 2012-09-15 18:26:27 UTC ---
(In reply to comment #8)
> > Here is a patch which should set TREE_USED for all procedure calls:
> 
> Does it still allow to optimize unused PRIVATE module procedures away?

I think so. conv_function_val is only called by gfc_conv_procedure_call. If the
procedure is really not used, then gfc_conv_procedure_call will not be called,
and thus also TREE_USED will not be set.

Moreover, the patchlet in comment 7 seems to be free of testsuite regressions.


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [Bug fortran/54224] [4.8 Regression] Bogus -Wunused-function warning with static function
  2012-08-10 15:44 [Bug middle-end/54224] New: [4.8 Regression] Bogus -Wunused-function warning with static function burnus at gcc dot gnu.org
                   ` (9 preceding siblings ...)
  2012-09-15 18:26 ` janus at gcc dot gnu.org
@ 2012-09-19 14:25 ` rguenth at gcc dot gnu.org
  2012-10-19 17:15 ` janus at gcc dot gnu.org
                   ` (14 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-09-19 14:25 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54224

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P4


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [Bug fortran/54224] [4.8 Regression] Bogus -Wunused-function warning with static function
  2012-08-10 15:44 [Bug middle-end/54224] New: [4.8 Regression] Bogus -Wunused-function warning with static function burnus at gcc dot gnu.org
                   ` (10 preceding siblings ...)
  2012-09-19 14:25 ` rguenth at gcc dot gnu.org
@ 2012-10-19 17:15 ` janus at gcc dot gnu.org
  2012-10-19 17:23 ` janus at gcc dot gnu.org
                   ` (13 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: janus at gcc dot gnu.org @ 2012-10-19 17:15 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54224

--- Comment #11 from janus at gcc dot gnu.org 2012-10-19 17:15:01 UTC ---
Author: janus
Date: Fri Oct 19 17:14:46 2012
New Revision: 192620

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=192620
Log:
2012-10-19  Janus Weil  <janus@gcc.gnu.org>

    PR fortran/54224
    * trans-expr.c (conv_function_val): Set TREE_USED.

2012-10-19  Janus Weil  <janus@gcc.gnu.org>

    PR fortran/54224
    * gfortran.dg/warn_unused_function.f90: New.

Added:
    trunk/gcc/testsuite/gfortran.dg/warn_unused_function.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/trans-expr.c
    trunk/gcc/testsuite/ChangeLog


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [Bug fortran/54224] [4.8 Regression] Bogus -Wunused-function warning with static function
  2012-08-10 15:44 [Bug middle-end/54224] New: [4.8 Regression] Bogus -Wunused-function warning with static function burnus at gcc dot gnu.org
                   ` (11 preceding siblings ...)
  2012-10-19 17:15 ` janus at gcc dot gnu.org
@ 2012-10-19 17:23 ` janus at gcc dot gnu.org
  2012-10-19 17:49 ` janus at gcc dot gnu.org
                   ` (12 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: janus at gcc dot gnu.org @ 2012-10-19 17:23 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54224

--- Comment #12 from janus at gcc dot gnu.org 2012-10-19 17:22:44 UTC ---
r192620 fixes the bogus warning on comment 0, which was a 4.8 regression.

Leftover things to check/fix:
 * unused-warnings for internal procedues
 * unused-warnings for module variables
 * ... ?


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [Bug fortran/54224] [4.8 Regression] Bogus -Wunused-function warning with static function
  2012-08-10 15:44 [Bug middle-end/54224] New: [4.8 Regression] Bogus -Wunused-function warning with static function burnus at gcc dot gnu.org
                   ` (12 preceding siblings ...)
  2012-10-19 17:23 ` janus at gcc dot gnu.org
@ 2012-10-19 17:49 ` janus at gcc dot gnu.org
  2012-10-19 17:54 ` [Bug fortran/54224] Warn for unused (private) module variables and internal procedures janus at gcc dot gnu.org
                   ` (11 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: janus at gcc dot gnu.org @ 2012-10-19 17:49 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54224

--- Comment #13 from janus at gcc dot gnu.org 2012-10-19 17:48:50 UTC ---
(In reply to comment #12)
> Leftover things to check/fix:
>  * unused-warnings for internal procedues

Test case:

module m
private
contains
 subroutine s1
 contains
   subroutine s2
   end subroutine
 end subroutine
end module

program test
contains
  subroutine s3
  end subroutine
end


With -Wunused-function, gfortran currently only warns for s1, but not for s2
and s3. (With 4.7, no warning is thrown at all.)


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [Bug fortran/54224] Warn for unused (private) module variables and internal procedures
  2012-08-10 15:44 [Bug middle-end/54224] New: [4.8 Regression] Bogus -Wunused-function warning with static function burnus at gcc dot gnu.org
                   ` (13 preceding siblings ...)
  2012-10-19 17:49 ` janus at gcc dot gnu.org
@ 2012-10-19 17:54 ` janus at gcc dot gnu.org
  2012-10-20 21:18 ` janus at gcc dot gnu.org
                   ` (10 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: janus at gcc dot gnu.org @ 2012-10-19 17:54 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54224

janus at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[4.8 Regression] Bogus      |Warn for unused (private)
                   |-Wunused-function warning   |module variables and
                   |with static function        |internal procedures

--- Comment #14 from janus at gcc dot gnu.org 2012-10-19 17:54:24 UTC ---
(In reply to comment #12)
>  * unused-warnings for module variables

Test case:


module m
 integer :: j
 integer, private :: k
end module

program test
  integer :: i
end


With -Wunused-variable, gfortran warns for i, but should also warn for k (not
for j).

(adjusting title for leftover issues ...)


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [Bug fortran/54224] Warn for unused (private) module variables and internal procedures
  2012-08-10 15:44 [Bug middle-end/54224] New: [4.8 Regression] Bogus -Wunused-function warning with static function burnus at gcc dot gnu.org
                   ` (14 preceding siblings ...)
  2012-10-19 17:54 ` [Bug fortran/54224] Warn for unused (private) module variables and internal procedures janus at gcc dot gnu.org
@ 2012-10-20 21:18 ` janus at gcc dot gnu.org
  2013-03-22 14:45 ` jakub at gcc dot gnu.org
                   ` (9 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: janus at gcc dot gnu.org @ 2012-10-20 21:18 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54224

--- Comment #15 from janus at gcc dot gnu.org 2012-10-20 21:17:54 UTC ---
(In reply to comment #14)
> (In reply to comment #12)
> >  * unused-warnings for module variables

Here is a draft patch which fixes the test case in comment 14:

Index: gcc/fortran/trans-decl.c
===================================================================
--- gcc/fortran/trans-decl.c    (revision 192619)
+++ gcc/fortran/trans-decl.c    (working copy)
@@ -3999,6 +4001,20 @@ static void
       && sym->ts.type == BT_DERIVED)
     sym->backend_decl = gfc_typenode_for_spec (&(sym->ts));

+  /* Warn for unused private module variables.  */
+  if (warn_unused_variable && !sym->attr.referenced
+      && (sym->attr.access == ACCESS_PRIVATE
+      || (sym->attr.access == ACCESS_UNKNOWN
+          && sym->ns->default_access == ACCESS_PRIVATE))
+      && !(sym->attr.in_common || sym->attr.use_assoc || sym->mark
+       || sym->attr.in_namelist || sym->attr.flavor == FL_MODULE))
+    {
+      gfc_warning ("Unused private module variable '%s' declared at %L",
+           sym->name, &sym->declared_at);
+      if (sym->backend_decl != NULL_TREE)
+    TREE_NO_WARNING(sym->backend_decl) = 1;
+    }
+
   if (sym->attr.flavor == FL_DERIVED
       && sym->backend_decl
       && TREE_CODE (sym->backend_decl) == RECORD_TYPE)


as well as this extended version (and regtests cleanly):


module m
 integer :: j
 integer, private :: k   ! { dg-error "Unused private module variable" }
end module

module m2
  private
  real :: r              ! { dg-error "Unused private module variable" }
  real, public :: p
end module


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [Bug fortran/54224] Warn for unused (private) module variables and internal procedures
  2012-08-10 15:44 [Bug middle-end/54224] New: [4.8 Regression] Bogus -Wunused-function warning with static function burnus at gcc dot gnu.org
                   ` (15 preceding siblings ...)
  2012-10-20 21:18 ` janus at gcc dot gnu.org
@ 2013-03-22 14:45 ` jakub at gcc dot gnu.org
  2013-05-31 10:59 ` jakub at gcc dot gnu.org
                   ` (8 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-03-22 14:45 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54224

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.8.0                       |4.8.1

--- Comment #16 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-03-22 14:44:29 UTC ---
GCC 4.8.0 is being released, adjusting target milestone.


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [Bug fortran/54224] Warn for unused (private) module variables and internal procedures
  2012-08-10 15:44 [Bug middle-end/54224] New: [4.8 Regression] Bogus -Wunused-function warning with static function burnus at gcc dot gnu.org
                   ` (16 preceding siblings ...)
  2013-03-22 14:45 ` jakub at gcc dot gnu.org
@ 2013-05-31 10:59 ` jakub at gcc dot gnu.org
  2013-08-19 21:18 ` janus at gcc dot gnu.org
                   ` (7 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-05-31 10:59 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54224

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.8.1                       |4.8.2

--- Comment #17 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 4.8.1 has been released.


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [Bug fortran/54224] Warn for unused (private) module variables and internal procedures
  2012-08-10 15:44 [Bug middle-end/54224] New: [4.8 Regression] Bogus -Wunused-function warning with static function burnus at gcc dot gnu.org
                   ` (17 preceding siblings ...)
  2013-05-31 10:59 ` jakub at gcc dot gnu.org
@ 2013-08-19 21:18 ` janus at gcc dot gnu.org
  2013-08-19 21:22 ` [Bug fortran/54224] Warn for unused " janus at gcc dot gnu.org
                   ` (6 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: janus at gcc dot gnu.org @ 2013-08-19 21:18 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54224

--- Comment #18 from janus at gcc dot gnu.org ---
Comment 14 and 15 is fixed on 4.9 trunk with r200950 (cf. PR 52669).


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [Bug fortran/54224] Warn for unused internal procedures
  2012-08-10 15:44 [Bug middle-end/54224] New: [4.8 Regression] Bogus -Wunused-function warning with static function burnus at gcc dot gnu.org
                   ` (18 preceding siblings ...)
  2013-08-19 21:18 ` janus at gcc dot gnu.org
@ 2013-08-19 21:22 ` janus at gcc dot gnu.org
  2013-10-16  9:51 ` jakub at gcc dot gnu.org
                   ` (5 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: janus at gcc dot gnu.org @ 2013-08-19 21:22 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54224

janus at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Warn for unused (private)   |Warn for unused internal
                   |module variables and        |procedures
                   |internal procedures         |

--- Comment #19 from janus at gcc dot gnu.org ---
Still open: Comment 13.


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [Bug fortran/54224] Warn for unused internal procedures
  2012-08-10 15:44 [Bug middle-end/54224] New: [4.8 Regression] Bogus -Wunused-function warning with static function burnus at gcc dot gnu.org
                   ` (19 preceding siblings ...)
  2013-08-19 21:22 ` [Bug fortran/54224] Warn for unused " janus at gcc dot gnu.org
@ 2013-10-16  9:51 ` jakub at gcc dot gnu.org
  2015-06-22 14:26 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-10-16  9:51 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54224

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.8.2                       |4.8.3

--- Comment #20 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 4.8.2 has been released.


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [Bug fortran/54224] Warn for unused internal procedures
  2012-08-10 15:44 [Bug middle-end/54224] New: [4.8 Regression] Bogus -Wunused-function warning with static function burnus at gcc dot gnu.org
                   ` (20 preceding siblings ...)
  2013-10-16  9:51 ` jakub at gcc dot gnu.org
@ 2015-06-22 14:26 ` rguenth at gcc dot gnu.org
  2015-09-13 13:45 ` dominiq at lps dot ens.fr
                   ` (3 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-06-22 14:26 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54224

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.8.3                       |---


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [Bug fortran/54224] Warn for unused internal procedures
  2012-08-10 15:44 [Bug middle-end/54224] New: [4.8 Regression] Bogus -Wunused-function warning with static function burnus at gcc dot gnu.org
                   ` (21 preceding siblings ...)
  2015-06-22 14:26 ` rguenth at gcc dot gnu.org
@ 2015-09-13 13:45 ` dominiq at lps dot ens.fr
  2015-09-13 15:04 ` manu at gcc dot gnu.org
                   ` (2 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: dominiq at lps dot ens.fr @ 2015-09-13 13:45 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54224

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #21 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
> Still open: Comment 13.

Confirmed up to 5.2, but with trunk (6.0) I get

pr54224_3.f90:13:0:

   subroutine s3
^
Warning: 's3' defined but not used [-Wunused-function]
pr54224_3.f90:4:0:

  subroutine s1
^
Warning: 's1' defined but not used [-Wunused-function]
pr54224_3.f90:6:0:

    subroutine s2
^
Warning: 's2' defined but not used [-Wunused-function]

This occurred between revisions r224160 (2015-06-05, s1 only) and r224647
(2015-06-19, above warnings).

Closing as FIXED. Please file new PR(s) for new issue(s).


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [Bug fortran/54224] Warn for unused internal procedures
  2012-08-10 15:44 [Bug middle-end/54224] New: [4.8 Regression] Bogus -Wunused-function warning with static function burnus at gcc dot gnu.org
                   ` (22 preceding siblings ...)
  2015-09-13 13:45 ` dominiq at lps dot ens.fr
@ 2015-09-13 15:04 ` manu at gcc dot gnu.org
  2015-09-13 15:24 ` dominiq at lps dot ens.fr
  2015-09-13 15:52 ` manu at gcc dot gnu.org
  25 siblings, 0 replies; 27+ messages in thread
From: manu at gcc dot gnu.org @ 2015-09-13 15:04 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54224

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |manu at gcc dot gnu.org

--- Comment #22 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
(In reply to Dominique d'Humieres from comment #21)
> Closing as FIXED. Please file new PR(s) for new issue(s).

I'm not a Fortran dev, but I would humbly suggest to add this testcase to the
regression testsuite before closing the bug. Also:

> pr54224_3.f90:6:0:
> 
>     subroutine s2
> ^

You will get a more precise column info (and better location for '^') if
Fortran gives a more precise DECL_SOURCE_LOCATION() when generating this tree.
>From gcc-bugs-return-497108-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Sep 13 15:05:05 2015
Return-Path: <gcc-bugs-return-497108-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 1640 invoked by alias); 13 Sep 2015 15:05:05 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 127805 invoked by uid 48); 13 Sep 2015 15:05:01 -0000
From: "Casey at Carter dot net" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/67545] [concepts] Failure to properly substitute template parameters into requires-clause
Date: Sun, 13 Sep 2015 15:05:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 6.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: major
X-Bugzilla-Who: Casey at Carter dot net
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_severity
Message-ID: <bug-67545-4-n8YZkMlJ56@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-67545-4@http.gcc.gnu.org/bugzilla/>
References: <bug-67545-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-09/txt/msg01086.txt.bz2
Content-length: 466

https://gcc.gnu.org/bugzilla/show_bug.cgi?idg545

Casey Carter <Casey at Carter dot net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |major

--- Comment #1 from Casey Carter <Casey at Carter dot net> ---
Raising importance to "major": I have a hunch that this may be the root cause
of some of my other reported bugs.


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [Bug fortran/54224] Warn for unused internal procedures
  2012-08-10 15:44 [Bug middle-end/54224] New: [4.8 Regression] Bogus -Wunused-function warning with static function burnus at gcc dot gnu.org
                   ` (23 preceding siblings ...)
  2015-09-13 15:04 ` manu at gcc dot gnu.org
@ 2015-09-13 15:24 ` dominiq at lps dot ens.fr
  2015-09-13 15:52 ` manu at gcc dot gnu.org
  25 siblings, 0 replies; 27+ messages in thread
From: dominiq at lps dot ens.fr @ 2015-09-13 15:24 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54224

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |---

--- Comment #23 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
> I'm not a Fortran dev, but I would humbly suggest to add this testcase
> to the regression testsuite before closing the bug.

OK. REOPENED.

> Also:
>
> > pr54224_3.f90:6:0:
> > 
> >     subroutine s2
> > ^
>
> You will get a more precise column info (and better location for '^')
> if Fortran gives a more precise DECL_SOURCE_LOCATION() when generating this tree.

Could you please elaborate?


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [Bug fortran/54224] Warn for unused internal procedures
  2012-08-10 15:44 [Bug middle-end/54224] New: [4.8 Regression] Bogus -Wunused-function warning with static function burnus at gcc dot gnu.org
                   ` (24 preceding siblings ...)
  2015-09-13 15:24 ` dominiq at lps dot ens.fr
@ 2015-09-13 15:52 ` manu at gcc dot gnu.org
  25 siblings, 0 replies; 27+ messages in thread
From: manu at gcc dot gnu.org @ 2015-09-13 15:52 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54224

--- Comment #24 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
(In reply to Dominique d'Humieres from comment #23)
> > I'm not a Fortran dev, but I would humbly suggest to add this testcase
> > to the regression testsuite before closing the bug.
> 
> OK. REOPENED.
> 
> > Also:
> >
> > > pr54224_3.f90:6:0:
> > > 
> > >     subroutine s2
> > > ^
> >
> > You will get a more precise column info (and better location for '^')
> > if Fortran gives a more precise DECL_SOURCE_LOCATION() when generating this tree.
> 
> Could you please elaborate?

I don't know the Fortran FE that well, but at some moment it creates this tree
and it sets DECL_SOURCE_LOCATION(). Probably based on some loc->lb->location.
However, that only contains line number info because Fortran does not use
libcpp/line-map.c for tracking column numbers (it only creates new locations
for line changes).

Fully using line-map.c in Fortran is likely to be a lot of work, but it could
mean getting precise macro locations
(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53934#c2) and remove some of the
duplication between libcpp and Fortran (tokenizer, file inclusion, etc.)

Nonetheless, as a work-around, you could use:

        unsigned int offset = loc->nextc - loc->lb->line;
        location = linemap_position_for_loc_and_offset (line_table,
                                                        loc->lb->location,
                                                        offset));

to create a new location_t with the correct column number and use that for the
tree it creates.
>From gcc-bugs-return-497116-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Sep 13 15:57:45 2015
Return-Path: <gcc-bugs-return-497116-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 69577 invoked by alias); 13 Sep 2015 15:57:45 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 69515 invoked by uid 48); 13 Sep 2015 15:57:41 -0000
From: "manu at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/56659] Segfault due to missing libcpp error handler for "gfortran -cpp"
Date: Sun, 13 Sep 2015 15:57:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: fortran
X-Bugzilla-Version: 4.8.0
X-Bugzilla-Keywords: ice-on-invalid-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: manu at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: cc
Message-ID: <bug-56659-4-8fqxBdtv4g@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-56659-4@http.gcc.gnu.org/bugzilla/>
References: <bug-56659-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-09/txt/msg01094.txt.bz2
Content-length: 1466

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56659

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |manu at gcc dot gnu.org

--- Comment #2 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
(In reply to Tobias Burnus from comment #0)
> Reported by Paul Kapinos at fortran@gcc,
> http://thread.gmane.org/gmane.comp.gcc.fortran/40495
> http://gcc.gnu.org/ml/fortran/2013-03/msg00083.html
> 
> The problem is that libcpp calls an error handler, which is not set in f951.
> 
> 
> Namely,   pfile->cb.error == NULL  but should be point to a function; it has
> the the prototype:
>  bool (*)(cpp_reader *, int, int, source_location, unsigned int, const char
> *,
>           va_list *) 
> C/C++ use:
>    in c-opts.c: "cb->error = c_cpp_error;"
> the function is declared in c-family/c-common.c.

Now that Fortran uses the common diagnostics machinery, it should be possible
to either move this function to common code or create a duplicate in the
Fortran FE.

(Even better would be to convert the common diagnostics machinery to a library
and make libcpp depend on it, which will avoid all these conversions from/to
libcpp/FE enums since libcpp could use directly the same diagnostic enums as
the rest of the compiler)
>From gcc-bugs-return-497117-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Sep 13 16:00:20 2015
Return-Path: <gcc-bugs-return-497117-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 77299 invoked by alias); 13 Sep 2015 16:00:20 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 77224 invoked by uid 48); 13 Sep 2015 16:00:16 -0000
From: "manu at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/56659] Segfault due to missing libcpp error handler for "gfortran -cpp"
Date: Sun, 13 Sep 2015 16:00:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: fortran
X-Bugzilla-Version: 4.8.0
X-Bugzilla-Keywords: ice-on-invalid-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: manu at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: dependson
Message-ID: <bug-56659-4-oYUon8z535@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-56659-4@http.gcc.gnu.org/bugzilla/>
References: <bug-56659-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-09/txt/msg01095.txt.bz2
Content-length: 866

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56659

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Depends on|                            |62226

--- Comment #3 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
(In reply to Manuel López-Ibáñez from comment #2)
> Now that Fortran uses the common diagnostics machinery, it should be
> possible to either move this function to common code or create a duplicate
> in the Fortran FE.

For this function to work, CPP options used by Fortran must be specially
encoded in the *.opt file. See bug 62226.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62226
[Bug 62226] Encode CPP options in lang.opt
>From gcc-bugs-return-497118-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Sep 13 16:13:22 2015
Return-Path: <gcc-bugs-return-497118-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 112451 invoked by alias); 13 Sep 2015 16:13:21 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 112394 invoked by uid 48); 13 Sep 2015 16:13:18 -0000
From: "kargl at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/67538] ICE with invalid source allocation
Date: Sun, 13 Sep 2015 16:13:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: fortran
X-Bugzilla-Version: 6.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: kargl at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: cc
Message-ID: <bug-67538-4-98b3FXRLps@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-67538-4@http.gcc.gnu.org/bugzilla/>
References: <bug-67538-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-09/txt/msg01096.txt.bz2
Content-length: 801

https://gcc.gnu.org/bugzilla/show_bug.cgi?idg538

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kargl at gcc dot gnu.org

--- Comment #2 from kargl at gcc dot gnu.org ---
(In reply to Dominique d'Humieres from comment #1)
> > The following code is invalid since the array dimension is missing,
> > but since it is an ICE I am reporting it.
>
> This is valid since F2003 (implemented recently by Andre Vehreschild), but
> it should not give an ICE.

Are you sure?

There is no array spec.

real, allocatabe :: x(:)  ! Rank 1
real y
y = 42                    ! Rank 0
allocate(x , source=y)

What are the ubound and lbound of x?


^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2015-09-13 15:52 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-10 15:44 [Bug middle-end/54224] New: [4.8 Regression] Bogus -Wunused-function warning with static function burnus at gcc dot gnu.org
2012-08-11  9:03 ` [Bug middle-end/54224] " burnus at gcc dot gnu.org
2012-08-15 12:39 ` burnus at gcc dot gnu.org
2012-08-15 13:04 ` burnus at gcc dot gnu.org
2012-08-15 18:30 ` [Bug middle-end/54224] [4.8 Regression] " janus at gcc dot gnu.org
2012-08-16  9:57 ` burnus at gcc dot gnu.org
2012-08-16 11:07 ` rguenth at gcc dot gnu.org
2012-08-21  8:49 ` burnus at gcc dot gnu.org
2012-09-15 17:42 ` [Bug fortran/54224] " janus at gcc dot gnu.org
2012-09-15 17:48 ` burnus at gcc dot gnu.org
2012-09-15 18:26 ` janus at gcc dot gnu.org
2012-09-19 14:25 ` rguenth at gcc dot gnu.org
2012-10-19 17:15 ` janus at gcc dot gnu.org
2012-10-19 17:23 ` janus at gcc dot gnu.org
2012-10-19 17:49 ` janus at gcc dot gnu.org
2012-10-19 17:54 ` [Bug fortran/54224] Warn for unused (private) module variables and internal procedures janus at gcc dot gnu.org
2012-10-20 21:18 ` janus at gcc dot gnu.org
2013-03-22 14:45 ` jakub at gcc dot gnu.org
2013-05-31 10:59 ` jakub at gcc dot gnu.org
2013-08-19 21:18 ` janus at gcc dot gnu.org
2013-08-19 21:22 ` [Bug fortran/54224] Warn for unused " janus at gcc dot gnu.org
2013-10-16  9:51 ` jakub at gcc dot gnu.org
2015-06-22 14:26 ` rguenth at gcc dot gnu.org
2015-09-13 13:45 ` dominiq at lps dot ens.fr
2015-09-13 15:04 ` manu at gcc dot gnu.org
2015-09-13 15:24 ` dominiq at lps dot ens.fr
2015-09-13 15:52 ` manu at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).