Permalink
Browse files

CC fixes for 5.8.4 and 5.6.2

avoid -fdestruct on 5.6
fix Bblock mark_if_leader for empty PMOPs (5.8.4 substcont)
fixes CC 3,7,15,41,44,45,27,49 for <=5.8.5

CC 106 still fails (mult. END blocks)
  • Loading branch information...
1 parent 51232f7 commit 1c5062f5358ae8d2f1161a2735af478e306b270a Reini Urban committed Feb 13, 2014
Showing with 27 additions and 13 deletions.
  1. +3 −2 .gdbinit
  2. +5 −1 lib/B/Bblock.pm
  3. +13 −5 lib/B/C.pm
  4. +6 −5 t/test.pl
View
@@ -2,8 +2,9 @@
#directory /usr/src/perl/perl-5.6.2
set breakpoint pending on
-#break XS_B__CC__autovivification
break __asan_report_error
+
+#break XS_B__CC__autovivification
#break B.xs:1398
#break B.c:2044
#break B.xs:1858
@@ -15,7 +16,7 @@ break __asan_report_error
#p/x sv_list[3299]
# panic free from wrong pool 5.18.1
#b util.c:252
-b sv.c:3737 if (GV*)dstr->sv_u.svu_gp
+#b sv.c:3737 if (GV*)dstr->sv_u.svu_gp
define run10plc
run -Mblib -MByteLoader -Dtv bytecode10.plc
View
@@ -127,7 +127,11 @@ sub B::LISTOP::mark_if_leader {
sub B::PMOP::mark_if_leader {
my $op = shift;
- if ( $op->name ne "pushre" ) {
+ if ( $op->type
+ and $op->name ne "pushre"
+ and ($] > 5.008005 or $op->name ne "substcont") )
+ {
+ #warn $op->name, $op->type if $] == 5.008004;
my $replroot = $op->pmreplroot;
if ($$replroot) {
mark_leader( $replroot );
View
@@ -4912,7 +4912,7 @@ _EOT2
$init->add_initav(" Perl_die(aTHX_ \"panic: AV alloc failed\");");
}
}
- if ( !$B::C::destruct) {
+ if ( !$B::C::destruct ) {
print <<'__EOT';
int fast_perl_destruct( PerlInterpreter *my_perl );
static void my_curse( pTHX_ SV* const sv );
@@ -4964,8 +4964,8 @@ my_share_hek( pTHX_ const char *str, I32 len, register U32 hash ) {
_EOT5
}
- # -fno-destruct only >5.8
- if ( !$B::C::destruct) {
+ # -fno-destruct only >=5.8
+ if ( !$B::C::destruct ) {
print <<'_EOT6';
#ifndef SvDESTROYABLE
@@ -4975,6 +4975,13 @@ _EOT5
#ifndef CvISXSUB
#define CvISXSUB(sv) CvXSUB(sv)
#endif
+#ifndef SvRV_set
+#define SvRV_set(a,b) SvRV(a) = (b)
+#endif
+/* 5.6 */
+#ifndef PERL_EXIT_DESTRUCT_END
+#define PERL_EXIT_DESTRUCT_END 2
+#endif
static void
my_curse( pTHX_ SV* const sv ) {
@@ -5144,6 +5151,7 @@ int fast_perl_destruct( PerlInterpreter *my_perl ) {
}
}
}
+#if PERL_VERSION > 7
if (DEBUG_D_TEST) {
SV* sva;
PerlIO_printf(Perl_debug_log, "\n");
@@ -5152,6 +5160,7 @@ int fast_perl_destruct( PerlInterpreter *my_perl ) {
sva, sva+SvREFCNT(sva), SvREFCNT(sva));
}
}
+#endif
PerlIO_destruct(aTHX);
#if defined(PERLIO_LAYERS)
@@ -5615,7 +5624,7 @@ EOT
print $B::C::eval_pvs if $B::C::eval_pvs;
print " exitstatus = perl_run( my_perl );\n";
- if ( !$B::C::destruct and $^O ne 'MSWin32' ) {
+ if ( !$B::C::destruct ) {
warn "fast_perl_destruct (-fno-destruct)\n" if $verbose;
print " fast_perl_destruct( my_perl );\n";
#} elsif ( $PERL510 and (@B::C::static_free or $free->index > -1) ) {
@@ -6484,7 +6493,6 @@ sub compile {
my ( $option, $opt, $arg );
my @eval_at_startup;
$B::C::can_delete_pkg = 1;
- $B::C::destruct = 1;
$B::C::save_sig = 1;
$B::C::stash = 0;
$B::C::fold = 1 if $] >= 5.013009; # always include utf8::Cased tables
View
@@ -1034,9 +1034,13 @@ sub todo_tests_default {
# on cygwin 29 passes
#15,21,27,30,41-45,50,103,105
#15,46,50,103 fixed with 1.42_61
- push @todo, (21,30,105);
+ push @todo, (21,30,105,106);
push @todo, (104,105) if $] < 5.007; # leaveloop, no cxstack
- push @todo, (3,7,15,41,44,45) if $] > 5.008 and $] <= 5.008005;
+ # fixed with 1.45_02
+ #push @todo, (3,7,15,41,44,45) if $] > 5.008 and $] <= 5.008005;
+ # only tested 5.8.4 and .5
+ #push @todo, (27) if $] <= 5.008005;
+ #push @todo, (49) if $] >= 5.007 and $] < 5.008008;
push @todo, (42,43) if $] > 5.008 and $] <= 5.008005 and !$ITHREADS;
push @todo, (33,45) if $] >= 5.010 and $] < 5.012;
@@ -1046,9 +1050,6 @@ sub todo_tests_default {
#push @todo, (29) if $] >= 5.013 and $what eq 'cc_o2';
#push @todo, (43) if $what eq 'cc_o2'; # -faelem
#push @todo, (103) if $] > 5.007 and $] < 5.009 and $what eq 'cc_o1';
- # only tested 5.8.4 and .5
- push @todo, (27) if $] <= 5.008005;
- push @todo, (49) if $] >= 5.007 and $] < 5.008008;
push @todo, (29) if $] < 5.008008;
# solaris also. I suspected nvx<=>cop_seq_*
push @todo, (12) if $^O eq 'MSWin32' and $Config{cc} =~ /^cl/i;

0 comments on commit 1c5062f

Please sign in to comment.