[Bug c++/44800] DECL_SAVED_TREE is always null on the first FUNCTION_DECL and is not null on the others

2010-07-04 Thread asmprog32 at hotmail dot com


--- Comment #11 from asmprog32 at hotmail dot com  2010-07-04 09:39 ---
The problem is that i followed also external documentation, where
PLUGIN_OVERRIDE_GATE is used to analyse AST. GCC documentation say to use
PLUGIN_PRE_GENERICIZE and infact it work, so it is a my wrong.


-- 


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



[Bug c++/44800] New: DECL_SAVED_TREE is always null on the first FUNCTION_DECL and is not null on the others

2010-07-03 Thread asmprog32 at hotmail dot com
Look at this simple plugins code

bug.cpp

compile with

g++ -shared -I/usr/local/lib/gcc/i686-pc-linux-gnu/4.5.0/plugin/include -DUNIX
-g -Wall -Werror -O0 -fPIC -DPIC -o libbug.so bug.cpp


than ran this plugins on example.cpp with

g++ -S -fplugin=libbug.so example.cpp

the output


starting libbug
processing example.cpp
unused_f2  0 --- decl saved tree is null
unused_f  0xb7409ad4
main  0xb7496c90
function_1  0xb7496c78


now add a function at the end of the file like example2.cpp

and run the plugins on it

starting libbug
processing example2.cpp
unused_f3  0   --- DECL_SAVED_TREE null
unused_f2  0xb754be28  --- DECL_SAVED_TREE != null
unused_f  0xb74bead4
main  0xb754bc90
function_1  0xb754bc78


It seem that the last (on file) / first (on list) function_decl has always
DECL_SAVED_TREE == null


-- 
   Summary: DECL_SAVED_TREE is always null on the first
FUNCTION_DECL and is not null on the others
   Product: gcc
   Version: 4.5.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: asmprog32 at hotmail dot com
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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



[Bug c++/44800] DECL_SAVED_TREE is always null on the first FUNCTION_DECL and is not null on the others

2010-07-03 Thread asmprog32 at hotmail dot com


--- Comment #1 from asmprog32 at hotmail dot com  2010-07-03 09:52 ---
Created an attachment (id=21072)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21072action=view)
plugins source


-- 


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



[Bug c++/44800] DECL_SAVED_TREE is always null on the first FUNCTION_DECL and is not null on the others

2010-07-03 Thread asmprog32 at hotmail dot com


--- Comment #2 from asmprog32 at hotmail dot com  2010-07-03 09:53 ---
Created an attachment (id=21073)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21073action=view)
example 1


-- 


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



[Bug c++/44800] DECL_SAVED_TREE is always null on the first FUNCTION_DECL and is not null on the others

2010-07-03 Thread asmprog32 at hotmail dot com


--- Comment #3 from asmprog32 at hotmail dot com  2010-07-03 09:54 ---
Created an attachment (id=21074)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21074action=view)
example 2


-- 


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



[Bug c++/44800] DECL_SAVED_TREE is always null on the first FUNCTION_DECL and is not null on the others

2010-07-03 Thread asmprog32 at hotmail dot com


--- Comment #5 from asmprog32 at hotmail dot com  2010-07-03 11:22 ---
(In reply to comment #4)
 bugzilla is not a plugin support forum
 

Infact is not a request of help, DECL_SAVED_TREE is systematicaly Null ONLY and
ALWAYS on the last FUNCTION_DECL, i has thinked this is the normal behaviour.
The code is given only to reproduce the issue.




-- 


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



[Bug c++/44800] DECL_SAVED_TREE is always null on the first FUNCTION_DECL and is not null on the others

2010-07-03 Thread asmprog32 at hotmail dot com


--- Comment #7 from asmprog32 at hotmail dot com  2010-07-04 00:39 ---
(In reply to comment #6)
 Pietro, 
 
 Please explain what is happening and what do you expect to happen, and why do
 you expect that. If you are having troubles about using gcc, please ask in
 gcc-help first.
 

Ok inserting a gcc callback into PLUGIN_OVERRIDE_GATE and analyzing the AST
systematicaly the last function in the file, has no body ( DECL_SAVED_TREE ==
null )

An example

A file has 3 functions (with body), the AST generated report a body
(DECL_SAVED_TREE != null ) on function 1, 2 not on function 3 (last one)

If i add another function , the AST generated report a body on function 1 2 3
not on function 4 

. and so on

What i expect is that all functions must have the body (DECL_SAVED_TREE !=
null). The code attached are examples to reproduce what i have explained.


-- 


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



[Bug c++/44800] DECL_SAVED_TREE is always null on the first FUNCTION_DECL and is not null on the others

2010-07-03 Thread asmprog32 at hotmail dot com


--- Comment #8 from asmprog32 at hotmail dot com  2010-07-04 00:47 ---


After the bug has been closed. i has posted the question to gcc-help, thanks


( i has reported as bug because , i has thinked it was a bug )


-- 


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



[Bug c++/39963] New: undefined reference not signaled

2009-04-29 Thread asmprog32 at hotmail dot com
struct bug
{
int  A;
};

int main()
{
int C = 10;
bug B[5];   //  uninitialized reference
B[0].A = C; //  crash
}


compiled with 
gcc -o bug bug.cpp
withouth errors (the uninitialized reference is not signaled)

class bug
{
int  A;
};

int main()
{
int C = 10;
bug B[5];   //  uninitialized reference
B[0].A = C; //  crash
}

compiled with 
gcc -o bug bug.cpp
withouth errors (the uninitialized reference is not signaled)

class bug
{
public:
int  A;

bug()   {};
~bug()  {};

};

int main()
{
int C = 10;
bug B[5];   //  uninitialized reference
B[0].A = C; //  crash
}


compiled with 
gcc -o bug bug.cpp
bug.cpp: In constructor ‘bug::bug()’:
bug.cpp:8: error: uninitialized reference member ‘bug::A’

The uninitialized reference must be signaled in the first two cases ? I am not
sure, so i report it
( g++ same behaviour )


Here gcc -v

Using built-in specs.
Target: i386-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla
--enable-bootstrap --enable-shared --enable-threads=posix
--enable-checking=release --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions
--enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk
--disable-dssi --enable-plugin
--with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre
--enable-libgcj-multifile --enable-java-maintainer-mode
--with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib
--with-cpu=generic --build=i386-redhat-linux
Thread model: posix
gcc version 4.3.2 20081105 (Red Hat 4.3.2-7) (GCC)


-- 
   Summary: undefined reference not signaled
   Product: gcc
   Version: 4.3.2
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: asmprog32 at hotmail dot com


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



[Bug c++/39965] New: undefined reference not signaled

2009-04-29 Thread asmprog32 at hotmail dot com
struct bug
{
int  A;
};

int main()
{
int C = 10;
bug B[5];   //  uninitialized reference
B[0].A = C; //  crash
}


compiled with 
gcc -o bug bug.cpp
withouth errors (the uninitialized reference is not signaled)

class bug
{
int  A;
};

int main()
{
int C = 10;
bug B[5];   //  uninitialized reference
B[0].A = C; //  crash
}

compiled with 
gcc -o bug bug.cpp
withouth errors (the uninitialized reference is not signaled)

class bug
{
public:
int  A;

bug()   {};
~bug()  {};

};

int main()
{
int C = 10;
bug B[5];   //  uninitialized reference
B[0].A = C; //  crash
}


compiled with 
gcc -o bug bug.cpp
bug.cpp: In constructor ‘bug::bug()’:
bug.cpp:8: error: uninitialized reference member ‘bug::A’

The uninitialized reference must be signaled in the first two cases ? I am not
sure, so i report it
( g++ same behaviour )


Here gcc -v

Using built-in specs.
Target: i386-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla
--enable-bootstrap --enable-shared --enable-threads=posix
--enable-checking=release --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions
--enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk
--disable-dssi --enable-plugin
--with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre
--enable-libgcj-multifile --enable-java-maintainer-mode
--with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib
--with-cpu=generic --build=i386-redhat-linux
Thread model: posix
gcc version 4.3.2 20081105 (Red Hat 4.3.2-7) (GCC)


-- 
   Summary: undefined reference not signaled
   Product: gcc
   Version: 4.3.2
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: asmprog32 at hotmail dot com


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



[Bug c++/39966] New: undefined reference not signaled

2009-04-29 Thread asmprog32 at hotmail dot com
struct bug
{
int  A;
};

int main()
{
int C = 10;
bug B[5];   //  uninitialized reference
B[0].A = C; //  crash
}


compiled with 
gcc -o bug bug.cpp
withouth errors (the uninitialized reference is not signaled)

class bug
{
int  A;
};

int main()
{
int C = 10;
bug B[5];   //  uninitialized reference
B[0].A = C; //  crash
}

compiled with 
gcc -o bug bug.cpp
withouth errors (the uninitialized reference is not signaled)

class bug
{
public:
int  A;

bug()   {};
~bug()  {};

};

int main()
{
int C = 10;
bug B[5];   //  uninitialized reference
B[0].A = C; //  crash
}


compiled with 
gcc -o bug bug.cpp
bug.cpp: In constructor ‘bug::bug()’:
bug.cpp:8: error: uninitialized reference member ‘bug::A’

The uninitialized reference must be signaled in the first two cases ? I am not
sure, so i report it
( g++ same behaviour )


Here gcc -v

Using built-in specs.
Target: i386-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla
--enable-bootstrap --enable-shared --enable-threads=posix
--enable-checking=release --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions
--enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk
--disable-dssi --enable-plugin
--with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre
--enable-libgcj-multifile --enable-java-maintainer-mode
--with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib
--with-cpu=generic --build=i386-redhat-linux
Thread model: posix
gcc version 4.3.2 20081105 (Red Hat 4.3.2-7) (GCC)


-- 
   Summary: undefined reference not signaled
   Product: gcc
   Version: 4.3.2
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: asmprog32 at hotmail dot com


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