gpc-20030830 and packed records

Prof A Olowofoyeku (The African Chief) chiefsoft at bigfoot.com
Sun Dec 14 09:35:16 CET 2003


On 14 Dec 2003 at 0:56, Waldek Hebisch wrote:

[...]
> Address have to be properly aligned. Unaligned reference may couse crash
> (some RISC machines, notably SPARC and AFAIK early PPC) or data
> corruption (ARM). If the backend belives that data is aligned it may
> generate fullword access even for characters (when copying arrays). So
> GPC would have to duplicate backend checks and accept/reject program
> depending on target characteristics. ATM I can not say how hard would be
> to implement such behaviour, but the end result look really like a loss:

Previous versions of GPC permitted this, and the code worked correctly 
both on Sparc (Solaris) and x86 (Windows and Linux). So it would seem 
that all that needs to happen is for what was done in recent times to 
be undone when not using any of the ISO standards.

 > 1) program correctness would depend on rather on rather complex 
>    platform dependent alignment rules
> 
> 2) program portability would decline
> 
> 3) small modifications to data layout would convert valid program
>    into invalid one

I am not sure about any of these. But what has happened is that the new 
restrictions have broken code that has existed and worked happily under 
GPC for a very long time.
 
> IMHO it much better to restructure the program. For example just use
> auxilary variable 

That would be quite tedious, but it might well be what I will have to 
do (or use older versions of GPC for the affected code).

> and copy the field (or pack/unpack the whole record)
> when needed. 

I am not sure how to do that ...

Best regards, The Chief
--------
Prof. Abimbola A. Olowofoyeku (The African Chief) 
web:  http://www.bigfoot.com/~african_chief/




More information about the Gpc mailing list