public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug optimization/14287] New: [tree-ssa] does not remove unnecessary extensions
@ 2004-02-25  4:11 kazu at cs dot umass dot edu
  2004-02-25  4:55 ` [Bug optimization/14287] " pinskia at gcc dot gnu dot org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: kazu at cs dot umass dot edu @ 2004-02-25  4:11 UTC (permalink / raw)
  To: gcc-bugs

/* test.c */

short g, h;

void
foo (long a)
{
  short b = a & 3;
  long c = b;
  g = c;
  h = c;
}

test.c.t20.dom1 looks like so:

foo (a)
{
  long int c;
  short int b;
  short int T.1;
  short int T.0;

<bb 0>:
  T.0_2 = (short int)a_1;
  b_3 = T.0_2 & 3;
  c_4 = (long int)b_3;
  T.1_5 = (short int)c_4; <- Hey, T.1_5 == b_3!
  g = T.1_5;
  T.1_6 = T.1_5;
  h = T.1_5;
  return;
}

Here is the asm:

foo:
	movl	4(%esp), %eax
	andl	$3, %eax
	cwtl                   <- ugly
	movw	%ax, g
	movw	%ax, h
	ret

I inserted "g" and "h" to kill the combiner as it performs badly
when there are multiple uses of variables. :-)
The exactly same problem appears on H8.

-- 
           Summary: [tree-ssa] does not remove unnecessary extensions
           Product: gcc
           Version: tree-ssa
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P2
         Component: 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, h8300-elf


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


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2004-06-21  5:07 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-25  4:11 [Bug optimization/14287] New: [tree-ssa] does not remove unnecessary extensions kazu at cs dot umass dot edu
2004-02-25  4:55 ` [Bug optimization/14287] " pinskia at gcc dot gnu dot org
2004-02-25  5:18 ` pinskia at gcc dot gnu dot org
2004-02-25 18:51 ` amacleod at redhat dot com
2004-03-03 18:13 ` kazu at cs dot umass dot edu
2004-03-04  4:08 ` kazu at cs dot umass dot edu
2004-03-16 21:50 ` pinskia at gcc dot gnu dot org
2004-03-17  1:46 ` pinskia at gcc dot gnu dot org
2004-04-03  5:06 ` pinskia at gcc dot gnu dot org
2004-05-17 17:20 ` [Bug tree-optimization/14287] " pinskia at gcc dot gnu dot org
2004-05-24 16:53 ` pinskia at gcc dot gnu dot org
2004-06-21  5:07 ` 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).