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

[perl #41328] [BUG] pmc2c generates unnecessary code for void functions

5 views
Skip to first unread message

Jerry Gay

unread,
Jan 23, 2007, 5:20:22 PM1/23/07
to bugs-bi...@rt.perl.org
# New Ticket Created by Jerry Gay
# Please include the string: [perl #41328]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=41328 >


when compiling src/pmc/pmethod.c, cl has a few warnings:

src\pmc\pmethod_test.c
D:/usr\local\parrot\bug\tools\build\../../lib\Parrot\Pmc2c\Utils.pm(1096) : warn
ing C4102: 'test_method0_returns' : unreferenced label
D:/usr\local\parrot\bug\tools\build\../../lib\Parrot\Pmc2c\Utils.pm(1063) : warn
ing C4101: 'pc' : unreferenced local variable
D:/usr\local\parrot\bug\tools\build\../../lib\Parrot\Pmc2c\Utils.pm(1096) : warn
ing C4102: 'test_method1_returns' : unreferenced label
D:/usr\local\parrot\bug\tools\build\../../lib\Parrot\Pmc2c\Utils.pm(1063) : warn
ing C4101: 'pc' : unreferenced local variable
D:/usr\local\parrot\bug\tools\build\../../lib\Parrot\Pmc2c\Utils.pm(1063) : warn
ing C4101: 'pc' : unreferenced local variable
D:/usr\local\parrot\bug\tools\build\../../lib\Parrot\Pmc2c\Utils.pm(1096) : warn
ing C4102: 'test_method3_returns' : unreferenced label
D:/usr\local\parrot\bug\tools\build\../../lib\Parrot\Pmc2c\Utils.pm(1063) : warn
ing C4101: 'pc' : unreferenced local variable
D:/usr\local\parrot\bug\tools\build\../../lib\Parrot\Pmc2c\Utils.pm(1096) : warn
ing C4102: 'test_method4_returns' : unreferenced label
D:/usr\local\parrot\bug\tools\build\../../lib\Parrot\Pmc2c\Utils.pm(1063) : warn
ing C4101: 'pc' : unreferenced local variable

it seems the pmc2c code for PMETHODs is generating some unnecessary code.
~jerry

James Keenan via RT

unread,
Jan 23, 2007, 7:16:02 PM1/23/07
to perl6-i...@perl.org
On Tue Jan 23 14:20:21 2007, particle wrote:
> when compiling src/pmc/pmethod.c, cl has a few warnings:
>
> src\pmc\pmethod_test.c
> D:/usr\local\parrot\bug\tools\build\../../lib\Parrot\Pmc2c\Utils.pm(1096)
> : warn
> ing C4102: 'test_method0_returns' : unreferenced label
> [snip]

> it seems the pmc2c code for PMETHODs is generating some unnecessary
> code.
> ~jerry

In r16676 on January 17, approximately 375 lines of code -- including the code cited above
-- was added to lib/Parrot/Pmc2c/Utils.pm. This code was added after my new submission
of Parrot::Pmc2c::Utils was accepted. The submission increased the number of lines in that
package by approximately 26%. However, the new code was committed to trunk without
having new tests written for it. Along with my original submission, I provided a test suite in
t/tools/pmc2c/utils/ which demonstrated that code's validity.

I would recommend that the additional code in Parrot::Pmc2c::Utils be backed out of trunk
and developed, along with corroborating tests, in a branch and only committed to trunk
when it has passed appropriate tests.

kid51


James Keenan via RT

unread,
Mar 16, 2007, 9:31:54 PM3/16/07
to perl6-i...@perl.org
1. I check out a fresh copy from HEAD at r17522. In this revision the first 11 lines of @steps
in Configure.pl look like this:

my @steps = qw(
init::manifest
init::defaults
init::install
init::miniparrot
inter::progs
init::hints
init::headers
inter::make
inter::lex
inter::yacc
...

2. Following my practice for last four months, I configure in this way recommended for
Darwin PPC by coke:

#!/bin/sh
CC="/usr/bin/gcc-3.3"
CX="/usr/bin/g++-3.3"
/usr/local/bin/perl Configure.pl --cc="$CC" --cxx="$CX" --link="$CX" --ld="$CX" --
without-icu --without-gmp $@

See 'myconfig.first.txt' attached.

3. Once configuration is complete, I call 'make'. Ten minutes later, 'make' has failed. The
full output is attached as '16.03.2007.make.txt', but here is the relevant excerpt:

make[1]: Leaving directory `/Users/jimk/work/fresh/docs'
src/nci_test.c
c++ -bundle -undefined suppress -L/usr/local/lib -L/Users/jimk/work/fresh/blib/lib -
flat_namespace \
-o runtime/parrot/dynext/libnci_test.bundle src/nci_test.o -lm
c++: couldn't run 'undle-gcc-4.0.3': No such file or directory
make: *** [runtime/parrot/dynext/libnci_test.bundle] Error 1

The failure occurs at line 655 of what I would expect to be approx 791 lines of 'make' output.

4. I do 'make realclean', then revert to the older version of Configure.pl. The relevant lines
of @steps from this script now read:

my @steps = qw(
init::manifest
init::defaults
init::install
init::miniparrot
init::hints
init::headers
inter::progs
inter::make
inter::lex
inter::yacc

All that changed was the position of 'inter::progs':

[fresh] 518 $ diff Configure.pl my_Configure.pl
467d466
< inter::progs
469a469
> inter::progs


I configure as above, only with this subtly different Configure.pl. The result of that
configuration is attached as 'myconfig.second.txt'. Here is the diff between the two:

[parrot] 524 $ diff myconfig.first myconfig.second
2c2
< configdate='Fri Mar 16 20:30:39 2007'
---
> configdate='Fri Mar 16 20:28:27 2007'
12c12
< ld='c++', ldflags=' -L/usr/local/lib -L/Users/jimk/work/fresh/blib/lib -flat_namespace
',
---
> ld='/usr/bin/g++-3.3', ldflags=' -L/usr/local/lib -L/Users/jimk/work/fresh/blib/lib -
flat_namespace ',
14c14
< libs=' -lm'
---
> libs='-lm'

5. I call 'make' again. This time, 'make succeeds'. At the point where 'make' previously
failed, the output now looks like this:

make[1]: Leaving directory `/Users/jimk/work/fresh/docs'
src/nci_test.c
/usr/bin/g++-3.3 -bundle -undefined suppress -L/usr/local/lib -L/Users/jimk/work/
fresh/blib/lib -flat_namespace \
-o runtime/parrot/dynext/libnci_test.bundle src/nci_test.o -lm

But the differences between the outputs of 'make' actually begin earlier than that; see
'make.output.differences.txt' attached.

In short, moving 'inter::progs' up three steps prevents me from running 'make' successfully
because it negates the effect of the options I need to set to Configure.pl to run it on my
system.

kid51

make.output.differences.txt
16.03.2007.make.txt
myconfig.first.txt
myconfig.second.txt

Chromatic

unread,
Mar 16, 2007, 9:41:29 PM3/16/07
to perl6-i...@perl.org, parrotbug...@parrotcode.org
Jim, can you resend with diffs in unified format? (That's "diff -u",
not "diff".) They're much, much easier to read.

-- c

James E Keenan

unread,
Mar 16, 2007, 10:18:11 PM3/16/07
to perl6-i...@perl.org, chromatic, perl6-i...@perl.org, parrotbug...@parrotcode.org


I screwed up. I attached this to the wrong ticket.

0 new messages