------- Additional Comments From steven at gcc dot gnu dot org  2004-12-18 
13:54 -------
Here's the RTL we generate for this on AMD64: 
 
;; a = MAX_EXPR <b, *(long int *) (a + 1)> 
(insn 19 17 20 (set (reg/v:DI 66 [ a ]) 
        (reg/v:DI 67 [ b ])) -1 (nil) 
    (nil)) 
 
(insn 20 19 21 (set (reg:CCGC 17 flags) 
        (compare:CCGC (reg/v:DI 66 [ a ]) 
            (mem:DI (plus:DI (reg/v:DI 66 [ a ]) 
                    (const_int 1 [0x1])) [0 S8 A64]))) -1 (nil) 
    (nil)) 
 
(jump_insn 21 20 22 (set (pc) 
        (if_then_else (ge (reg:CCGC 17 flags) 
                (const_int 0 [0x0])) 
            (label_ref 23) 
            (pc))) -1 (nil) 
    (nil)) 
 
(insn 22 21 23 (set (reg/v:DI 66 [ a ]) 
        (mem:DI (plus:DI (reg/v:DI 66 [ a ]) 
                (const_int 1 [0x1])) [0 S8 A64])) -1 (nil) 
    (nil)) 
 
(code_label 23 22 0 2 "" [0 uses]) 
 
Note that this is pretty dreadful with the common subexpression and 
all.  And indeed, it is also buggy :-) 
 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |steven at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED


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

Reply via email to