[fortran PATCH] Reduce NON_LVALUE_EXPR usage in array indices
roger@eyesopen.com
roger@eyesopen.com
Mon Dec 18 18:03:00 GMT 2006
As shown in my post of just a few minutes ago, gfortran has a habit of
producing initial statement trees that look like:
(*a)[NON_LVALUE_EXPR <S.0> + -1] = 0;
whilst prefectly valid, the NON_LVALUE_EXPR tends to make debugging fortran
array dependencies slightly harder than they need to be. The source of these
nodes is fold, which when simplifying 1*x and x+0 uses this annotation to
assist the C/C++ front-ends from thinking that the returned "x" is a
potential lvalue.
The patch below simply catches a few of the places where these
NON_LVALUE_EXPR trees nodes are accidentally created, which should reduce
memory usage and makes the dumps slightly easier to read...
(*a)[S.0 + -1] = 0;
The following patch has been tested on i686-pc-linux-gnu with a full
"make bootstrap", all languages including gfortran, and regression tested
with a top-level "make -k check" with no new failures.
Ok for mainline?
2006-12-16 Roger Sayle <roger@eyesopen.com>
* trans-array.c (gfc_conv_array_index_offset): Avoid multiplying
index by one, or adding zero to it.
Roger
--
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patchf.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20061218/ed043fa8/attachment.txt>
More information about the Gcc-patches
mailing list