On s390x, there are some libstdc++ failures that are not present on other platforms. Here is a representative test run: http://gcc.gnu.org/ml/gcc-testresults/2009-01/msg02102.html And here is the failure analysis: http://gcc.gnu.org/ml/libstdc++/2009-01/msg00109.html The following fails appear to be spurious and only occur on s390x. At first I thought this might be because of the extra flags "-fstack-protector --param=ssp-buffer-size=4" but compiling the problem testcases on x86_64/linux with the same flag doesn't show an error. So, I don't know what's up. The same testcases (when present) pass without error on 4.3.2. FAIL: 21_strings/basic_string/element_access/wchar_t/empty.cc FAIL: 23_containers/list/modifiers/1.cc FAIL: 23_containers/list/modifiers/3.cc FAIL: 23_containers/list/modifiers/insert/25288.cc The usual error looks like: warning: dereferencing pointer '<anonymous>' does break strict-aliasing rules which is incomprehensible.
This is likely because of different inlining decisions which is possibly because of different insn costs which depend on MOVE_MAX_PIECES and MOVE_RATIO. The warning itself hints at either an alias problem in the testcase or the library or at a problem with points-to analysis.
Does the following patch fix this? http://gcc.gnu.org/ml/gcc-patches/2009-01/msg01245.html If so please mark this bug as a dup of PR38503.
In the meanwhile the patch for PR38503 has been installed and unfortunately I have to report that this issue seems indeed different, eg, this testcase is still not fixed on x86_64-linux: #include <string> #include <list> class A; class B { public: void foo(A&); std::string s; }; class A { public: A& qaz() { l.push_back( new A() ); return *l.back(); } std::list<A*> l; }; void bar() { A a; B b; b.foo(a.qaz()); }
Confirmed on i?86 as well, even with 4.3 headers: ./cc1plus -quiet -O2 -Wall /tmp/t.ii t.C: In function 'void bar()': t.C:16: warning: dereferencing pointer '<anonymous>' does break strict-aliasing rules /usr/include/c++/4.3/bits/stl_list.h:132: note: initialized from here I will have a looksee.
For hook (D.15560_20, &a.l.D.14002._M_impl._M_node); we somehow compute the wrong ESCAPED solution. ESCAPED = { NULL ANYTHING ESCAPED NONLOCAL a b D.15681 } this is missing a.32+32. Bah, it turns out I again have this fixed on the alias-improvements branch. So - I have a patch.
Subject: Bug 38937 Author: rguenth Date: Sat Jan 31 10:25:41 2009 New Revision: 143819 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=143819 Log: 2009-01-30 Richard Guenther <rguenther@suse.de> PR tree-optimization/38937 * tree-ssa-structalias.c (do_sd_constraint): Do not shortcut computing the transitive closure. Modified: trunk/gcc/ChangeLog trunk/gcc/tree-ssa-structalias.c
Fixed.
Don't we need to add a testcase in comment #3?
Feel free to reduce one. I think using libstdc++ in g++.dg is not possible?
Subject: Bug 38937 Author: rguenth Date: Mon Feb 2 10:39:12 2009 New Revision: 143864 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=143864 Log: 2009-02-02 Richard Guenther <rguenther@suse.de> PR tree-optimization/38937 * g++.dg/warn/Wstrict-aliasing-bogus-escape.C: New testcase. Added: trunk/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-bogus-escape.C Modified: trunk/gcc/testsuite/ChangeLog