http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18908
--- Comment #19 from Richard Guenther 2011-07-20
13:36:33 UTC ---
Author: rguenth
Date: Wed Jul 20 13:36:30 2011
New Revision: 176510
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=176510
Log:
2011-07-20 Richard Guenther
PR middle
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18908
--- Comment #18 from Richard Guenther 2011-07-20
13:35:27 UTC ---
Author: rguenth
Date: Wed Jul 20 13:35:20 2011
New Revision: 176508
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=176508
Log:
2011-07-20 Richard Guenther
PR middle
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18908
Richard Guenther changed:
What|Removed |Added
Status|ASSIGNED|RESOLVED
Resolution|
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18908
--- Comment #16 from Richard Guenther 2011-07-19
13:28:19 UTC ---
Author: rguenth
Date: Tue Jul 19 13:28:15 2011
New Revision: 176460
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=176460
Log:
2011-07-19 Richard Guenther
* expr.c
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18908
--- Comment #15 from Richard Guenther 2011-07-19
08:33:23 UTC ---
On x86_64 we have
f3:
.LFB2:
.cfi_startproc
xorb$1, (%rdi)
andb$1, (%rdi)
ret
already, thus only a truncation to bitfield precision is lef
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18908
Richard Guenther changed:
What|Removed |Added
Status|NEW |ASSIGNED
AssignedTo|unassigned
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18908
Andrew Pinski changed:
What|Removed |Added
CC||ktietz at gcc dot gnu.org,
--- Comment #12 from pinskia at gcc dot gnu dot org 2008-04-30 20:00
---
(In reply to comment #11)
> Still f4 looks weird (wrong-code?!) as we fold *p = ~*p to *p = (int) *p !=
> -1;
> I'll open a PR for this.
We decided this was the correct thing as we start out with ~((int)*p) != 0
--- Comment #11 from rguenth at gcc dot gnu dot org 2008-04-30 19:26
---
On the trunk we have:
f1 (const _Bool * p)
{
:
return (_Bool) ((int) *p & 1);
f2 (const _Bool * p)
{
:
return *p;
f3 (_Bool * p)
{
:
*p = (_Bool) !*p;
f4 (_Bool * p)
{
:
*p = 1;
where i686 assembly loo
--- Comment #10 from pinskia at gcc dot gnu dot org 2006-03-02 14:21
---
(In reply to comment #9)
> Acutally f3 is not fixed but I don't understand how not.
No f3 is fine, f4 is broken still.
*p = (int) *p != -1;
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18908
--- Comment #9 from pinskia at gcc dot gnu dot org 2006-02-18 17:32 ---
Acutally f3 is not fixed but I don't understand how not.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18908
--- Comment #8 from pinskia at gcc dot gnu dot org 2005-11-25 05:06 ---
So now truely only f1 is the only one to fix.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18908
--- Comment #7 from pinskia at gcc dot gnu dot org 2005-11-22 22:24 ---
I think the first one is harder, I think part of this is already done for int
type but not boolean_type maybe that is a hint on how to fix it.
--
pinskia at gcc dot gnu dot org changed:
What|Remov
--- Comment #6 from pinskia at gcc dot gnu dot org 2005-11-22 21:00 ---
The current issue with f4 is that (~((int)a)) != 0 is not converted to ((int)a
!= (~0)) which will then fold to 1, this issue with ~a != 0 not being convert
to a != ~0 is PR 24990 which I am working on a fix.
Then
--- Comment #5 from pinskia at gcc dot gnu dot org 2005-11-22 20:57 ---
f3 problem is PR 24989 which I have a fix for already, testing it right now.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18908
--- Additional Comments From pinskia at gcc dot gnu dot org 2005-05-04
18:15 ---
f2 is now fixed.
--
What|Removed |Added
GCC build triplet|alphaev68-unknown-linux-gnu |
--
Bug 18908 depends on bug 15618, which changed state.
Bug 15618 Summary: Missed bool optimization
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15618
What|Old Value |New Value
--- Additional Comments From pinskia at gcc dot gnu dot org 2005-05-01
18:25 ---
With the patch for PR 15618 applied, f2 is fixed.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18908
--- Additional Comments From sabre at nondot dot org 2005-04-25 20:42
---
note that the correct simplification for f4 is "*p = 1".
-Chris
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18908
--- Additional Comments From pinskia at gcc dot gnu dot org 2004-12-09
17:45 ---
Confirmed here is what we get on ppc:
_f1:
lwz r3,0(r3)
rlwinm r3,r3,0,31,31 <-- not useful
blr
.align 2
.globl _f2
_f2:
lwz r0,0(r3)
addic r2,r0,-1
20 matches
Mail list logo