This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/15826] don't use "if" to extract a single bit bit-field.
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Apr 2008 19:21:44 -0000
- Subject: [Bug tree-optimization/15826] don't use "if" to extract a single bit bit-field.
- References: <bug-15826-5009@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #7 from rguenth at gcc dot gnu dot org 2008-04-30 19:21 -------
On the trunk I have after phiopt1:
;; Function andrew (andrew)
Removing basic block 3
Merging blocks 2 and 4
andrew (struct s * p)
{
_Bool D.1212;
int i;
unsigned int D.1183;
<unnamed-unsigned:1> D.1182;
<bb 2>:
D.1182_3 = p_2(D)->bit;
(void) 0;
D.1212_9 = D.1182_3 != 0;
i_10 = (int) D.1212_9;
D.1183_6 = (unsigned int) i_10;
return D.1183_6;
}
;; Function foo (foo)
Removing basic block 3
Merging blocks 2 and 4
foo (struct s * p)
{
_Bool D.1199;
unsigned int D.1177;
<unnamed-unsigned:1> D.1176;
<bb 2>:
D.1176_3 = p_2(D)->bit;
(void) 0;
D.1199_8 = D.1176_3 != 0;
D.1177_9 = (unsigned int) D.1199_8;
return D.1177_9;
}
which the next forwprop pass optimizes to
foo (struct s * p)
{
unsigned int D.1177;
<unnamed-unsigned:1> D.1176;
<bb 2>:
D.1176_3 = p_2(D)->bit;
D.1177_9 = D.1176_3 != 0;
return D.1177_9;
}
andrew (struct s * p)
{
unsigned int D.1183;
<unnamed-unsigned:1> D.1182;
<bb 2>:
D.1182_3 = p_2(D)->bit;
D.1183_6 = D.1182_3 != 0;
return D.1183_6;
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15826