public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/43965] New: doubled code (x86)
@ 2010-05-03 5:45 hartmut dot schirmer at arcormail dot de
2010-05-03 5:46 ` [Bug c++/43965] " hartmut dot schirmer at arcormail dot de
2010-05-03 9:56 ` [Bug tree-optimization/43965] Missed VRP and/or jump-threading rguenth at gcc dot gnu dot org
0 siblings, 2 replies; 4+ messages in thread
From: hartmut dot schirmer at arcormail dot de @ 2010-05-03 5:45 UTC (permalink / raw)
To: gcc-bugs
On this test case
---
struct Vector
{
int size( void ) const
{
return mSize ? *mSize : 0 ;
}
int* mSize;
};
int diff(const Vector& a, const Vector& b)
{
if (a.size() != b.size())
{
return a.size() - b.size();
}
return 0;
}
---
gcc omits the following code:
__Z4diffRK6VectorS1_:
pushl %ebp #
movl %esp, %ebp #,
pushl %esi #
xorl %esi, %esi # D.2130
pushl %ebx #
movl 8(%ebp), %eax # a, a
movl (%eax), %ecx # a_2(D)->mSize, D.2131
testl %ecx, %ecx # D.2131
je L2 #,
movl (%ecx), %esi #* D.2131, D.2130
L2:
movl 12(%ebp), %eax # b, b
xorl %ebx, %ebx # D.2134
movl (%eax), %edx # b_4(D)->mSize, D.2135
testl %edx, %edx # D.2135
je L3 #,
movl (%edx), %ebx #* D.2135, D.2134
L3:
xorl %eax, %eax # D.2116
cmpl %ebx, %esi # D.2134, D.2130
je L4 #,
testl %ecx, %ecx # D.2131
je L5 #,
movl (%ecx), %eax #* D.2131, D.2138
L5:
xorl %ecx, %ecx # D.2142
testl %edx, %edx # D.2135
je L6 #,
movl (%edx), %ecx #* D.2135, D.2142
L6:
subl %ecx, %eax # D.2142, D.2116
L4:
popl %ebx #
popl %esi #
popl %ebp #
ret
Basicly code following the cmpl after L3 up to L6 is needless,
subl could operate on same values as cmpl did
# GNU C++ (GCC) version 4.5.0 (mingw32)
# compiled by GNU C version 4.5.0, GMP version 5.0.1, MPFR version 2.4.1,
MPC version 0.8.1
# GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
# options passed: -fpreprocessed yy4.ii -march=atom -O2 -fverbose-asm
--
Summary: doubled code (x86)
Product: gcc
Version: 4.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: hartmut dot schirmer at arcormail dot de
GCC build triplet: i686-pc-mingw32
GCC host triplet: i686-pc-mingw32
GCC target triplet: i686-pc-mingw32
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43965
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/43965] doubled code (x86)
2010-05-03 5:45 [Bug c++/43965] New: doubled code (x86) hartmut dot schirmer at arcormail dot de
@ 2010-05-03 5:46 ` hartmut dot schirmer at arcormail dot de
2010-05-03 9:56 ` [Bug tree-optimization/43965] Missed VRP and/or jump-threading rguenth at gcc dot gnu dot org
1 sibling, 0 replies; 4+ messages in thread
From: hartmut dot schirmer at arcormail dot de @ 2010-05-03 5:46 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from hartmut dot schirmer at arcormail dot de 2010-05-03 05:46 -------
Created an attachment (id=20537)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20537&action=view)
Full assembler code
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43965
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug tree-optimization/43965] Missed VRP and/or jump-threading
2010-05-03 5:45 [Bug c++/43965] New: doubled code (x86) hartmut dot schirmer at arcormail dot de
2010-05-03 5:46 ` [Bug c++/43965] " hartmut dot schirmer at arcormail dot de
@ 2010-05-03 9:56 ` rguenth at gcc dot gnu dot org
1 sibling, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-05-03 9:56 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from rguenth at gcc dot gnu dot org 2010-05-03 09:55 -------
Confirmed. This is a case where we'd have to do some interesting VRP and
jump-threading.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Component|middle-end |tree-optimization
Ever Confirmed|0 |1
Keywords| |missed-optimization
Last reconfirmed|0000-00-00 00:00:00 |2010-05-03 09:55:51
date| |
Summary|doubled code (x86) |Missed VRP and/or jump-
| |threading
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43965
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug tree-optimization/43965] Missed VRP and/or jump-threading
[not found] <bug-43965-4@http.gcc.gnu.org/bugzilla/>
@ 2012-06-29 14:20 ` rguenth at gcc dot gnu.org
0 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-06-29 14:20 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43965
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |matz at gcc dot gnu.org
--- Comment #3 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-06-29 14:20:24 UTC ---
More like predicated value-numbering should figure this out.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-06-29 14:20 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-03 5:45 [Bug c++/43965] New: doubled code (x86) hartmut dot schirmer at arcormail dot de
2010-05-03 5:46 ` [Bug c++/43965] " hartmut dot schirmer at arcormail dot de
2010-05-03 9:56 ` [Bug tree-optimization/43965] Missed VRP and/or jump-threading rguenth at gcc dot gnu dot org
[not found] <bug-43965-4@http.gcc.gnu.org/bugzilla/>
2012-06-29 14:20 ` rguenth at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).