[Bug libstdc++/19060] fstream.tellp() result not changed after some output
--- Additional Comments From wanderer at rsu dot ru 2004-12-31 18:39 --- This more simplifed version of your last testcase also catch -O2 problem: #include typedef int __attribute__((__mode__(__DI__))) off_t; static long long min() throw() { return -9223372036854775807LL - 1; } static long long max() throw() { return 9223372036854775807LL; } void seekoff(off_t __off) { if (__off > max() || __off < min()) assert(false); } int main() { seekoff(10); return 0; } -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19060
[Bug libstdc++/19060] fstream.tellp() result not changed after some output
--- Additional Comments From pcarlini at suse dot de 2004-12-31 18:29 --- Andrew, this is *definitely* target dependent: it's about such a basic feature that we would have noticed, otherwise! (btw, thanks for the reduced testcase!) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19060
[Bug libstdc++/19060] fstream.tellp() result not changed after some output
--- Additional Comments From pinskia at gcc dot gnu dot org 2004-12-31 18:20 --- Hmm, this is the reduced testcase but it was not miscompiled as far as I can see: typedef int __attribute__((__mode__(__DI__))) __int64_t; typedef __int64_t int64_t; typedef int64_t streamoff; typedef __int64_t __off_t; typedef __off_t off_t; static long long min() throw() { return -9223372036854775807LL - 1; } static long long max() throw() { return 9223372036854775807LL; } __off_t lseek(int, __off_t, int); streamoff seekoff(streamoff __off) { if (__off > max() || __off < min()) return -1L; return 0; } -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19060
[Bug libstdc++/19060] fstream.tellp() result not changed after some output
--- Additional Comments From wanderer at rsu dot ru 2004-12-31 17:59 --- Created an attachment (id=7853) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=7853&action=view) .s compiled from basic_file.cc with -O2 (miscompiled version) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19060
[Bug libstdc++/19060] fstream.tellp() result not changed after some output
--- Additional Comments From wanderer at rsu dot ru 2004-12-31 17:58 --- Created an attachment (id=7852) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=7852&action=view) .s compiled from basic_file.cc with default oprions -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19060
[Bug libstdc++/19060] fstream.tellp() result not changed after some output
--- Additional Comments From wanderer at rsu dot ru 2004-12-31 17:58 --- I extract problematic compiled (with -O2) function: ---8X- #include #include #include // For ::max() and min() and ::max() namespace std { streamoff __basic_file::seekoff(streamoff __off, ios_base::seekdir __way) { if (__off > numeric_limits::max() || __off < numeric_limits::min()) return -1L; return lseek(this->fd(), __off, __way); } } // namespace std ---X8- -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19060
[Bug libstdc++/19060] fstream.tellp() result not changed after some output
--- Additional Comments From wanderer at rsu dot ru 2004-12-31 17:17 --- Created an attachment (id=7849) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=7849&action=view) .s compiled from basic_file.cc with -O2 (miscompiled version) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19060
[Bug libstdc++/19060] fstream.tellp() result not changed after some output
--- Additional Comments From wanderer at rsu dot ru 2004-12-31 17:16 --- Created an attachment (id=7848) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=7848&action=view) .s compiled from basic_file.cc with default oprions -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19060
[Bug libstdc++/19060] fstream.tellp() result not changed after some output
--- Additional Comments From wanderer at rsu dot ru 2004-12-31 17:15 --- Created an attachment (id=7847) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=7847&action=view) .ii file from gcc build object directory -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19060
[Bug libstdc++/19060] fstream.tellp() result not changed after some output
--- Additional Comments From wanderer at rsu dot ru 2004-12-31 17:13 --- At this moment i can't extract simple testcase. But problem indeed in miscompiletion. I am use modified testcase (additionl debug output line before assert (and iostream header include: std::cout << "begin==" << startpos << " end==" << endpos << "\n"; Valid output: "begin==0 end==8" Invalid output:"begin==-1 end==-1" I bootstrap GCC from current sources with additional -save-temps flag and compile and link libsupc++.a library and requred for my testcase .ii (renamed to .cc) files from libstdc++ library. Final testcase executible work without problems with valid output. But if i compile basic_file.cc (renamed .ii version) with -O2 option then testcase executible run terminated with invalid output "begin==-1 end==- 1" and assert fail. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19060
[Bug libstdc++/19060] fstream.tellp() result not changed after some output
--- Additional Comments From pcarlini at suse dot de 2004-12-31 11:07 --- In my opinion, this is definitely a (target dependent) code generation bug, rather serious, if confirmed. As such, we should do our best to reduce it and recategorize in the right way. Any chance you can try to reduce it to a short, pure c++ snippet? The relevant library code is quite straightforward. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19060
[Bug libstdc++/19060] fstream.tellp() result not changed after some output
--- Additional Comments From wanderer at rsu dot ru 2004-12-24 00:05 --- Good news: i found commit when problem arised: http://gcc.gnu.org/ml/gcc- cvs/2003-10/msg01125.html Before this commit testcase compile without problems. After this commit testcase compilation failed. Bad news: This is merge from mainline to tree-ssa. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19060
[Bug libstdc++/19060] fstream.tellp() result not changed after some output
--- Additional Comments From pcarlini at suse dot de 2004-12-19 00:03 --- Cannot reproduce on i686-pc-linux-gnu too. I would suggest recategorizing as 'target'. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19060
[Bug libstdc++/19060] fstream.tellp() result not changed after some output
--- Additional Comments From wanderer at rsu dot ru 2004-12-18 20:08 --- At my FreebSD 5.3 problem show-up with GCC mainline sources in range: At 2004-05-10 testcase work fine At 2004-05-14 testcase failed And i think this point to "The tree-ssa branch has been merged into mainline." event. I will attempt locate problematic commit at tree-ssa branch. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19060
[Bug libstdc++/19060] fstream.tellp() result not changed after some output
--- Additional Comments From wanderer at rsu dot ru 2004-12-17 18:44 --- First time i see this problem in september-october. Now i only fill PR. Program work for me only if it used gcc 3.4.x shared libraries. ~/pkg/gcc/bin/g++ test.cc setenv LD_LIBRARY_PATH $HOME/pkg/gcc_34/lib ./a.out setenv LD_LIBRARY_PATH $HOME/pkg/gcc/lib ./a.out Assertion failed: (endpos != startpos), function main, file test.cc, line 15. Abort (core dumped) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19060
[Bug libstdc++/19060] fstream.tellp() result not changed after some output
--- Additional Comments From pinskia at gcc dot gnu dot org 2004-12-17 18:33 --- Hmm, it works for me on ppc-darwin with the mainline (20041215 and 20041214 and 20041213). -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19060
[Bug libstdc++/19060] fstream.tellp() result not changed after some output
--- Additional Comments From wanderer at rsu dot ru 2004-12-17 18:31 --- Created an attachment (id=7773) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=7773&action=view) .s file -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19060
[Bug libstdc++/19060] fstream.tellp() result not changed after some output
--- Additional Comments From wanderer at rsu dot ru 2004-12-17 18:31 --- Created an attachment (id=7772) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=7772&action=view) .ii file -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19060