PATCH: [4.1/4.2 Regression]: Miscompiled FORTRAN program

Joern RENNECKE joern.rennecke@st.com
Tue Feb 14 21:17:00 GMT 2006


In http://gcc.gnu.org/ml/gcc-patches/2006-02/msg01086.html, you wrote:
> I am senting this on behalf of Denis. We have tested it on ia64, x86
> and x86-64. There are no regressions. It may affect many targets:

In other words, you haven't tested it for any target where the #ifdefed
code is enabled.  

There are a number of targets that you can test with a unified tree
(gcc, binutils, newlib, sim).

My site.exp fragment for sh-elf is:

case "$target_triplet" in {
...
    { "sh-unknown-elf" } {
        set target_list { "sh-hms-sim{,-m4/-ml}" }
        set board_info(sh-hms-sim,ldscript) "-Wl,--defsym,_stack=0xfffff00"
        set board_info(sh-hms-sim,sim,options) "-m 28"
        set board_info(sh-hms-sim/-m4/-ml,ldscript) "-Wl,--defsym,_stack=0xfffff
00"
        set board_info(sh-hms-sim/-m4/-ml,sim,options) "-m 28"
    }
...
}

proc sim_download { dest file args } {
    return [remote_download host $file $args]
}

proc sim_upload { dest file args } {
    return [remote_upload host $file $args]
}

proc sim_file { dest file args } {
    return [remote_file host $file $args]
}

And I test a unified tree by creating a sibling dir and execute this script there:

export SWBUILD=/mnt/scratch
export DEJAGNU=$HOME/.dejagnu/site.exp
export PATH="$SWBUILD/sim-bin/bin:/export/home/build/lib/bin:$SWBUILD/build/lib/
bin:$PATH"
hash -r
../srcw/configure --target=sh-elf --with-headers --with-newlib
if test $? -ne 0; then
  echo configure failed
  exit
fi  
make all-gcc all-target-newlib all-target-libstdc++-v3 all-target-libobjc
if test $? -ne 0; then
  echo build failed
  exit
fi  
make -k check-gcc check-target-libstdc++-v3

> 2006-02-13  Denis Nagorny <denis_nagorny@linux.intel.com>
> 
>         PR rtl-optimization/25603
>         * reload.c (reg_inc_found_and_valid_p): New.
> 	(regno_clobbered_p): Handle REG_INC as 25603 workaround.

You have to check every use of regno_clobbered_p to verify your change
will be appropriate.  E.g. The followingh code in
reload1.c:emit_output_reload_insns is bound to break with your patch,
when a hard register not suitable for auto-increment is reloaded
into another register because the value is needed as an auto-increment
address in a MEM which is SET_SRC (single_set (insn)):


     /* Don't output the last reload if OLD is not the dest of
         INSN and is in the src and is clobbered by INSN.  */
      if (! flag_expensive_optimizations
          || !REG_P (old)
          || !(set = single_set (insn))
          || rtx_equal_p (old, SET_DEST (set))
          || !reg_mentioned_p (old, SET_SRC (set))
          || !((REGNO (old) < FIRST_PSEUDO_REGISTER)
               && regno_clobbered_p (REGNO (old), insn, rl->mode, 0)))
        gen_reload (old, reloadreg, rl->opnum,
                    rl->when_needed);




More information about the Gcc-patches mailing list