t/pmc/bigint.t failures with an clang on optimized build on Ubuntu #744

Closed
leto opened this Issue Mar 19, 2012 · 10 comments

Projects

None yet

3 participants

@leto
Parrot Virtual Machine member
#   Failed test 'set overflow Integer'
#   at t/pmc/bignum.t line 1035.
# Exited with error code: 1
# Received:
# error:imcc:add_1_const:Integer overflow '9223372036854775808'
#   in file '/home/leto/git/parrot/t/pmc/bignum_35.pasm' line 10
# 
# Expected:
# ok
# 
$ git rev-parse HEAD
b714b9044d4d67b9377216e705043aa619df9a2c
$ uname -a
Linux datura 2.6.32-35-generic #78-Ubuntu SMP Tue Oct 11 16:11:24 UTC 2011 x86_64 GNU/Linux
@leto
Parrot Virtual Machine member
$ clang --version
clang version 1.1 (branches/release_27)
Target: x86_64-pc-linux-gnu
Thread model: posix
@leto
Parrot Virtual Machine member

My current hunch is that this is from some questionable casting. There are many casting warnings when compiling an optimized parrot with clang.

@Benabik
Parrot Virtual Machine member

Also occurs for me on OS X with gcc 4.2.1

@leto
Parrot Virtual Machine member

This no longer happens for me. @benabik can you confirm that you are no longer seeing this?

@Benabik
Parrot Virtual Machine member
#   Failed test 'set overflow Integer'
#   at t/pmc/bignum.t line 1035.
# error:imcc:add_1_const:Integer overflow '9223372036854775808'
#   in file '/Users/brian/dev/parrot/parrot/t/pmc/bignum_35.pasm' line 10

gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
@leto
Parrot Virtual Machine member

@Benabik which versions of GMP does this happen on for you?

@rurban
Parrot Virtual Machine member

My libgmp: GMP 5.0.5
I cannot repro this on ubuntu with a clang 3.2

clang version 3.2 (trunk 167594)
Target: x86_64-unknown-linux-gnu
Thread model: posix

nor on darwin 10.8 with their clang:

$ clang --version
Apple clang version 4.1 (tags/Apple/clang-421.11.66) (based on LLVM 3.1svn)
Target: x86_64-apple-darwin12.2.1
Thread model: posix

nor on darwin with their llvm-gcc (which looks similar to benabiks)

$ gcc --version
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)

nor with all my recent gcc's and clang's on darwin.
So it looks it's a libgmp problem.

@Benabik
Parrot Virtual Machine member

@leto: 5.0.5 installed via homebrew, and --optimize=-O2 --debugging=0 given to configure.

@rurban rurban self-assigned this Mar 6, 2014
@rurban
Parrot Virtual Machine member

I can repro it now. travis also caught it. https://travis-ci.org/parrot/parrot/jobs/20232247

Fixed in branch smoke-me/clang-inc-opt-gh774 a1c0935

@rurban
Parrot Virtual Machine member

Fixed with commit 84807d1
Author: Reini Urban rurban@cpanel.net
Date: Thu Mar 6 17:20:58 2014 -0600

fix clang optimizer increment issue GH #774

have to use volatile scratch registers in Parrot_Integer_increment_orig to avoid
skipping overflow sementics: -1 => MAXINT
fixes t/pmc/bigint.t test negate_min_integer
@rurban rurban closed this Mar 7, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment