Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re: ocaml build failure on ia64 with gcc4 #3750

Closed
vicuna opened this issue Aug 11, 2005 · 2 comments
Closed

Re: ocaml build failure on ia64 with gcc4 #3750

vicuna opened this issue Aug 11, 2005 · 2 comments
Labels

Comments

@vicuna
Copy link

vicuna commented Aug 11, 2005

Original bug ID: 3750
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)

Bug description

On Wed, 2005-08-10 at 19:13 +0200, Julien Cristau wrote:

Hi,

the ocaml debian package fails to build on ia64 with the new gcc, with
errors in byterun/interp.c:
gcc -DCAML_NAME_SPACE -O -fno-defer-pop -Wall -D_FILE_OFFSET_BITS=64 -D_REENTRANT -c -o interp.o interp.c
interp.c: In function 'caml_interprete':
interp.c:297: error: invalid lvalue in increment
interp.c:299: error: invalid lvalue in increment
interp.c:301: error: invalid lvalue in increment
interp.c:303: error: invalid lvalue in increment
...

(A full build log is available at
http://buildd.debian.org/fetch.php?&pkg=ocaml&ver=3.08.3-6&arch=ia64&stamp=1123386582&file=log&as=raw)

The problem seems to be the "Next" macro, which is different on ia64
than on other archs:

ifdef DEBUG

define Next goto next_instr

else

ifdef ia64

define Next goto *(void *)(jumptbl_base + *((uint32 *) pc)++)

else

define Next goto *(void *)(jumptbl_base + *pc++)

endif

endif

I believe that using the following on ia64 instead should work, but
since I am no expert, I'd like to get the caml team's advice :)
(I don't really understand why this cast is there,

The bug is:

(uint32*)pc

is an rvalue and cannot be incremented. If this EVER worked
on a C compiler, that compiler is bugged.

--
John Skaller


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)

iD8DBQBC+rJasRp8/9aGVGsRAmUvAJ44XAf5Dm56osvHvIujEzmXl+IErQCZAXy/
xoCnYdGgqs6rsxs66NUrVSM=
=EJoE
-----END PGP SIGNATURE-----



@vicuna
Copy link
Author

vicuna commented Aug 11, 2005

Comment author: administrator

The bug is:
(uint32*)pc
is an rvalue and cannot be incremented. If this EVER worked
on a C compiler, that compiler is bugged.

It worked in gcc over a 20-year period, from version 1.0 to 3.4.
(Look up "Generalized lvalues" in the GCC Info doc.)

I agree this extension is more dangerous than useful (the problematic
line in interp.c was really an error that gcc let pass), but I find
your astonishement mildly amusing.

  • Xavier Leroy

@vicuna
Copy link
Author

vicuna commented Aug 11, 2005

Comment author: administrator

see also #3749, #3751

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant