[Bug target/65010] ppc backend generates unnecessary signed extension

msebor at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Mar 6 22:47:00 GMT 2015


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65010

--- Comment #3 from Martin Sebor <msebor at gcc dot gnu.org> ---
Created attachment 34978
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34978&action=edit
.expand RTL dump for simplified test case from comment #1.

(In reply to Jeffrey A. Law from comment #2)

Sure.  The dumps is where I started as well.  The first dump I see the sign
extension is in .expand (attached).  The .optimized dump below reflects what I
would expect: the argument is sign extended before the addition.  But the
.expand dump shows the sign extension taking place after the addition.

;; Function foobar (foobar, funcdef_no=0, decl_uid=2346, cgraph_uid=0,
symbol_order=0)

foobar (signed char c)
{
  int _2;
  int _3;

  <bb 2>:
  _2 = (int) c_1(D);
  _3 = _2 + 1;
  return _3;

}



More information about the Gcc-bugs mailing list