[Patch, Fortran] PR50923 - [4.4-4.7] Print warning function does not return a value

Tobias Burnus burnus@net-b.de
Wed Nov 30 18:19:00 GMT 2011


The bug has been introduced when changing the warning system to do more 
in the front end. The problem is that for:
   module m
   contains
     function f()
     end
   end
the sym->attr.referenced gets set - and no warning is printed. I now 
ignore the sym->attr.referenced attribute as the RESULT == NULL_TREE 
should only be reached if the variable has not been assigned a value.

Additionally, I now only set TREE_NO_WARNING() if a warning has been 
printed; that way, some other useful middle-end warnings might be still 
printed. I have to set the NO_WARNING also for sym != sym->result as it 
otherwise prints a middle end warning into addition to the FE warning. 
But the FE warning has been printed already before for the result variable.

Build and regtested on x86-64-linux.
OK for the trunk? How far should this be backported - all the way down 
to 4.4?

Tobias
-------------- next part --------------
A non-text attachment was scrubbed...
Name: unset_warn.diff
Type: text/x-patch
Size: 3991 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20111130/975d5b49/attachment.bin>


More information about the Fortran mailing list