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 optimization/12845] New: Error: Invalid Compare and Branch Condition


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: Error: Invalid Compare and Branch Condition
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: danglin at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: hppa64-hp-hpux11.11
  GCC host triplet: hppa64-hp-hpux11.11
GCC target triplet: hppa64-hp-hpux11.11

The following error occurs with 3.4 cvs source as 10/30/03:

/xxx/gnu/gcc-3.3/objdir/gcc/xgcc -shared-libgcc -B/xxx/gnu/gcc-3.3/objdir/gcc/ -
nostdinc++ -L/xxx/gnu/gcc-3.3/objdir/hppa64-hp-hpux11.11/libstdc++-v3/src -L/xxx
/gnu/gcc-3.3/objdir/hppa64-hp-hpux11.11/libstdc++-v3/src/.libs -B/opt/gnu64/hppa
64-hp-hpux11.11/bin/ -B/opt/gnu64/hppa64-hp-hpux11.11/lib/ -isystem /opt/gnu64/h
ppa64-hp-hpux11.11/include -isystem /opt/gnu64/hppa64-hp-hpux11.11/sys-include -
I/xxx/gnu/gcc-3.3/objdir/hppa64-hp-hpux11.11/libstdc++-v3/include/hppa64-hp-hpux
11.11 -I/xxx/gnu/gcc-3.3/objdir/hppa64-hp-hpux11.11/libstdc++-v3/include -I/xxx/
gnu/gcc-3.3/gcc/libstdc++-v3/libsupc++ -O2 -g -O2 -g -O2 -fno-implicit-templates
 -Wall -W -Wwrite-strings -Wcast-qual -fdiagnostics-show-location=once -ffunctio
n-sections -fdata-sections -c ../../../../gcc/libstdc++-v3/src/locale-inst.cc  -
fPIC -DPIC -o .libs/locale-inst.o
/var/tmp//ccT9I4xO.s: Assembler messages:
/var/tmp//ccT9I4xO.s:76351: Error: Invalid Compare and Branch Condition

The problematic assembler instruction is:

        cmpib,*>> 0,%r20,L$14585

The condition "*>>" doesn't exist for doubleword cmpib insns.  It does
exist for the cmpb insn (opd1 is greater than opd2, unsigned double word).
We should be generating

	cmpb,*>> %r0,%r20,L$14585

in this situation.

It can be seen that the branch condition is never true.  This is the rtl:

(insn 23955 11294 11314 /xxx/gnu/gcc-3.3/objdir/hppa64-hp-hpux11.11/libstdc++-v3
/include/bits/basic_string.h:290 (sequence [
            (jump_insn 11303 11294 11309 /xxx/gnu/gcc-3.3/objdir/hppa64-hp-hpux1
1.11/libstdc++-v3/include/bits/basic_string.h:522 (set (pc)
                    (if_then_else (ltu (reg/v:DI %r20 [orig:1770 <anonymous> ] [
1770])
                            (const_int 0 [0x0]))
                        (label_ref 22687)
                        (pc))) 48 {*pa.md:1728} (insn_list:REG_DEP_ANTI 21832 (i
nsn_list:REG_DEP_ANTI 11273 (insn_list 11293 (insn_list:REG_DEP_ANTI 11234 (nil)
))))
                (expr_list:REG_BR_PRED (const_int 17 [0x11])
                    (expr_list:REG_DEAD (reg/v:DI %r20 [orig:1770 <anonymous> ] 
[1770])
                        (expr_list:REG_BR_PROB (const_int 3000 [0xbb8])
                            (nil)))))
            (insn/s:TI 11309 11303 11314 (set (reg:DI %r1 [1777])
                    (plus:DI (reg:DI %r27)
                        (high:DI (symbol_ref/v/f:DI ("*L$C0589") [flags 0x2] <st
ring_cst 800003fffbacd9f0>)))) 82 {*pa.md:2535} (nil)
                (nil))
        ]) -1 (nil)

I believe we have a regression in jump optimization as we never hit this
corner case before.  Why wasn't the jump deleted?


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