public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/37516]  New: ~(-2 - a) is not being optimized into a + 1
@ 2008-09-14  3:37 pinskia at gcc dot gnu dot org
  2008-09-14  3:37 ` [Bug rtl-optimization/37516] " pinskia at gcc dot gnu dot org
  2008-09-14  4:57 ` pinskia at gcc dot gnu dot org
  0 siblings, 2 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-09-14  3:37 UTC (permalink / raw)
  To: gcc-bugs

I noticed this when looking into PR 34087 with connection of a patch I wrote
for loop-doloop.c which is supposed to reduce the number of instructions.
Anyways the following two functions are equivalent but are not optimized that
way:
int f(int a)
{
  a = -2 - a;
  return -(a+1);
}

int f1(int a)
{
  return a + 1;
}


-- 
           Summary: ~(-2 - a) is not being optimized into a + 1
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: rtl-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pinskia at gcc dot gnu dot org


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


^ permalink raw reply	[flat|nested] 9+ messages in thread
[parent not found: <bug-37516-4@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2021-08-03 23:03 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-14  3:37 [Bug rtl-optimization/37516] New: ~(-2 - a) is not being optimized into a + 1 pinskia at gcc dot gnu dot org
2008-09-14  3:37 ` [Bug rtl-optimization/37516] " pinskia at gcc dot gnu dot org
2008-09-14  4:57 ` pinskia at gcc dot gnu dot org
     [not found] <bug-37516-4@http.gcc.gnu.org/bugzilla/>
2012-02-23  8:48 ` pinskia at gcc dot gnu.org
2012-02-23  9:17 ` rguenther at suse dot de
2012-02-23 22:16 ` pinskia at gcc dot gnu.org
2012-02-24  9:03 ` rguenther at suse dot de
2012-02-26  1:43 ` pinskia at gcc dot gnu.org
2021-08-03 23:03 ` pinskia at gcc dot gnu.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).