This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch PR libfortran/30321


On Sat, Dec 30, 2006 at 11:08:28AM +0100, FX Coudert wrote:

> OK.

Thanks!

> One question, though, about the following bit of code:

> 
> +	  /* Make sure we have a zero-sized array.  */
> +	  retarray->dim[0].lbound = 0;
> +	  retarray->dim[0].ubound = -1;
> +	  return;
> 
> I made a patch (actually, patches) similar to yours for SPREAD,  
> TRANSPOSE and other such array transformational intrinsics, and I  
> never included this kind of code because I believe the front-end is  
> responsible for setting this up. Do you have a testcase that fails if  
> this code is removed, or did you just add it to be on the safe side?

I did this because gdb showed (in sum_i4)

(gdb) p *retarray
$3 = {data = 0x0, offset = 0, dtype = 265, dim = {{stride = -1080502368,
      lbound = -1208591744, ubound = -1208591738}, {stride = -1080502392,
      lbound = 134515399, ubound = 1}, {stride = -1080502252,
      lbound = -1080502376, ubound = 134515529}, {stride = -1210159988,
      lbound = -1080502368, ubound = -1080502296}, {stride = -1210118488,
      lbound = 0, ubound = -1208034112}, {stride = -1080502296,
      lbound = -1210118488, ubound = 1}, {stride = -1080502252,
      lbound = -1080502244, ubound = 0}}}

which is clearly bogus.

> I hope you get me right, I have absolutely nothing against being on  
> the safe side, of course :)  I'm just wondering if the code for the  
> intrinsics I once patched still has to be patched...

I think it depends on the particular library code (the front end
doesn't do a lot for this)..  From a quick check, TRANSPOSE and
CSHIFT appear to be OK.

	Thomas


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]