This is the mail archive of the gcc@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]

optimize option, template and purify


Hi,

I don't have enough time now, so I can't create code snippet to
demonstrate this problem. (I will, when I have enough time.) So this
time, I'd like to report this to egcs people.

I don't know whether purify (the version I'm using is 4.1, supports
Solaris 2.6, and still in beta I believe) is bad or not yet. 
	
   * * *

I've been using egcs compiler using STL template. I'm testing my code
using purify also.

I've been experiencing following problem:

[ current platform: sparc-sun-solaris2.6
  compiler: via CVS  on  98/03/11 15:33 JST.
  detailed repots are posted on <19980311203457Z.shigeya@foretune.co.jp> ]


1. If I turned off optimize option (via -O0 or without -O) purify yelling
   like following or simliar.

	------------------------------ cut cut
UMR: Uninitialized memory read (2 times):
  * This is occurring while in:
	__uninitialized_copy_aux__H2ZPcZPc_X01T0X11G11__true_type_X11 [stl_uninitialized.h:42]
	__uninitialized_copy__H3ZPcZPcZc_X01T0X11PX21_X11 [stl_uninitialized.h:66]
	uninitialized_copy__H2ZPcZPc_X01T0X11_X11 [stl_uninitialized.h:73]
	allocate_and_copy__H1ZPc_t6vector2ZcZt24__default_alloc_template2b0i0UiX01X01_Pc [stl_vector.h:228]
	reserve__t6vector2ZcZt24__default_alloc_template2b0i0Ui [stl_vector.h:132]
	string::replace(const char*) [mstring.h:34]
  * Reading 1 byte from 0xefffeb0f on the stack.
  * Address 0xefffeb0f is 17 bytes below frame pointer in function __uninitialized_copy__H3ZPcZPcZc_X01T0X11PX21_X11.
	------------------------------ cut cut

You can see this error is very weired.

One note: in some cases where I can remove 'inline' keyword from
template, I could avoid problem. I did this on 9802* snapshot, as I
remember. 


2. I haven't realized this, but if I turn on optimize option (at least -O)
   all of above template related error disappered :-<


So, is always best to turn on -O?

Someone know this kind of problem?

shigeya



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