[Bug c++/30637] The options -fno-unit-at-a-time and -finline-functions generates erroneous code

2007-02-09 Thread reichelt at gcc dot gnu dot org


--- Comment #7 from reichelt at gcc dot gnu dot org  2007-02-09 22:09 
---
Sorry, I wasn't quite right with my comment:
The bug *is* related to -fno-unit-at-a-time.
It is fixed, because the flag is ignored for C++ since GCC 4.0.0,
i.e. the compiler now always uses the unit-at-a-time mode for C++.


-- 


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



[Bug c++/30637] The options -fno-unit-at-a-time and -finline-functions generates erroneous code

2007-02-08 Thread reichelt at gcc dot gnu dot org


--- Comment #6 from reichelt at gcc dot gnu dot org  2007-02-09 01:16 
---
The bug has nothing to do with -fno-unit-at-a-time.
(It is ignored for C++ anyways.)

The bug is fixed since GCC 4.0.0.

Btw, here's a shorter self-contained program that hangs when compiled with
g++ -O -finline-functions by GCC 3.4.x:


struct A
{
   virtual void FOO() {}
};

struct B
{
  A* p;

  B() : p(new A) {}

  A* foo();
  void bar();
};

A* B::foo()
{
  return p;
}

void B::bar()
{
  foo()-FOO();
}

int main()
{
  B().bar();
  return 0;
}



-- 

reichelt at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||reichelt at gcc dot gnu dot
   ||org
 Status|UNCONFIRMED |RESOLVED
 Resolution||FIXED
   Target Milestone|--- |4.0.0


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



[Bug c++/30637] The options -fno-unit-at-a-time and -finline-functions generates erroneous code

2007-01-30 Thread steby at enea dot se


--- Comment #1 from steby at enea dot se  2007-01-30 10:28 ---
Created an attachment (id=12979)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=12979action=view)
Source code snippet


-- 


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



[Bug c++/30637] The options -fno-unit-at-a-time and -finline-functions generates erroneous code

2007-01-30 Thread steby at enea dot se


--- Comment #2 from steby at enea dot se  2007-01-30 10:29 ---
Created an attachment (id=12980)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=12980action=view)
Disassembly output


-- 


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



[Bug c++/30637] The options -fno-unit-at-a-time and -finline-functions generates erroneous code

2007-01-30 Thread pinskia at gcc dot gnu dot org


--- Comment #3 from pinskia at gcc dot gnu dot org  2007-01-30 10:33 ---
Can you try 4.0.x or 4.1.x as 3.4.x is no longer maintained?


-- 


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



[Bug c++/30637] The options -fno-unit-at-a-time and -finline-functions generates erroneous code

2007-01-30 Thread steby at enea dot se


--- Comment #4 from steby at enea dot se  2007-01-30 10:40 ---
(In reply to comment #3)
 Can you try 4.0.x or 4.1.x as 3.4.x is no longer maintained?

Unfortunately, our system is based on GCC 3.4.x and we cannot easily switch to
GCC 4.x in a short timeframe.


-- 


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



[Bug c++/30637] The options -fno-unit-at-a-time and -finline-functions generates erroneous code

2007-01-30 Thread steby at enea dot se


--- Comment #5 from steby at enea dot se  2007-01-30 10:43 ---
(From update of attachment 12980)
   .file   test.cpp
   .section.text
   .align 2
   .globl _ZN5Actor17getResourceFacadeEv
   .type   _ZN5Actor17getResourceFacadeEv, @function
_ZN5Actor17getResourceFacadeEv:
.LFB2:
   lwz 3,0(3)
   blr
.LFE2:
   .size   _ZN5Actor17getResourceFacadeEv, .-_ZN5Actor17getResourceFacadeEv
   .align 2
   .globl _ZN5Actor9configureEv
   .type   _ZN5Actor9configureEv, @function
_ZN5Actor9configureEv:
.LFB3:
.L3:
   b .L3 - ERROR: Infinite loop!
.LFE3:
   .size   _ZN5Actor9configureEv, .-_ZN5Actor9configureEv
   .ident  GCC: (GNU) 3.4.4


-- 


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