Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[perl #64930] Weird error building rakudo

0 views
Skip to first unread message

Paco Linux

unread,
Apr 21, 2009, 10:41:22 AM4/21/09
to bugs-bi...@netlabs.develooper.com
# New Ticket Created by "Paco Linux"
# Please include the string: [perl #64930]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=64930 >


Hi:

I'm having a very weird error while building latest rakudo with parrot
r38208 (gcc 4.1.3 20070929) :

cc -c -o perl6_ops_cg.o -I/tmp/rakudo/parrot/include
-I/tmp/rakudo/parrot/src/pmc -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS
-DDEBIAN -pipe -I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -DHASATTRIBUTE_CONST -DHASATTRIBUTE_DEPRECATED
-DHASATTRIBUTE_MALLOC -DHASATTRIBUTE_NONNULL -DHASATTRIBUTE_NORETURN
-DHASATTRIBUTE_PURE -DHASATTRIBUTE_UNUSED
-DHASATTRIBUTE_WARN_UNUSED_RESULT -falign-functions=16 -fvisibility=hidden
-funit-at-a-time -maccumulate-outgoing-args -W -Wall -Waggregate-return
-Wcast-align -Wcast-qual -Wchar-subscripts -Wcomment -Wdisabled-optimization
-Wendif-labels -Wextra -Wformat -Wformat-extra-args -Wformat-nonliteral
-Wformat-security -Wformat-y2k -Wimplicit -Wimport -Winit-self -Winline
-Winvalid-pch -Wmissing-braces -Wmissing-field-initializers
-Wno-missing-format-attribute -Wmissing-include-dirs -Wpacked -Wparentheses
-Wpointer-arith -Wreturn-type -Wsequence-point -Wno-shadow -Wsign-compare
-Wstrict-aliasing -Wstrict-aliasing=2 -Wswitch -Wswitch-default -Wtrigraphs
-Wundef -Wunknown-pragmas -Wno-unused -Wvariadic-macros -Wwrite-strings
-Wbad-function-cast -Wc++-compat -Wdeclaration-after-statement
-Wimplicit-function-declaration -Wimplicit-int -Wmain -Wmissing-declarations
-Wmissing-prototypes -Wnested-externs -Wnonnull -Wold-style-definition
-Wstrict-prototypes -DHAS_GETTEXT -fPIC -g -DHAS_JIT -DI386
-DHAVE_COMPUTED_GOTO perl6_ops_cg.c
perl6.ops: In function 'cg_perl6':
perl6.ops:128: warning: assignment discards qualifiers from pointer target
type
perl6.ops:128: warning: assignment discards qualifiers from pointer target
type
perl6.ops:218: error: unable to find a register to spill in class 'SIREG'
perl6.ops:218: error: this is the insn:
(insn 2620 2619 2621 138 perl6.ops:151 (parallel [
(set (reg:CC 17 flags)
(compare:CC (mem:BLK (reg/f:SI 3049 [ cstr ]) [0 A8])
(mem/s/j:BLK (reg/f:SI 3050) [0 A8])))
(use (reg:SI 3051))
(use (const_int 1 [0x1]))
(use (reg:SI 19 dirflag))
(clobber (reg/f:SI 3049 [ cstr ]))
(clobber (reg/f:SI 3050))
(clobber (reg:SI 3051))
]) 720 {*cmpstrnqi_nz_1} (nil)
(expr_list:REG_UNUSED (reg:SI 3051)
(expr_list:REG_UNUSED (reg/f:SI 3050)
(expr_list:REG_UNUSED (reg/f:SI 3049 [ cstr ])
(expr_list:REG_DEAD (reg:SI 19 dirflag)
(expr_list:REG_DEAD (reg:SI 3051)
(expr_list:REG_DEAD (reg/f:SI 3049 [ cstr ])
(expr_list:REG_DEAD (reg/f:SI 3050)
(expr_list:REG_UNUSED (reg:SI 3051)
(expr_list:REG_UNUSED (reg/f:SI 3050)
(expr_list:REG_UNUSED (reg/f:SI 3049
[ cstr ])
(nil))))))))))))
perl6.ops:218: confused by earlier errors, bailing out

In /parrot/languages/rakudo/src/ops/perl6.ops there is this comment :


73 /* Using memcpy here may trigger gcc optimizations, which at
this point
74 * can wreak havoc on register-starved x86:
75 * error: unable to find a register to spill in class 'SIREG'
76 * Use memmove instead, which is slower, but isn't inlined by
gcc. */

I have tried in other machines and have no problem, so I think is a problem
of this version of gcc

paco@javier:/tmp/rakudo$ gcc --version
gcc (GCC) 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

The problem went away using other switches while compiling rakudo (using
--optimize) and the spectest :

All tests successful.
Files=373, Tests=12884, 909 wallclock secs (10.10 usr 1.25 sys + 1605.36
cusr 59.56 csys = 1676.27 CPU)
Result: PASS


/rakudo/parrot$ cat myconfig
Summary of my parrot 1.0.0 (r38208) configuration:
configdate='Tue Apr 21 13:52:08 2009 GMT'
Platform:
osname=linux, archname=i486-linux-gnu-thread-multi
jitcapable=1, jitarchname=i386-linux,
jitosname=LINUX, jitcpuarch=i386
execcapable=1
perl=/usr/bin/perl
Compiler:
cc='cc', ccflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS
-DDEBIAN -pipe -I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -DHASATTRIBUTE_CONST -DHASATTRIBUTE_DEPRECATED
-DHASATTRIBUTE_MALLOC -DHASATTRIBUTE_NONNULL -DHASATTRIBUTE_NORETURN
-DHASATTRIBUTE_PURE -DHASATTRIBUTE_UNUSED
-DHASATTRIBUTE_WARN_UNUSED_RESULT -falign-functions=16 -fvisibility=hidden
-funit-at-a-time -maccumulate-outgoing-args -W -Wall -Waggregate-return
-Wcast-align -Wcast-qual -Wchar-subscripts -Wcomment -Wdisabled-optimization
-Wendif-labels -Wextra -Wformat -Wformat-extra-args -Wformat-nonliteral
-Wformat-security -Wformat-y2k -Wimplicit -Wimport -Winit-self -Winline
-Winvalid-pch -Wmissing-braces -Wmissing-field-initializers
-Wno-missing-format-attribute -Wmissing-include-dirs -Wpacked -Wparentheses
-Wpointer-arith -Wreturn-type -Wsequence-point -Wno-shadow -Wsign-compare
-Wstrict-aliasing -Wstrict-aliasing=2 -Wswitch -Wswitch-default -Wtrigraphs
-Wundef -Wunknown-pragmas -Wno-unused -Wvariadic-macros -Wwrite-strings
-Wbad-function-cast -Wc++-compat -Wdeclaration-after-statement
-Wimplicit-function-declaration -Wimplicit-int -Wmain -Wmissing-declarations
-Wmissing-prototypes -Wnested-externs -Wnonnull -Wold-style-definition
-Wstrict-prototypes -DHAS_GETTEXT',
Linker and Libraries:
ld='cc', ldflags=' -L/usr/local/lib',
cc_ldflags='',
libs='-ldl -lm -lpthread -lcrypt -lgmp -lreadline '
Dynamic Linking:
share_ext='.so', ld_share_flags='-shared -L/usr/local/lib -fPIC',
load_ext='.so', ld_load_flags='-shared -L/usr/local/lib -fPIC'
Types:
iv=long, intvalsize=4, intsize=4, opcode_t=long, opcode_t_size=4,
ptrsize=4, ptr_alignment=1 byteorder=1234,
nv=double, numvalsize=8, doublesize=8, longdoublesize=12

Paco

--
|_|0|_|
|_|_|0|
|0|0|0|

Havard Eidnes via RT

unread,
May 17, 2009, 3:17:00 PM5/17/09
to perl6-c...@perl.org
On Tir. 21. Apr. 2009 07:41:21, PacoLinux wrote:
> Hi:
>
> I'm having a very weird error while building latest rakudo with parrot
> r38208 (gcc 4.1.3 20070929) :

I'm seeing the same problem with gcc version 4.1.2 20061021 prerelease
(NetBSD nb3 20061125), i.e. the system compiler on NetBSD/i386 4.0.

In my case, I found out that what caused the error was not optimization,
but a lack of optimization -- you'll see that the gcc invocation does
not specify any -O option. After some hints from the friendly souls on
#parrot, I found out a way to work around this problem:

perl ./Configure.pl --gen-parrot --gen-parrot-option=--optimize

in the rakudo root directory. That way, the relevant file gets compiled
with optimization (together with most if not all the others...), and the
build completes and produces a perl6 executable which so far is working
for me (running spectests now).

Yes, this is actually a gcc bug...

Hope this helps,

- Håvard

jnthn@jnthn.net via RT

unread,
Jun 3, 2009, 1:42:17 PM6/3/09
to perl6-c...@perl.org
Yup, and there's no obvious workaround we can do in the code. So, going
to close this ticket as resolved since we have a good enough workaround,
and I did add to the Get Rakudo page at:
http://www.rakudo.org/how-to-get-rakudo
Where hopefully people will notice it and be able to work around it.

Thanks,

Jonathan

0 new messages