Changes

Jump to: navigation, search

GCC alwayszero function attribute

586 bytes added, 21:12, 23 October 2009
no edit summary
if (is_gimple_call (stmt))
fprintf(stderr, "Call flagsfrom tree-ssa-ccp.c: %d\n", gimple_call_flags (stmt));
/* End My Debugging Statement */
/* My debugging statement */
if (decl)
{ fprintf(stderr, "Call flags from tree-optimize.c: %d\n", gimple_call_flags (stmt)); }
/* End my debugging statement */
return todo;
}
</pre>
 
Sample program:
 
<pre>
/* blah.h */
class Blah {
public:
virtual int blah() __attribute__((nothrow));
};
 
/* blah.cpp */
#include "blah.h"
int Blah::blah() {
return 0;
}
 
/* main.cpp */
#include "blah.h"
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
Call flags from tree-optimize.c: 64
Call flags from tree-optimize.c: 64
</pre>
1
edit

Navigation menu