public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/30966] New: (long long)(int_var) == (long long)(int_var1) is not simplified down to int_var == int_var1 when "expanded"
@ 2007-02-26 11:36 pinskia at gcc dot gnu dot org
2007-02-26 17:33 ` [Bug tree-optimization/30966] " rguenth at gcc dot gnu dot org
2007-07-01 1:12 ` pinskia at gcc dot gnu dot org
0 siblings, 2 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-02-26 11:36 UTC (permalink / raw)
To: gcc-bugs
Both of these functions should produce the same asm:
int f(int a, int b)
{
long long c = a;
long long d = b;
return c == d;
}
int f1(int a, int b)
{
return ((long long) a) == ((long long)b);
}
But don't at least on powerpc-darwin:
_f:
srawi r0,r3,31
srawi r2,r4,31
cmpw cr7,r0,r2
mr r9,r3
li r3,0
bnelr+ cr7
cmpw cr7,r9,r4
bnelr+ cr7
li r3,1
blr
_f1:
xor r3,r3,r4
cntlzw r3,r3
srwi r3,r3,5
blr
Even powerpc64-darwin does not produce the same asm, in this case f1 is worse
than f:
_f:
xor r3,r3,r4
cntlzd r3,r3
srdi r3,r3,6
blr
_f1:
xor r4,r3,r4
cntlzw r4,r4
srwi r4,r4,5
extsw r3,r4
blr
But only because there is an extra sign extends (I will file this in a
different bug).
--
Summary: (long long)(int_var) == (long long)(int_var1) is not
simplified down to int_var == int_var1 when "expanded"
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: enhancement
Priority: P3
Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pinskia at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30966
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug tree-optimization/30966] (long long)(int_var) == (long long)(int_var1) is not simplified down to int_var == int_var1 when "expanded"
2007-02-26 11:36 [Bug tree-optimization/30966] New: (long long)(int_var) == (long long)(int_var1) is not simplified down to int_var == int_var1 when "expanded" pinskia at gcc dot gnu dot org
@ 2007-02-26 17:33 ` rguenth at gcc dot gnu dot org
2007-07-01 1:12 ` pinskia at gcc dot gnu dot org
1 sibling, 0 replies; 3+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-02-26 17:33 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from rguenth at gcc dot gnu dot org 2007-02-26 17:33 -------
They also don't on x86_64:
f:
.LFB2:
movslq %edi,%rdi
movslq %esi,%rsi
cmpq %rsi, %rdi
sete %al
movzbl %al, %eax
ret
.LFE2:
.size f, .-f
.globl f1
.type f1, @function
f1:
.LFB3:
cmpl %esi, %edi
sete %al
movzbl %al, %eax
ret
on the tree level this is a missing tree-combiner bug.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |rguenth at gcc dot gnu dot
| |org
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2007-02-26 17:33:12
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30966
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug tree-optimization/30966] (long long)(int_var) == (long long)(int_var1) is not simplified down to int_var == int_var1 when "expanded"
2007-02-26 11:36 [Bug tree-optimization/30966] New: (long long)(int_var) == (long long)(int_var1) is not simplified down to int_var == int_var1 when "expanded" pinskia at gcc dot gnu dot org
2007-02-26 17:33 ` [Bug tree-optimization/30966] " rguenth at gcc dot gnu dot org
@ 2007-07-01 1:12 ` pinskia at gcc dot gnu dot org
1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-07-01 1:12 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from pinskia at gcc dot gnu dot org 2007-07-01 01:12 -------
It turns out this is the same issue as PR 15017. :) Sometimes I file dups
myself :).
*** This bug has been marked as a duplicate of 15017 ***
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |DUPLICATE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30966
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-07-01 1:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-26 11:36 [Bug tree-optimization/30966] New: (long long)(int_var) == (long long)(int_var1) is not simplified down to int_var == int_var1 when "expanded" pinskia at gcc dot gnu dot org
2007-02-26 17:33 ` [Bug tree-optimization/30966] " rguenth at gcc dot gnu dot org
2007-07-01 1:12 ` pinskia at gcc dot gnu dot 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).