Patchwork [fortran] Fix PR 48066

login
register
mail settings
Submitter Thomas Koenig
Date March 12, 2011, 10:09 p.m.
Message ID <4D7BEF04.4080607@netcologne.de>
Download mbox | patch
Permalink /patch/86558/
State New
Headers show

Comments

Thomas Koenig - March 12, 2011, 10:09 p.m.
Hello world,

the attached patch fixes PR 48066, a regression introduced way back 
when.  It is pretty self-explanatory.  Regression-tested.

OK for trunk?

Also OK for a 4.5 backport?

	Thomas

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

         PR libfortran/40866
         * m4/ifunction.m4:  If return array is empty, return.
         * m4/ifunction_logical.m4:  Likewise.
         * generated/all_l16.c: Regenerated.
         * generated/all_l1.c: Regenerated.
         * generated/all_l2.c: Regenerated.
         * generated/all_l4.c: Regenerated.
         * generated/all_l8.c: Regenerated.
         * generated/any_l16.c: Regenerated.
         * generated/any_l1.c: Regenerated.
         * generated/any_l2.c: Regenerated.
         * generated/any_l4.c: Regenerated.
         * generated/any_l8.c: Regenerated.
         * generated/count_16_l.c: Regenerated.
         * generated/count_1_l.c: Regenerated.
         * generated/count_2_l.c: Regenerated.
         * generated/count_4_l.c: Regenerated.
         * generated/count_8_l.c: Regenerated.
         * generated/maxloc1_16_i16.c: Regenerated.
         * generated/maxloc1_16_i1.c: Regenerated.
         * generated/maxloc1_16_i2.c: Regenerated.
         * generated/maxloc1_16_i4.c: Regenerated.
         * generated/maxloc1_16_i8.c: Regenerated.
         * generated/maxloc1_16_r10.c: Regenerated.
         * generated/maxloc1_16_r16.c: Regenerated.
         * generated/maxloc1_16_r4.c: Regenerated.
         * generated/maxloc1_16_r8.c: Regenerated.
         * generated/maxloc1_4_i16.c: Regenerated.
         * generated/maxloc1_4_i1.c: Regenerated.
         * generated/maxloc1_4_i2.c: Regenerated.
         * generated/maxloc1_4_i4.c: Regenerated.
         * generated/maxloc1_4_i8.c: Regenerated.
         * generated/maxloc1_4_r10.c: Regenerated.
         * generated/maxloc1_4_r16.c: Regenerated.
         * generated/maxloc1_4_r4.c: Regenerated.
         * generated/maxloc1_4_r8.c: Regenerated.
         * generated/maxloc1_8_i16.c: Regenerated.
         * generated/maxloc1_8_i1.c: Regenerated.
         * generated/maxloc1_8_i2.c: Regenerated.
         * generated/maxloc1_8_i4.c: Regenerated.
         * generated/maxloc1_8_i8.c: Regenerated.
         * generated/maxloc1_8_r10.c: Regenerated.
         * generated/maxloc1_8_r16.c: Regenerated.
         * generated/maxloc1_8_r4.c: Regenerated.
         * generated/maxloc1_8_r8.c: Regenerated.
         * generated/maxval_i16.c: Regenerated.
         * generated/maxval_i1.c: Regenerated.
         * generated/maxval_i2.c: Regenerated.
         * generated/maxval_i4.c: Regenerated.
         * generated/maxval_i8.c: Regenerated.
         * generated/maxval_r10.c: Regenerated.
         * generated/maxval_r16.c: Regenerated.
         * generated/maxval_r4.c: Regenerated.
         * generated/maxval_r8.c: Regenerated.
         * generated/minloc1_16_i16.c: Regenerated.
         * generated/minloc1_16_i1.c: Regenerated.
         * generated/minloc1_16_i2.c: Regenerated.
         * generated/minloc1_16_i4.c: Regenerated.
         * generated/minloc1_16_i8.c: Regenerated.
         * generated/minloc1_16_r10.c: Regenerated.
         * generated/minloc1_16_r16.c: Regenerated.
         * generated/minloc1_16_r4.c: Regenerated.
         * generated/minloc1_16_r8.c: Regenerated.
         * generated/minloc1_4_i16.c: Regenerated.
         * generated/minloc1_4_i1.c: Regenerated.
         * generated/minloc1_4_i2.c: Regenerated.
         * generated/minloc1_4_i4.c: Regenerated.
         * generated/minloc1_4_i8.c: Regenerated.
         * generated/minloc1_4_r10.c: Regenerated.
         * generated/minloc1_4_r16.c: Regenerated.
         * generated/minloc1_4_r4.c: Regenerated.
         * generated/minloc1_4_r8.c: Regenerated.
         * generated/minloc1_8_i16.c: Regenerated.
         * generated/minloc1_8_i1.c: Regenerated.
         * generated/minloc1_8_i2.c: Regenerated.
         * generated/minloc1_8_i4.c: Regenerated.
         * generated/minloc1_8_i8.c: Regenerated.
         * generated/minloc1_8_r10.c: Regenerated.
         * generated/minloc1_8_r16.c: Regenerated.
         * generated/minloc1_8_r4.c: Regenerated.
         * generated/minloc1_8_r8.c: Regenerated.
         * generated/minval_i16.c: Regenerated.
         * generated/minval_i1.c: Regenerated.
         * generated/minval_i2.c: Regenerated.
         * generated/minval_i4.c: Regenerated.
         * generated/minval_i8.c: Regenerated.
         * generated/minval_r10.c: Regenerated.
         * generated/minval_r16.c: Regenerated.
         * generated/minval_r4.c: Regenerated.
         * generated/minval_r8.c: Regenerated.
         * generated/product_c10.c: Regenerated.
         * generated/product_c16.c: Regenerated.
         * generated/product_c4.c: Regenerated.
         * generated/product_c8.c: Regenerated.
         * generated/product_i16.c: Regenerated.
         * generated/product_i1.c: Regenerated.
         * generated/product_i2.c: Regenerated.
         * generated/product_i4.c: Regenerated.
         * generated/product_i8.c: Regenerated.
         * generated/product_r10.c: Regenerated.
         * generated/product_r16.c: Regenerated.
         * generated/product_r4.c: Regenerated.
         * generated/product_r8.c: Regenerated.
         * generated/sum_c10.c: Regenerated.
         * generated/sum_c16.c: Regenerated.
         * generated/sum_c4.c: Regenerated.
         * generated/sum_c8.c: Regenerated.
         * generated/sum_i16.c: Regenerated.
         * generated/sum_i1.c: Regenerated.
         * generated/sum_i2.c: Regenerated.
         * generated/sum_i4.c: Regenerated.
         * generated/sum_i8.c: Regenerated.
         * generated/sum_r10.c: Regenerated.
         * generated/sum_r16.c: Regenerated.
         * generated/sum_r4.c: Regenerated.
         * generated/sum_r8.c: Regenerated.

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

         PR libfortran/40866
         * gfortran.dg/intrinsic_ifunction_2.f90:  New test case.
! { dg-do run }
! PR 40866 - this used to segfault.
program p
  real(8) :: empty(0, 3), square(0)
  logical :: lempty(0, 3), lsquare(0)
  square = sum(empty * empty, 2)
  lsquare = any(lempty .and. lempty, 2)
end
Jerry DeLisle - March 12, 2011, 10:33 p.m.
On 03/12/2011 02:09 PM, Thomas Koenig wrote:
> Hello world,
>
> the attached patch fixes PR 48066, a regression introduced way back when. It is
> pretty self-explanatory. Regression-tested.
>
> OK for trunk?

OK and thanks for patch!

Jerry
Thomas Koenig - March 12, 2011, 10:40 p.m.
Hi Jerry,

> On 03/12/2011 02:09 PM, Thomas Koenig wrote:
>> Hello world,
>>
>> the attached patch fixes PR 48066, a regression introduced way back
>> when. It is
>> pretty self-explanatory. Regression-tested.
>>
>> OK for trunk?
>
> OK and thanks for patch!

Übertrage Daten 
......................................................................................................................
Revision 170908 übertragen.

Thanks for the ultra-quick review!

	Thomas
Mikael Morin - March 12, 2011, 11:04 p.m.
On Saturday 12 March 2011 23:40:32 Thomas Koenig wrote:
> Hi Jerry,
> 
> > On 03/12/2011 02:09 PM, Thomas Koenig wrote:
> >> Hello world,
> >> 
> >> the attached patch fixes PR 48066, a regression introduced way back
> >> when. It is
> >> pretty self-explanatory. Regression-tested.
> >> 
> >> OK for trunk?
> > 
> > OK and thanks for patch!
> 
> Übertrage Daten
> ...........................................................................
> ........................................... Revision 170908 übertragen.
> 
> Thanks for the ultra-quick review!
> 
> 	Thomas
There was a typo in the PR number (both in the testcases and in the 
changelogs).
Thomas Koenig - March 12, 2011, 11:18 p.m.
Am 13.03.2011 00:04, schrieb Mikael Morin:
> On Saturday 12 March 2011 23:40:32 Thomas Koenig wrote:
>
> There was a typo in the PR number (both in the testcases and in the
> changelogs)
Corrected.  Thanks!

	Thomas
Jerry DeLisle - March 12, 2011, 11:22 p.m.
On 03/12/2011 03:04 PM, Mikael Morin wrote:
> On Saturday 12 March 2011 23:40:32 Thomas Koenig wrote:
>> Hi Jerry,
>>
>>> On 03/12/2011 02:09 PM, Thomas Koenig wrote:
>>>> Hello world,
>>>>
>>>> the attached patch fixes PR 48066, a regression introduced way back
>>>> when. It is
>>>> pretty self-explanatory. Regression-tested.
>>>>
>>>> OK for trunk?
>>>
>>> OK and thanks for patch!
>>
>> Übertrage Daten
>> ...........................................................................
>> ........................................... Revision 170908 übertragen.
>>
>> Thanks for the ultra-quick review!
>>
>> 	Thomas
> There was a typo in the PR number (both in the testcases and in the
> changelogs).
>
>
Sometimes our brains "see" what they want to see!  ;)

Jerry

Patch

Index: m4/ifunction_logical.m4
===================================================================
--- m4/ifunction_logical.m4	(Revision 170897)
+++ m4/ifunction_logical.m4	(Arbeitskopie)
@@ -130,7 +130,7 @@ 
       count[n] = 0;
       dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
       if (extent[n] <= 0)
-        len = 0;
+	return;
     }
 
   base = array->data;
Index: m4/ifunction.m4
===================================================================
--- m4/ifunction.m4	(Revision 170897)
+++ m4/ifunction.m4	(Arbeitskopie)
@@ -116,7 +116,7 @@ 
       count[n] = 0;
       dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
       if (extent[n] <= 0)
-	len = 0;
+	return;
     }
 
   base = array->data;