public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/17935] New: Two consecutive movzbl are generated
@ 2004-10-11 16:38 kazu at cs dot umass dot edu
  2004-10-11 17:24 ` [Bug rtl-optimization/17935] [4.0 Regression] " pinskia at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 11+ messages in thread
From: kazu at cs dot umass dot edu @ 2004-10-11 16:38 UTC (permalink / raw)
  To: gcc-bugs

Consider:

struct flags {
  unsigned f0 : 1;
};

_Bool
bar (struct flags *p, struct flags *q)
{
  return (!p->f0 && !q->f0);
}

With "cc1 -O2 -fomit-frame-pointer -march=i386", I get

bar:
	movl	4(%esp), %eax
	testb	$1, (%eax)
	jne	.L9
	movl	8(%esp), %eax
	testb	$1, (%eax)
	sete	%al
	movzbl	%al, %eax
	movzbl	%al, %eax
	ret
	.p2align 2,,3
.L9:
	xorl	%eax, %eax
	movzbl	%al, %eax
	ret

Note the two consecutive movzbl.  We don't need the second one.

Also note the xorl followed by movzbl.  We don't need the movzbl.

-- 
           Summary: Two consecutive movzbl are generated
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: enhancement
          Priority: P2
         Component: rtl-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: kazu at cs dot umass dot edu
                CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17935


^ permalink raw reply	[flat|nested] 11+ messages in thread
[parent not found: <20041011163842.17935.kazu@gcc.gnu.org>]
[parent not found: <bug-17935-5009@http.gcc.gnu.org/bugzilla/>]
[parent not found: <bug-17935-4@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2021-09-06  8:29 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-11 16:38 [Bug rtl-optimization/17935] New: Two consecutive movzbl are generated kazu at cs dot umass dot edu
2004-10-11 17:24 ` [Bug rtl-optimization/17935] [4.0 Regression] " pinskia at gcc dot gnu dot org
2004-10-12 19:20 ` [Bug rtl-optimization/17935] " pinskia at gcc dot gnu dot org
2004-12-12 17:57 ` kazu at cs dot umass dot edu
2004-12-12 18:06 ` pinskia at gcc dot gnu dot org
2005-05-12 17:52 ` pinskia at gcc dot gnu dot org
2005-05-12 23:34 ` dberlin at gcc dot gnu dot org
2005-05-13 10:07 ` uros at kss-loka dot si
     [not found] <20041011163842.17935.kazu@gcc.gnu.org>
2005-09-29  3:47 ` pinskia at gcc dot gnu dot org
     [not found] <bug-17935-5009@http.gcc.gnu.org/bugzilla/>
2006-01-18  5:07 ` pinskia at gcc dot gnu dot org
     [not found] <bug-17935-4@http.gcc.gnu.org/bugzilla/>
2021-09-06  8:29 ` pinskia 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).