[patch, fortran] Fix PR 48352 - regression with ICE with front end optimization

Thomas Koenig tkoenig@netcologne.de
Thu Mar 31 20:37:00 GMT 2011


Hello world,

the attached patch fixes a 4.7 regression, PR 48352, where a function 
elimination in the expressions for a DO loop caused an ICE.  The ICE was 
caused by interaction of the expression walker with insertion of a 
statement for a DO loop.

Many thanks to Joost for finding the bug and reducing the test case.

To fix the regression, I have disabled this particular optimization for 
expressions within the loop control.

I'd like to overhaul the way that statements are inserted during front 
end optimization, later. This is needed for functions returning arrays 
with bounds not known at compile-time anyway.

Regression-tested.  OK for trunk?

	Thomas

2011-03-31  Thomas Koenig  <tkoenig@gcc.gnu.org>

         PR fortran/48352
         * frontend-passes (cfe_register_funcs):  Don't
         register functions if they appear as iterators in DO loops.

2011-03-31  Thomas Koenig  <tkoenig@gcc.gnu.org>

         PR fortran/48352
         * gfortran.dg/function_optimize_3.f90:  New test.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr48352.diff
Type: text/x-patch
Size: 519 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20110331/6e484641/attachment.bin>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: function_optimize_3.f90
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20110331/6e484641/attachment.f90>


More information about the Gcc-patches mailing list