This is the mail archive of the gcc-bugs@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]

[Bug target/33359] New: [4.3 Regression] libgcc is miscompiled on SH


Trunk fails for sh-elf during compiling libgcc with a missing
local label:

/exp/ldroot/dodes/xsh-elf-gcc-orig/./gcc/xgcc
-B/exp/ldroot/dodes/xsh-elf-gcc-orig/./gcc/ -B/usr/local/sh-unknown-elf/bin/
-B/usr/local/sh-unknown-elf/lib/ -isystem /usr/local/sh-unknown-elf/include
-isystem /usr/local/sh-unknown-elf/sys-include -O2 -g -O2 -O2  -O2 -g -O2  
-DIN_GCC -DCROSS_DIRECTORY_STRUCTURE   -W -Wall -Wwrite-strings
-Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem
./include   -g  -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED   -I. -I. -I../.././gcc
-I../../../ORIG/trunk/libgcc -I../../../ORIG/trunk/libgcc/.
-I../../../ORIG/trunk/libgcc/../gcc -I../../../ORIG/trunk/libgcc/../include 
-DHAVE_CC_TLS -o _muldc3.o -MT _muldc3.o -MD -MP -MF _muldc3.dep -DL_muldc3 -c
../../../ORIG/trunk/libgcc/../gcc/libgcc2.c \

/tmp/ccghCTLN.s: Assembler messages:
/tmp/ccghCTLN.s:782: Error: displacement to undefined symbol .L162 overflows
12-bit field

I've found that it started after

r128224 | lauras | 2007-09-07 11:58:06 +0900 (Fri, 07 Sep 2007) | 25 lines

2007-09-05  Laurynas Biveinis  <laurynas.biveinis@gmail.com>

        * regrename.c (copyprop_hardreg_forward_1): New variable next. Use
        FOR_BB_INSNS_SAFE instead of for loop.
        * cse.c (cse_extended_basic_block): Likewise.
        * postreload.c (reload_cse_regs_1): New variable next. Make sure
        that the for loop does not invoke NEXT_INSN on a deleted insn.
        * function.c (instantiate_virtual_regs): Likewise.
        * lower-subreg.c (remove_retval_note): Likewise.
        (decompose_multiword_subregs): Use FOR_BB_INSNS_SAFE instead of
        FOR_BB_INSNS.
        * emit-rtl.c (remove_insn): Set NEXT_INSN and PREV_INSN to NULL on
        a deleted insn.
        * cfgrtl.c (delete_insn): Set JUMP_LABEL to NULL on a deleted
        insn, if it's a jump.
        (try_redirect_by_replacing_jump): New variable jump_p. Call
        tablejump_p before delete_insn_chain.
        * reload1.c (reload): New variable next. Make sure that the for
        loop does not invoke NEXT_INSN on a deleted insn.
        (fixup_eh_region_note): Make the loop terminate if i becomes NULL.
        (delete_output_reload): New variable prev. Make sure the the for
        loops do not invoke PREV_INSN on a deleted insn.

Reverting a hunk in the patch:

--- TMP/gcc-128223/gcc/emit-rtl.c       2007-09-08 17:52:26.000000000 +0900
+++ TMP/gcc-128224/gcc/emit-rtl.c       2007-09-08 17:08:27.000000000 +0900
@@ -3688,6 +3688,8 @@ remove_insn (rtx insn)
       if (BB_END (bb) == insn)
        BB_END (bb) = prev;
     }
+  NEXT_INSN (insn) = NULL;
+  PREV_INSN (insn) = NULL;
 }

 /* Append CALL_FUSAGE to the CALL_INSN_FUNCTION_USAGE for CALL_INSN.  */

gets rid of the above failure.  Although I can't specify
the problematic part in the SH back end yet, it looks there
are other places which assume that NEXT_INSN and PREV_INSN
aren't cleared with remove_insn.
For example, jump.c:delete_related_insns uses NEXT_INSN (insn)
after delete_insn (insn) which may call remove_insn.


-- 
           Summary: [4.3 Regression] libgcc is miscompiled on SH
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: kkojima at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: sh-elf


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33359


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