Skip to content
This repository

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

Closed
leto opened this Issue March 18, 2012 · 10 comments

3 participants

Duke Leto Reini Urban Brian Gernhardt
Duke Leto
Owner
leto commented March 18, 2012
#   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
Duke Leto
Owner
leto commented March 18, 2012
$ clang --version
clang version 1.1 (branches/release_27)
Target: x86_64-pc-linux-gnu
Thread model: posix
Duke Leto
Owner
leto commented March 23, 2012

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

Brian Gernhardt
Collaborator
Benabik commented May 23, 2012

Also occurs for me on OS X with gcc 4.2.1

Duke Leto
Owner

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

Brian Gernhardt
Collaborator
#   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)
Duke Leto
Owner

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

Reini Urban
Collaborator

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.

Brian Gernhardt
Collaborator

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

Reini Urban
Collaborator

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

Reini Urban
Collaborator

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
Reini Urban rurban closed this March 07, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.