public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* C++ Front-end or inliner bug with tree-ssa
@ 2004-03-15 18:01 law
  0 siblings, 0 replies; only message in thread
From: law @ 2004-03-15 18:01 UTC (permalink / raw)
  To: jason, jh; +Cc: gcc


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





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-03-15 18:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-15 18:01 C++ Front-end or inliner bug with tree-ssa law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).