This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/18548] [4.0 Regression] Miscompiles code generated by Gambit-C Scheme->C compiler
- From: "steven at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Dec 2004 13:54:48 -0000
- Subject: [Bug middle-end/18548] [4.0 Regression] Miscompiles code generated by Gambit-C Scheme->C compiler
- References: <20041118185317.18548.lucier@math.purdue.edu>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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