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 tree-optimization/21520] New: missing PRE opportunity with cast after cast


The following code we miss a PRE opportunity

int do_locator (int *call)
{
  int type = 1;
  if (call != 0)
    type = *call;
  return (int)(char)type;
}

We should get:
int do_locator (int *call)
{
  int type = 1;
  if (call != 0)
    type = (int)(char)*call;
  return type;
}

But right now we get:
int do_locator (int *call)
{
  char t = 1;
  if (call != 0)
    t = (char)*call;
  return (int)t;
}

-- 
           Summary: missing PRE opportunity with cast after cast
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: enhancement
          Priority: P2
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pinskia at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org


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


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