[ast-optimizer-branch] PATCH to simplify array base
Fri Jun 7 23:04:00 GMT 2002
We haven't been simplifying array bases, but we should. Given an
expression like k.d where k.d is of type int, this will now
t1 = &k.d;
t2 = (*t1);
This is still an extension from the published SIMPLE grammar, but I believe
this was omitted there because the McCAT version of ARRAY_REF takes a
POINTER_TYPE argument, whereas the gcc version takes an ARRAY_TYPE. It
seems to me that it would make sense for gcc to support POINTER_TYPE
arguments as well, so that we can retain information about array indexing
off of pointers, but that can wait.
Booted and tested i686-pc-linux-gnu, applied ast-optimizer-branch.
2002-06-08 Jason Merrill <email@example.com>
* tree-simple.c (is_simple_arraybase): New function.
(is_simple_arrayref): Use it to check the array base again.
* tree-simple.h: Add declaration.
* c-simplify.c (simplify_array_ref): Do simplify the base.
* expr.c (expand_expr): First make sure the type has a size.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 6167 bytes
Desc: not available
More information about the Gcc-patches