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]

expand_expr: mode of returned value


Hello,

On a new port I ran into a problem. It has ptr_mode != Pmode. When expanding
a builtin memcpy, the result of expand_expr has mode Pmode. The natural mode
would have been ptr_mode.

This caused a problem in precompute_register_parameters where there is an
assumption that the result is in its native mode.

Regarding the parameter TMODE of expand_expr there is a comment. TMODE is only
a suggestion.  "callers must assume that the rtx returned may not have mode
TMODE".

I do not fully understand the implications of this comment. What behaviour of
expand_expr is allowed. 

The best interpretation I have is:
if (TMODE == VOIDmode)
{ the result of expand_expr is in its native mode }
else
{ the result is in its native mode or in TMODE }

Is this interpretation correct ?

If yes, there are some errors in builtins.c
If no, there are some errors in calls.c

        Erwin

Erwin Unruh, Fujitsu Siemens Computers, C/C++ compiler group


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