eval.c unaligned access on alpha

0 views
Skip to first unread message

Matthew Luckie

unread,
Jan 4, 2008, 5:49:03 PM1/4/08
to vim...@vim.org
When I start vim 7.1.175 on my alpha running freebsd, I see a bunch of
unaligned accesses:

pid 74601 (vim): unaligned access: va=0x1202898cd pc=0x120057068
ra=0x120057044 op=ldl
pid 74601 (vim): unaligned access: va=0x1202898cd pc=0x12005708c
ra=0x12005707c op=ldl
pid 74601 (vim): unaligned access: va=0x1202d406d pc=0x120057068
ra=0x120057044 op=ldl
pid 74601 (vim): unaligned access: va=0x1202d406d pc=0x12005708c
ra=0x12005707c op=ldl
pid 74601 (vim): unaligned access: va=0x1202d428d pc=0x120057068
ra=0x120057044 op=ldl
pid 74601 (vim): unaligned access: va=0x1202d428d pc=0x12005708c
ra=0x12005707c op=ldl

The following patch stops these messages. To be honest, I'm not sure
I've got this right, as all I've done is expand the HI2DI a little. The
goal I had with this patch was to be able to inspect the di value in gdb
to see about its alignment. But I found that the simple expansion also
stopped the unaligned accesses.

Thoughts?

Matthew

--- src/eval.c.orig Sat Jan 5 09:33:04 2008
+++ src/eval.c Sat Jan 5 09:39:55 2008
@@ -3380,6 +3380,7 @@
char_u *name;
int forceit;
{
+ dictitem_T *di;
hashtab_T *ht;
hashitem_T *hi;
char_u *varname;
@@ -3390,9 +3391,10 @@
hi = hash_find(ht, varname);
if (!HASHITEM_EMPTY(hi))
{
- if (var_check_fixed(HI2DI(hi)->di_flags, name))
+ di = HIKEY2DI(hi->hi_key);
+ if (var_check_fixed(di->di_flags, name))
return FAIL;
- if (var_check_ro(HI2DI(hi)->di_flags, name))
+ if (var_check_ro(di->di_flags, name))
return FAIL;
delete_var(ht, hi);
return OK;

Bram Moolenaar

unread,
Jan 5, 2008, 8:06:32 AM1/5/08
to Matthew Luckie, vim...@vim.org

Matthew Luckie wrote:

> When I start vim 7.1.175 on my alpha running freebsd, I see a bunch of
> unaligned accesses:
>
> pid 74601 (vim): unaligned access: va=0x1202898cd pc=0x120057068
> ra=0x120057044 op=ldl
> pid 74601 (vim): unaligned access: va=0x1202898cd pc=0x12005708c
> ra=0x12005707c op=ldl
> pid 74601 (vim): unaligned access: va=0x1202d406d pc=0x120057068
> ra=0x120057044 op=ldl
> pid 74601 (vim): unaligned access: va=0x1202d406d pc=0x12005708c
> ra=0x12005707c op=ldl
> pid 74601 (vim): unaligned access: va=0x1202d428d pc=0x120057068
> ra=0x120057044 op=ldl
> pid 74601 (vim): unaligned access: va=0x1202d428d pc=0x12005708c
> ra=0x12005707c op=ldl
>
> The following patch stops these messages. To be honest, I'm not sure
> I've got this right, as all I've done is expand the HI2DI a little. The
> goal I had with this patch was to be able to inspect the di value in gdb
> to see about its alignment. But I found that the simple expansion also
> stopped the unaligned accesses.
>
> Thoughts?

What happens with the accesses is the same, so I guess it must be a
compiler problem that you work around.

Did you try with and without optimizer? When compiling for gdb you may
have also disabled the optimizer.

I'll gladly include the change in Vim, invoking HI2DI() twice wasn't
nice anyway.

--
There are 2 kinds of people in my world: those who know Unix, Perl, Vim, GNU,
Linux, etc, and those who know COBOL. It gets very difficult for me at
parties, not knowing which group to socialise with :-)
Sitaram Chamarty

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ download, build and distribute -- http://www.A-A-P.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Matthew Luckie

unread,
Jan 5, 2008, 2:44:04 PM1/5/08
to Bram Moolenaar, vim...@vim.org
Bram Moolenaar wrote:
> Matthew Luckie wrote:
>
>> When I start vim 7.1.175 on my alpha running freebsd, I see a bunch of
>> unaligned accesses:
>>
>> pid 74601 (vim): unaligned access: va=0x1202898cd pc=0x120057068
>> ra=0x120057044 op=ldl
>> pid 74601 (vim): unaligned access: va=0x1202898cd pc=0x12005708c
>> ra=0x12005707c op=ldl
>> pid 74601 (vim): unaligned access: va=0x1202d406d pc=0x120057068
>> ra=0x120057044 op=ldl
>> pid 74601 (vim): unaligned access: va=0x1202d406d pc=0x12005708c
>> ra=0x12005707c op=ldl
>> pid 74601 (vim): unaligned access: va=0x1202d428d pc=0x120057068
>> ra=0x120057044 op=ldl
>> pid 74601 (vim): unaligned access: va=0x1202d428d pc=0x12005708c
>> ra=0x12005707c op=ldl
>>
>> The following patch stops these messages. To be honest, I'm not sure
>> I've got this right, as all I've done is expand the HI2DI a little. The
>> goal I had with this patch was to be able to inspect the di value in gdb
>> to see about its alignment. But I found that the simple expansion also
>> stopped the unaligned accesses.
>>
>> Thoughts?
>
> What happens with the accesses is the same, so I guess it must be a
> compiler problem that you work around.

I'm using gcc 3.4.4 (freebsd 6.1)

I had figured something along the lines of a compiler problem but wasn't
going to jump to that conclusion without running it past vim-dev first.

> Did you try with and without optimizer? When compiling for gdb you may
> have also disabled the optimizer.

I built with -O -g

> I'll gladly include the change in Vim, invoking HI2DI() twice wasn't
> nice anyway.

Thanks!

Matthew

Reply all
Reply to author
Forward
0 new messages