This is the mail archive of the gcc@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]

Question on aggregates and GIMPLE


Suppose I have a MODIFY_EXPR whose RHS is a VIEW_CONVERT_EXPR of some
aggregate type (say a RECORD_TYPE) whose operand is an INDIRECT_REF.
If the size of the type is variable, the MODIFY_EXPR will be converted
to a call to built in memcpy.  But it it's fixed size, we'll end up
making a temporary for the RHS or the INDIRECT_REF.  But that temporary
might be an ARRAY_TYPE (which will cause an ICE) and might be very large
megabytes.  Is that the intent?

Does the same transformation for variable-sized types have to be done
for comparisons of aggregate objects too?  I don't see any code to
call built in memcmp.  And then you have the above issue.

Also, the call when converting to the memcpy call is missing the
use of SUBSTITUTE_EXPR_IN_PLACEHOLDER when getting the size: there
are routines elsewhere in the compiler that do it right and should
be called instead (such as expr_size).

What's the best way to deal with these issues?


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