------- Comment #16 from dave at hiauly1 dot hia dot nrc dot ca 2008-10-25 01:11 ------- Subject: Re: [4.4 Regression] Small structs are not passed correctly on hppa64-*-*
> Can you please look at the testcases why they fail (what is passed > differently) > and try to minimize them as much as possible? Finding a bug in RTL or > assembly > without knowing what you are looking for is certainly harder than when you > have > a debugger and can see what is passed differently... The following is a simplification of the first failure in gcc.dg/compat/scalar-by-value-4. _Complex char g01cc; void initcc (_Complex char *p, _Complex char v) { *p = v + (0 + 1 * __extension__ 1i); } void checkcc (_Complex char x, _Complex char v) { if (x != v + (0 + 1 * __extension__ 1i)) abort (); } void checkgcc (void) { checkcc (g01cc, 1); } int main () { initcc (&g01cc, 1); checkgcc (); return 0; } The first argument passed to checkcc is wrong. The value passed in r26 (the first argument register) is 1. 4.3.2 passed 0x101. The value passed for v is 0x100 in both versions. Now, as I understand the 64-bit runtime specification for hppa64-hpux, neither GCC version is correct. However, I don't believe HP cc or aCC supports integer complex values, so I can't check for consistency. My understanding is that small structs and aggregates should be left justified. This unfortunately differs from the right justification used on most big endian targets. I believe tha correct value for x and v should be 0x0101000000000000 and 0x010000000000000, respectively. I have checked that the struct { byte x; byte y } is correctly left justified. Dave -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37316