c++/6546: static const members optimization failure

Dan Nicolaescu dann@godzilla.ICS.UCI.EDU
Wed May 22 11:00:00 GMT 2002


Jakub Jelinek writes:

  > State-Changed-From-To: open->analyzed
  > State-Changed-By: jakub
  > State-Changed-When: Fri May  3 10:07:14 2002
  > State-Changed-Why:
  >     I think this basically waits for the AST optimizations.
  >     In the meantime, something like:
  >     
  >     --- gcc/expr.c.jj       Fri May  3 18:58:54 2002
  >     +++ gcc/expr.c  Fri May  3 19:12:33 2002
  >     @@ -6667,6 +6667,35 @@ expand_expr (exp, target, tmode, modifie
  >                 GEN_INT (trunc_int_for_mode (TREE_STRING_POINTER (string)
  >                                              [TREE_INT_CST_LOW (index)], mode));
[snip]
    
I have something to add to this:

Looking at the .rtl dump generated by 2.95 you can see that there's
nothing there about "maxSegment". 
That is not true for 3.x


adaptive:/tmp> grep maxSegment n.cc.rtl 
Exit 1
adaptive:/tmp> grep maxSegment n.cc.00.rtl 
        (high:SI (symbol_ref:SI ("_ZN3Foo11maxSegmentsE")))) -1 (nil)
            (symbol_ref:SI ("_ZN3Foo11maxSegmentsE")))) -1 (nil)
    (expr_list:REG_EQUAL (symbol_ref:SI ("_ZN3Foo11maxSegmentsE"))
        (high:SI (symbol_ref:SI ("_ZN3Foo11maxSegmentsE")))) -1 (nil)
            (symbol_ref:SI ("_ZN3Foo11maxSegmentsE")))) -1 (nil)
    (expr_list:REG_EQUAL (symbol_ref:SI ("_ZN3Foo11maxSegmentsE"))
        (high:SI (symbol_ref:SI ("_ZN3Foo11maxSegmentsE")))) -1 (nil)
            (symbol_ref:SI ("_ZN3Foo11maxSegmentsE")))) -1 (nil)
    (expr_list:REG_EQUAL (symbol_ref:SI ("_ZN3Foo11maxSegmentsE"))

It seems to me that something might have got lost in the tree->rtl
conversion in 3.[01]. I don't know that code, so I can't check. :-(

Can this be added to the 3.1 regressions list? 




More information about the Gcc-bugs mailing list