There seems to be a code quality regression in tree-ssa between 2004/03/08 and 2004/03/20 The .vars dump for generate-3.4.ii from PR8361 generated by gcc version 3.5-tree-ssa 20040308 (merged 20040305) has 100840 lines the one generated by gcc version 3.5-tree-ssa 20040320 (merged 20040307) has 85811 lines. Granted the number of lines in .vars is not the best measure of code quality, but given the 15% size difference something seems wrong. Looking at the diff between the 2 I saw the following type of difference in a few places: <L5>:; - if (__result == __first) goto <L6>; else goto <L7>; + se = (struct ELEMENT &)__first; + if (__result == (struct ELEMENT * const)se) goto <L6>; else goto <L7>; Given that this code is from std::vector::iterator it appears in quite a few places. Look for example at: typename std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(__gnu_cxx::__normal_iterator<_Tp*, std::vector<_Tp, _Alloc> >, __gnu_cxx::__normal_iterator<_Tp*, std::vector<_Tp, _Alloc> >) [with _Tp = STACK<int>::ELEMENT, _Alloc = std::allocator<STACK<int>::ELEMENT>] (this, __first, __last) Another oddity is code like: <L38>:; __first = __first; __result = __result;
Assigning to Diego.
I think this is better now but I might be looking into the wrong .vars the one with my cast pass included.
I think these regressions come from the movement away from convert to fold_convert in the middle-end. I think I have a fix which also gets rid of most of the usefulness of my cast pass.
And no my patch did not fix this part but another some more work in fold_convert can help.
Mine caused by Dale's patch to use the language hooks. I have a patch.
Here is the patch: Index: tree-ssa.c =============================================================== ==== RCS file: /cvs/gcc/gcc/gcc/tree-ssa.c,v retrieving revision 2.3 diff -u -p -r2.3 tree-ssa.c --- tree-ssa.c 14 May 2004 02:29:23 -0000 2.3 +++ tree-ssa.c 2 Jun 2004 04:32:50 -0000 @@ -555,7 +555,8 @@ tree_ssa_useless_type_conversion_1 (tree so strip conversions that just switch between them. */ else if (POINTER_TYPE_P (inner_type) && POINTER_TYPE_P (outer_type) - && lang_hooks.types_compatible_p (inner_type, outer_type)) + && lang_hooks.types_compatible_p (TREE_TYPE (inner_type), + TREE_TYPE (outer_type))) return true; /* If both the inner and outer types are integral types, then the
Much newer and simpler patch: <http://gcc.gnu.org/ml/gcc-patches/2004-06/msg00087.html>.
(In reply to comment #7) > Much newer and simpler patch: <http://gcc.gnu.org/ml/gcc-patches/2004-06/msg00087.html>. Great! Thanks for taking care of this! Could you also post some before and after numbers? They should be very interesting. Like the number of lines in the dump files, or the number of temp variables created.
Subject: Bug 14736 CVSROOT: /cvs/gcc Module name: gcc Changes by: pinskia@gcc.gnu.org 2004-06-02 18:56:54 Modified files: gcc : ChangeLog tree-ssa.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/g++.dg/tree-ssa: ssa-cast-1.C ssa-sra-1.C ssa-sra-2.C Log message: 2004-06-02 Andrew Pinski <pinskia@physics.uc.edu> PR tree-optimization/14736 * g++.dg/tree-ssa/ssa-cast-1.C: New Test. PR tree-optimization/14042 * g++.dg/tree-ssa/ssa-sra-1.C: New Test. PR tree-optimization/14729 * g++.dg/tree-ssa/ssa-sra-2.C: New Test. 2004-06-02 Andrew Pinski <pinskia@physics.uc.edu> PR tree-optimization/14042 PR tree-optimization/14729 PR tree-optimization/14736 * tree-ssa.c: Check the type which the pointer points to instead of the pointer types. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.3822&r2=2.3823 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-ssa.c.diff?cvsroot=gcc&r1=2.3&r2=2.4 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3804&r2=1.3805 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/tree-ssa/ssa-cast-1.C.diff?cvsroot=gcc&r1=NONE&r2=1.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/tree-ssa/ssa-sra-1.C.diff?cvsroot=gcc&r1=NONE&r2=1.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/tree-ssa/ssa-sra-2.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
Dann, sorry I did not do any timings or any other numbers because I was to lazy to do any and I wantted to get this in and fixed.
Fixed.