Bug 12765 - [3.3.2 regression] 2GB mem not enough for sucessful compile
Summary: [3.3.2 regression] 2GB mem not enough for sucessful compile
Status: RESOLVED DUPLICATE of bug 12726
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 3.3.2
: P2 critical
Target Milestone: 3.3.3
Assignee: Jason Merrill
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-10-24 17:11 UTC by Debian GCC Maintainers
Modified: 2005-07-23 22:49 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
preprocessed source (107.53 KB, application/gzip)
2003-10-24 17:12 UTC, Debian GCC Maintainers
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Debian GCC Maintainers 2003-10-24 17:11:31 UTC
This is a regression from 3.3 CVS from 20031005, at least on i486-linux. The
file attached compiles almost instantly with the CVS version, but just eats
memory with the released version.
Comment 1 Debian GCC Maintainers 2003-10-24 17:12:28 UTC
Created attachment 4987 [details]
preprocessed source
Comment 2 Debian GCC Maintainers 2003-10-25 09:39:18 UTC
Introduced by this patch:

2003-10-14  Jason Merrill  <jason@redhat.com>

        PR c++/11878
        * tree.c (build_target_expr_with_type): Call force_rvalue for
        classes with non-trivial copy ctors.


===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/tree.c,v
retrieving revision 1.307.2.4
retrieving revision 1.307.2.5
diff -u -r1.307.2.4 -r1.307.2.5
--- gcc/gcc/cp/tree.c	2003/10/02 12:00:48	1.307.2.4
+++ gcc/gcc/cp/tree.c	2003/10/14 20:45:39	1.307.2.5
@@ -357,6 +357,12 @@
 
   if (TREE_CODE (init) == TARGET_EXPR)
     return init;
+  else if (CLASS_TYPE_P (type) && !TYPE_HAS_TRIVIAL_INIT_REF (type)
+	   && TREE_CODE (init) != COND_EXPR)
+    /* We need to build up a copy constructor call.  COND_EXPR is a special
+       case because we already have copies on the arms and we don't want
+       another one here.  */
+    return force_rvalue (init);
 
   slot = build (VAR_DECL, type);
   DECL_ARTIFICIAL (slot) = 1;
Comment 3 Jason Merrill 2003-10-27 19:05:29 UTC

*** This bug has been marked as a duplicate of 12726 ***