PR c++/28148
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 4 Aug 2006 04:58:36 +0000 (04:58 +0000)
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 4 Aug 2006 04:58:36 +0000 (04:58 +0000)
* varasm.c (output_constant): Give the front end another chance to
expand constants, after stripping NOPs.

PR c++/28148
* g++.dg/init/ptrmem3.C: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@115919 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/init/ptrmem3.C [new file with mode: 0644]
gcc/varasm.c

index 39e5cfa..216b686 100644 (file)
@@ -1,3 +1,9 @@
+2006-08-03  Mark Mitchell  <mark@codesourcery.com>
+
+       PR c++/28148
+       * varasm.c (output_constant): Give the front end another chance to
+       expand constants, after stripping NOPs.
+
 2006-08-03  Jan Hubicka  <jh@suse.cz>
 
        * domwalk.c (walk_dominator_tree): Reorganize to non-recursive
index a2256d5..a07f7c1 100644 (file)
@@ -1,3 +1,8 @@
+2006-08-03  Mark Mitchell  <mark@codesourcery.com>
+
+       PR c++/28148
+       * g++.dg/init/ptrmem3.C: New test.
+
 2006-08-03  Dorit Nuzman  <dorit@il.ibm.com>
 
        PR tree-optimization/27770
diff --git a/gcc/testsuite/g++.dg/init/ptrmem3.C b/gcc/testsuite/g++.dg/init/ptrmem3.C
new file mode 100644 (file)
index 0000000..95b6037
--- /dev/null
@@ -0,0 +1,8 @@
+// PR c++/28148
+
+struct foo {
+public:
+  virtual int bar(int);
+};
+
+void (foo::*__Virtual__foo__Var1)() = (void (foo::*)())(&foo::bar);
index 1f5f43a..9837e0d 100644 (file)
@@ -4048,6 +4048,9 @@ output_constant (tree exp, unsigned HOST_WIDE_INT size, unsigned int align)
   code = TREE_CODE (TREE_TYPE (exp));
   thissize = int_size_in_bytes (TREE_TYPE (exp));
 
+  /* Give the front end another chance to expand constants.  */
+  exp = lang_hooks.expand_constant (exp);
+
   /* Allow a constructor with no elements for any data type.
      This means to fill the space with zeros.  */
   if (TREE_CODE (exp) == CONSTRUCTOR