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



             Bug #: 55259

           Summary: plus_constant doesn't handle zero-extended address

                    properly

    Classification: Unclassified

           Product: gcc

           Version: 4.8.0

            Status: UNCONFIRMED

          Severity: normal

          Priority: P3

         Component: middle-end

        AssignedTo: unassig...@gcc.gnu.org

        ReportedBy: hjl.to...@gmail.com





For address,



#0  plus_constant (mode=SImode, x=0x7ffff0fadf40, c=8)

    at /export/gnu/import/git/gcc/gcc/explow.c:211

#1  0x00000000006f9b04 in adjust_address_1 (memref=0x7ffff0fff2e8, 

    mode=DImode, offset=8, validate=1, adjust_address=1, adjust_object=0)

    at /export/gnu/import/git/gcc/gcc/emit-rtl.c:2113

#2  0x0000000000cdd259 in split_double_mode (mode=TImode, 

    operands=0x7fffffffd828, num=0, lo_half=0x7fffffffd8f0, 

    hi_half=0x7fffffffd8f8)

    at /export/gnu/import/git/gcc/gcc/config/i386/i386.c:14721

#3  0x0000000000ceafe7 in ix86_split_to_parts (operand=0x7ffff0fff2e8, 

    parts=0x7fffffffd8f0, mode=TImode)

    at /export/gnu/import/git/gcc/gcc/config/i386/i386.c:20695

#4  0x0000000000ceb4ad in ix86_split_long_move (

    operands=0x17a5fa0 <recog_data>)

    at /export/gnu/import/git/gcc/gcc/config/i386/i386.c:20794



Breakpoint 2, plus_constant (mode=DImode, x=0x7ffff0fadf30, c=8)

    at /export/gnu/import/git/gcc/gcc/explow.c:96

96          zero_extend_mode = GET_MODE (x);

(gdb) call debug_rtx (x)

(zero_extend:DI (reg:SI 0 ax [82]))

(gdb) 



it should generate



(gdb) call debug_rtx (x)

(zero_extend:DI (plus:SI (reg:SI 0 ax [82])

        (const_int 8 [0x8])))

(gdb)



Instead, plus_constant generates



(gdb) call debug_rtx (addr)

(plus:DI (zero_extend:DI (reg:SI 0 ax [82]))

    (const_int 8 [0x8]))

Reply via email to