This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug optimization/14792] New: [tree-ssa] cast elimination opportunity involving an AND


Consider:

void bar (void);

void
foo (unsigned int a)
{
  int b = a;
  if (b & 1)
    bar ();
}

I get:
foo (a)
{
  int b;
  _Bool T.1;
  int T.0;

<bb 0>:
  b_2 = (int)a_1;
  T.0_3 = b_2 & 1;
  T.1_4 = (_Bool)T.0_3;
  if (T.1_4) goto <L0>; else goto <L1>;

<L0>:;
  bar () [tail call];

<L1>:;
  return;

}

We could skip "b" like so

  T.0_3 = a_1 & 1;

-- 
           Summary: [tree-ssa] cast elimination opportunity involving an AND
           Product: gcc
           Version: tree-ssa
            Status: UNCONFIRMED
          Keywords: pessimizes-code
          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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]