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 middle-end/56212] New: Does not fold unsigned (b - a) + a


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

             Bug #: 56212
           Summary: Does not fold unsigned (b - a) + a
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: rguenth@gcc.gnu.org


unsigned foo (unsigned a, unsigned b)
{
  return (b - a) + a;
}

should be simplified to return b.  Later GIMPLE reassoc and forwprop do that
job.


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