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]

[gfortran,commited] Don't perform bounds-checking on assumed-size arrays


Hi all,

I just reviewed and commited Andrew's patch for PR fortran/19777 (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19777), proposed on bugzilla. It's a simple one-line that disables bounds-checking when accessing elements of a assumed-size array:

--- trunk/gcc/fortran/trans-array.c 2006/05/27 09:06:01 114152
+++ trunk/gcc/fortran/trans-array.c 2006/05/27 09:41:42 114153
@@ -1948,7 +1948,7 @@
gfc_conv_expr_type (&indexse, ar->start[n], gfc_array_index_type);
gfc_add_block_to_block (&se->pre, &indexse.pre);


-      if (flag_bounds_check)
+      if (flag_bounds_check && ar->as->type != AS_ASSUMED_SIZE)
 	{
 	  /* Check array bounds.  */
 	  tree cond;

It was regtested on i686-linux and comes with a testcase.


Thanks Andrew! I'll be looking into other -fbounds-check bugs in the near future (and probably will make a patch so that out-of-bounds messages feature the name of the variable involved, as well as the source file and line where the error occured), if you have comments and/or ideas, please send them!

FX


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