Ticket #716 (closed patch: fixed)

Opened 13 years ago

Last modified 13 years ago

[PATCH] Remove incorrect check for function pointer alignment

Reported by: doughera Owned by:
Priority: minor Milestone:
Component: configure Version: 1.2.0
Severity: low Keywords:
Cc: Language:
Patch status: applied Platform:


Configure.pl currently sets HAS_aligned_funcptr if the user is using gcc (but not on HPUX). The only place it is used is src/multidispatch.c, which checks if the func_ptr & 3 == 0.

This is wrong on several fronts. First, other compilers/architectures/operating systems can certainly use aligned function pointers. Second, the number '3' is, in general, wrong. Gcc's -faligned-functions[=n] option can take a variety of 'n' values (and can implicitly be set to different values by other options, such as -O[n].) The Configure.pl setting ignores all that.

If we really cared about the exact number, we should write a Configure test to actually measure the alignment using the full set of compiler flags that will be used to build parrot. The ASSERT in src/multidispatch.c would then be altered to use the measured alignment number.

Failing that, however, it makes sense to just delete the inaccurate ASSERT and the corresponding Configure.pl stuff. The attached patch does just that.


tt716-remove-aligned-funcptr.patch Download (1.9 KB) - added by doughera 13 years ago.

Change History

Changed 13 years ago by doughera

Changed 13 years ago by Infinoid

  • status changed from new to closed
  • resolution set to fixed
  • patch changed from new to applied

Thanks, applied as r39219. skids++ was in the IRC channel last week, reporting assertion failures from this on linux/ia64. This should hopefully solve the issue there too.

Note: See TracTickets for help on using tickets.