# New Ticket Created by  Colin Meyer 
# Please include the string:  [perl #36960]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/rt3/Ticket/Display.html?id=36960 >



This is a bug report for perl from [EMAIL PROTECTED],
generated with the help of perlbug 1.35 running under perl v5.8.7.


-----------------------------------------------------------------
[Please enter your report here]

(Sorry if this ends up as a duplicate. I sent it from a machine that is
behind a firewall. I got a cc: copy, but several hours later, it is not
yet listed in rt.perl.org. I am resending it.)

While playing with constant folding and compiler optimizations, I
noticed something funny about B::Deparse.

It seems to strip the conditionals off of some statements, implying
that they will always be run. However, they do not get run.


Here's my test files:

A.pm:
  package A;
  use constant DEBUG => 1;
  1;

B.pm:
  package B;
  use constant DEBUG => 0;
  1;

test.pl:
  #!/usr/local/bin/perl
  
  $\="\n"; 
  use lib '.';
  use A; # DEBUG == 1
  use B; # DEBUG == 0
  
  use constant AorB  => A::DEBUG | B::DEBUG; # 1
  use constant AandB => A::DEBUG & B::DEBUG; # 0
  
  print "A" if A::DEBUG;
  print "B" if B::DEBUG;
  if ( B::DEBUG ) { print "B" }
  
  print "AorB"  if AorB;
  print "AandB" if AandB;

perl test.pl:
  A
  AorB

perl -MO=Deparse test.pl:

  test syntax OK
  $\ = "\n";
  use lib ('.');
  use A;
  use B;
  use constant ('AorB', 1 | 0);
  use constant ('AandB', 1 & 0);
  print 'A';
  print 'B';
  do {
      print 'B'
  };
  print 'AorB';
  '???';

Thanks for any help,
-Colin.

[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
    category=library
    severity=medium
---
Site configuration information for perl v5.8.7:

Configured by cmeyer at Thu Jul 28 15:52:04 PDT 2005.

Summary of my perl5 (revision 5 version 8 subversion 7) configuration:
  Platform:
    osname=linux, osvers=2.4.21-20.el.c0smp, archname=i686-linux
    uname='linux dasdev0 2.4.21-20.el.c0smp #1 smp thu sep 9 01:53:25 edt 2004 
i686 i686 i386 gnulinux '
    config_args='-Dcc=gcc -Dprefix=/opt/perl/5.8.7-mp1 -des'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef 
usemultiplicity=undef
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='gcc', ccflags ='-fno-strict-aliasing -pipe -I/usr/local/include 
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O2',
    cppflags='-fno-strict-aliasing -pipe -I/usr/local/include'
    ccversion='', gccversion='3.2.3 20030502 (Red Hat Linux 3.2.3-52)', 
gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', 
lseeksize=8
    alignbytes=4, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -ldl -lm -lcrypt -lutil -lc
    perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
    libc=/lib/libc-2.3.2.so, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version='2.3.2'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
    cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'

Locally applied patches:
    

---
@INC for perl v5.8.7:
    /home/cmeyer/perl5lib
    /home/cmeyer/da/common/lib
    /home/cmeyer/da/das2/lib
    /opt/perl/5.8.7-mp1/lib/5.8.7/i686-linux
    /opt/perl/5.8.7-mp1/lib/5.8.7
    /opt/perl/5.8.7-mp1/lib/site_perl/5.8.7/i686-linux
    /opt/perl/5.8.7-mp1/lib/site_perl/5.8.7
    /opt/perl/5.8.7-mp1/lib/site_perl
    .

---
Environment for perl v5.8.7:
    HOME=/home/cmeyer
    LANG=en_US
    LANGUAGE (unset)
    LANGVAR=en_US.UTF-8
    LD_LIBRARY_PATH=:/opt/oracle/product/9.2.0/lib
    LOGDIR (unset)
    
PATH=/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/sbin:/usr/sbin:/home/cmeyer/bin:/opt/oracle/product/9.2.0/bin:/home/cmeyer/bin
    PERL=/opt/perl/5.8.7-mp1/bin/perl
    
PERL5LIB=/home/cmeyer/perl5lib:/home/cmeyer/da/common/lib:/home/cmeyer/da/das2/lib
    PERL_BADLANG (unset)
    SHELL=/bin/bash

Reply via email to