This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, Fortran, PR 57987] Do not call cgraph_finalize_function multiple times on finalizers
- From: Martin Jambor <mjambor at suse dot cz>
- To: Dominique Dhumieres <dominiq at lps dot ens dot fr>
- Cc: fortran at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Mon, 5 Aug 2013 18:39:20 +0200
- Subject: Re: [PATCH, Fortran, PR 57987] Do not call cgraph_finalize_function multiple times on finalizers
- References: <20130803111242 dot 02A743BE1B at mailhost dot lps dot ens dot fr>
Hi,
On Sat, Aug 03, 2013 at 01:12:41PM +0200, Dominique Dhumieres wrote:
> Hi Martin,
>
> I have applied the patch on top of r201441 and I still get the warning for
> gcc/testsuite/gfortran.dg/class_48.f90 with -m32 -O(2|s):
>
> /opt/gcc/work/gcc/testsuite/gfortran.dg/class_48.f90: In function '__final_test2_T.2136.constprop.0':
> /opt/gcc/work/gcc/testsuite/gfortran.dg/class_48.f90:39:0: warning: iteration 2147483648 invokes undefined behavior [-Waggressive-loop-optimizations]
> class(t), allocatable :: a
> ^
> /opt/gcc/work/gcc/testsuite/gfortran.dg/class_48.f90:39:0: note: containing loop
>
> The test gcc/testsuite/gfortran.dg/pr57987.f90 passes.
Well, that is because this patch is a fix for PR 57987 (Fortran
finalizers considered extern-inline by middle-end) and not for PR
57904 (the incorrect warning), even though the testcase is the same.
As I pointed out, the warning happens in dead code (that is dead
thanks to IPA-CP but not removed yet when the warning is emitted). I
have not given much thought to fixing this problem and worked on other
things. IIRC I dug out of history that Jakub added the warning code
recently and so I CCed him. I suppose he will have a look at this
once he re-appears.
Thanks for testing,
Martin