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]
Other format: [Raw text]

C++ Front-end or inliner bug with tree-ssa


Compiling the attached code with -O2 -fuse-cxa-atexit will cause the compiler 
to
abort/crash in write_mangled_name.

It appears that the fundamental problem is build_vec_delete_1 creates a
temporary variable D1495 in the catch block:

            catch
              {
                {
                  register struct string * <D1495>;

                  if (<D1492> != 0B)
                    {
                      T.0 = <D1492> - <D1494>;
                      <D1495> = T.0 + 4B;

[ ... ]

However, by the time we have gimplified the function the variable has
changed subtly:


                      register struct string * <D1545>;
    
                      if (<D1537> != 0B) 
                        {
                          T.0 = <D1537> - <D1539>;
                          <D1495> = T.0 + 4B;
                          <D1546>:;
                          T.1 = <D1495>;
                          if (<D1537> == T.1)


Note how the variable is now called D1545, yet variable D1495 is still being
used in the code.  My best guess is this is caused by the inliner.

When all it said and done in the optimizers we have references to D1495, but
D1495 is not declared anywhere and is thus not expanded by expand_used_vars.
All hell breaks loose after that resulting in a call to make_decl_rtl on an
automatic variable.  Not good.

This is causing a large number of C++ packages in FC2 to fail to build with
the tree-ssa compiler (Diego's tree-ssa RPMs have   --enable-__cxa_atexit
on by default).  In fact, it's probably the single biggest cause of package
build failures using the tree-ssa compilers.



class string {
public:
  string();
  ~string();
};
string commands[5];

jeff






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