This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/53454] New: [RX backend]: redundant insn being expanded for long long trivial arithmetic comparison
- From: "Paulo.Matos at csr dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 22 May 2012 14:44:14 +0000
- Subject: [Bug middle-end/53454] New: [RX backend]: redundant insn being expanded for long long trivial arithmetic comparison
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53454
Bug #: 53454
Summary: [RX backend]: redundant insn being expanded for long
long trivial arithmetic comparison
Classification: Unclassified
Product: gcc
Version: 4.6.3
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: middle-end
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: Paulo.Matos@csr.com
I was comparing my port double word arithmetic comparison with the one from rx
and I noticed some strange code being expanded.
In GCC4.6.3 for the code compiled with -Os:
int le(long long x) { return x <= 0; }
I get after expand:
;; Generating RTL for gimple basic block 2
;; return D.1216_2;
(insn 9 8 10 (set (reg:SI 27)
(const_int 1 [0x1])) test.c:1 -1
(nil))
(jump_insn 10 9 11 (set (pc)
(if_then_else (gt (subreg:SI (reg/v:DI 26 [ x ]) 4)
(const_int 0 [0]))
(label_ref 16)
(pc))) test.c:1 -1
(nil))
(jump_insn 11 10 12 (set (pc)
(if_then_else (ne (subreg:SI (reg/v:DI 26 [ x ]) 4)
(const_int 0 [0]))
(label_ref 18)
(pc))) test.c:1 -1
(nil))
(jump_insn 12 11 13 (set (pc)
(if_then_else (ne (subreg:SI (reg/v:DI 26 [ x ]) 0)
(const_int 0 [0]))
(label_ref 16)
(pc))) test.c:1 -1
(nil))
(jump_insn 13 12 14 (set (pc)
(if_then_else (ne (subreg:SI (reg/v:DI 26 [ x ]) 0)
(const_int 0 [0]))
(label_ref 18)
(pc))) test.c:1 -1
(nil))
(jump_insn 14 13 15 (set (pc)
(label_ref 18)) test.c:1 -1
(nil))
(barrier 15 14 16)
(code_label 16 15 17 3 "" [0 uses])
(insn 17 16 18 (set (reg:SI 27)
(const_int 0 [0])) test.c:1 -1
(nil))
(code_label 18 17 19 2 "" [0 uses])
(insn 19 18 20 (set (reg:SI 24 [ <retval> ])
(reg:SI 27)) test.c:1 -1
(nil))
(jump_insn 20 19 21 (set (pc)
(label_ref 0)) test.c:1 -1
(nil))
(barrier 21 20 0)
What's strange in here are insn 12/13, insn 13 is redundant. Marked this as
minor since it seems to me that GCC notices this and the assembly generation is
ok.