Open main menu

CDOT Wiki β

Changes

GCC alwayszero function attribute

296 bytes added, 20:15, 23 October 2009
no edit summary
== Possible Bug ==
Recognizing Calling gimple_call_flags on a gimple stmt representing an indirect call to a virtual method (with a function attribute) always returns 0. This is even though the correct nonzero value of the call flags can be recognized from other parts of gcc.
In For example: tree-ssa-ccp.cmodified with a debugging statement:
<pre>
/* Compute a default value for variable VAR and store it in the
</pre>
In tree-optimize.cmodified with a debugging statement:
<pre>
/* blah.h */
class Blah {
public: virtual int blah() __attribute__((nothrow));
};
/* blah.cpp */
#include "blah.h"
 
int Blah::blah() {
return 0;
}
int main()
{
Blah b; Blah* p = &b; int x; x = p->blah(); return 0;
}
</pre>
Compiling sample program with gcc trunk build containing above debugging statements:
<pre>
[ehren@australia 2]$ ~/gcc/dist/bin/g++ blah.cpp main.cpp -O2
Call flags from tree-optimize.c: 64
Call flags from tree-ssa-ccp: 0
1
edit