This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] dwarf2out.c: Don't emit DW_OP_regx for register -1


FYI, here are some c++ files which, when compiled, show the bad
debugging info.

te.cpp is the minimal one, and happily uses uninitted vars, etc.
te2.cpp shows the problem w/ initted vars used in the calculation
that (AFAIK) causes the problem.

this shows up with a set of mips64-linux tools, using the "-O3
-mips64" flag.  (-mips64 enables use of the "madd" instruction.)

in te2.cpp, when optimizing (and using madd), i'd expect that 'a9'
will live entirely in "LO", from the time that is initialized until
its last use.


cgd
--
#!/bin/sh
# This is a shell archive (produced by GNU sharutils 4.2.1).
# To extract the files from this archive, save it to some FILE, remove
# everything before the `!/bin/sh' line above, then type `sh FILE'.
#
# Made on 2003-03-07 09:25 PST by <cgd at hardy dot sj dot broadcom dot com>.
# Source directory was `/projects/bbp_ext13/systems/users/cgd/proj/REDHAT-NEW/FILED/te-final'.
#
# Existing files will *not* be overwritten unless `-c' is specified.
#
# This shar contains:
# length mode       name
# ------ ---------- ------------------------------------------
#    680 -rw-rw-r-- te.cpp
#    787 -rw-rw-r-- te2.cpp
#
save_IFS="${IFS}"
IFS="${IFS}:"
gettext_dir=FAILED
locale_dir=FAILED
first_param="$1"
for dir in $PATH
do
  if test "$gettext_dir" = FAILED && test -f $dir/gettext \
     && ($dir/gettext --version >/dev/null 2>&1)
  then
    set `$dir/gettext --version 2>&1`
    if test "$3" = GNU
    then
      gettext_dir=$dir
    fi
  fi
  if test "$locale_dir" = FAILED && test -f $dir/shar \
     && ($dir/shar --print-text-domain-dir >/dev/null 2>&1)
  then
    locale_dir=`$dir/shar --print-text-domain-dir`
  fi
done
IFS="$save_IFS"
if test "$locale_dir" = FAILED || test "$gettext_dir" = FAILED
then
  echo=echo
else
  TEXTDOMAINDIR=$locale_dir
  export TEXTDOMAINDIR
  TEXTDOMAIN=sharutils
  export TEXTDOMAIN
  echo="$gettext_dir/gettext -s"
fi
if touch -am -t 200112312359.59 $$.touch >/dev/null 2>&1 && test ! -f 200112312359.59 -a -f $$.touch; then
  shar_touch='touch -am -t $1$2$3$4$5$6.$7 "$8"'
elif touch -am 123123592001.59 $$.touch >/dev/null 2>&1 && test ! -f 123123592001.59 -a ! -f 123123592001.5 -a -f $$.touch; then
  shar_touch='touch -am $3$4$5$6$1$2.$7 "$8"'
elif touch -am 1231235901 $$.touch >/dev/null 2>&1 && test ! -f 1231235901 -a -f $$.touch; then
  shar_touch='touch -am $3$4$5$6$2 "$8"'
else
  shar_touch=:
  echo
  $echo 'WARNING: not restoring timestamps.  Consider getting and'
  $echo "installing GNU \`touch', distributed in GNU File Utilities..."
  echo
fi
rm -f 200112312359.59 123123592001.59 123123592001.5 1231235901 $$.touch
#
if mkdir _sh25587; then
  $echo 'x -' 'creating lock directory'
else
  $echo 'failed to create lock directory'
  exit 1
fi
# ============= te.cpp ==============
if test -f 'te.cpp' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'te.cpp' '(file already exists)'
else
  $echo 'x -' extracting 'te.cpp' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'te.cpp' &&
class c3{
private:
X	int x;
X        unsigned char *y;
public:
X        inline int a4 ();
X        inline unsigned char a5 ( unsigned int a6 ) {
X                return y[a6];
X        }
} ;
enum e16 { v17 };
class a1 {
protected:
X        e16 a12;
public:
X        unsigned char a2 ( float a14, float a15, float a13 );
};
unsigned char a1::a2 ( float a14, float a15, float a13)
{
X        unsigned char a8;
X        unsigned int a9, a10;
X        c3* a11;
X        int a7 = a10 * a11->a4() + a9;
X        switch (a12)
X        {
X                case v17:
X                        a8 = a11 ->a5 ( a7 ) ;
X                break;
X        };
X        return a8;
}
int c3::a4 ()
{
X        return x;
}
SHAR_EOF
  (set 20 03 03 01 14 04 35 'te.cpp'; eval "$shar_touch") &&
  chmod 0664 'te.cpp' ||
  $echo 'restore of' 'te.cpp' 'failed'
  if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
  && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
    md5sum -c << SHAR_EOF >/dev/null 2>&1 \
    || $echo 'te.cpp:' 'MD5 check failed'
d4a96843de7e37f7c4f3b9ec5fca269a  te.cpp
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'te.cpp'`"
    test 680 -eq "$shar_count" ||
    $echo 'te.cpp:' 'original size' '680,' 'current size' "$shar_count!"
  fi
fi
# ============= te2.cpp ==============
if test -f 'te2.cpp' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'te2.cpp' '(file already exists)'
else
  $echo 'x -' extracting 'te2.cpp' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'te2.cpp' &&
class c3{
private:
X	int x;
X        unsigned char *y;
public:
X        inline int a4 ();
X        void set ( int v ) {
X                x = v;
X        }
X        inline unsigned char a5 ( unsigned int a6 ) {
X                return y[a6];
X        }
} ;
enum e16 { v17 };
class a1 {
protected:
X        e16 a12;
public:
X        unsigned char a2 ( float a14, float a15, float a13 );
};
unsigned char a1::a2 ( float a14, float a15, float a13)
{
X        unsigned char a8;
X        unsigned int a9, a10;
X        c3* a11;
X
X	a10 = (int)a14;
X	a9 = (int)a15 / (int)a13;
X        int a7 = a10 * a11->a4() + a9;
X        switch (a12)
X        {
X                case v17:
X                        a8 = a11 ->a5 ( a7 ) ;
X                break;
X        };
X        return a8;
}
int c3::a4 ()
{
X        return x;
}
SHAR_EOF
  (set 20 03 03 06 16 14 10 'te2.cpp'; eval "$shar_touch") &&
  chmod 0664 'te2.cpp' ||
  $echo 'restore of' 'te2.cpp' 'failed'
  if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
  && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
    md5sum -c << SHAR_EOF >/dev/null 2>&1 \
    || $echo 'te2.cpp:' 'MD5 check failed'
f0f63d77e0e5ddc1c3316c546cf601da  te2.cpp
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'te2.cpp'`"
    test 787 -eq "$shar_count" ||
    $echo 'te2.cpp:' 'original size' '787,' 'current size' "$shar_count!"
  fi
fi
rm -fr _sh25587
exit 0


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]