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/9566] Inline function produces much worse code than manual inlining.


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-12-01 03:51 -------
Here is valid (correctly initializing "a") code which shows the problem on the tree-ssa and on the 
mainline:
struct A {
  char const* src;
  char* dest;
  void copy() { *++dest = *++src; }
};

void g1(A *b) {
  A a = *b;
  for(int i = 0; i < 10; ++i)
    a.copy();
}

void g2(A* b) {
  A a = *b;
  for(int i = 0; i < 10; ++i)
    *++a.dest = *++a.src;
}

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2003-11-04 14:43:47         |2003-12-01 03:51:57
               date|                            |


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


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