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: [gfortran,patch] PR 27895, compile-time bounds checking for array section


On Mon, Jun 05, 2006 at 10:16:58PM +0200, FX Coudert wrote:
> Much improved patch for the same problem, with the same description.  
> I also fixed the case of:
>       print *, a(-5:-5:n)
> which will now give a warning even if we don't know the value of n.
> 
> OK for mainline and 4.1?
> 

This is OK with one minor formatting change.

 
+#define AR_START (ar->start[i] ? ar->start[i] : as->lower[i])
+#define AR_END (ar->end[i] ? ar->end[i] : as->upper[i])
+
+      if (compare_bound (AR_START, AR_END) == CMP_EQ &&
+	  (compare_bound (AR_START, as->lower[i]) == CMP_LT
+	   || compare_bound (AR_START, as->upper[i]) == CMP_GT))
 	goto bound;

The formatting is a little off here.  The && should start the
next line.

-- 
Steve


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