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

[Bug ada/48835] Porting GNAT to GNU/Linux/m68k


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48835

--- Comment #11 from Eric Botcazou <ebotcazou at gcc dot gnu.org> 2011-06-14 08:44:12 UTC ---
> In that case the Ada side of __gnat_malloc has to be changed to use a pointer
> type rather than Address.  Is Interfaces.C.Strings.chars_ptr acceptible, or is
> there a better approximation for void* somewhere?

The problem is that pointers drag a heavy machinery in Ada (to make it
impossible to introduce the dangling sub-species) so low-level routines don't
really want to use pointers, as they (are supposed to) know what they are
doing.

> The effect is that a pointer-valued callee returns its value in both %a0 and
> %d0.  A caller that has seen the pointer-valued prototype picks up the value
> from %a0, but a caller that hasn't seen that prototype picks it up from %d0. 

I see, thanks.  What about creating a machine-specific attribute, tentatively
named "pointer return", that a m68k-specific version of s-memory.ads would put
on the problematic functions?  GNAT already supports machine-specific
attributes.  The effect would be the same as the one implemented in
m68k_function_value.


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