]> gcc.gnu.org Git - gcc.git/commitdiff
varasm.c (const_hash): Handle FDESC_EXPR like ADDR_EXPR.
authorJakub Jelinek <jakub@redhat.com>
Mon, 10 Jun 2002 21:43:26 +0000 (23:43 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 10 Jun 2002 21:43:26 +0000 (23:43 +0200)
* varasm.c (const_hash): Handle FDESC_EXPR like ADDR_EXPR.
(compare_constant): Likewise.
(output_addressed_constants): Likewise.

* g++.dg/opt/vt1.C: New test.

From-SVN: r54459

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

index 0964d2700e5854d555cd91e2dc31b94cf8d84e02..ba8541b43991ffb3e9e7fe8516d72bc254f5b08c 100644 (file)
@@ -1,3 +1,9 @@
+2002-06-10  Jakub Jelinek  <jakub@redhat.com>
+
+       * varasm.c (const_hash): Handle FDESC_EXPR like ADDR_EXPR.
+       (compare_constant): Likewise.
+       (output_addressed_constants): Likewise.
+
 2002-06-10  Jakub Jelinek  <jakub@redhat.com>
 
        * cfgcleanup.c (try_optimize_cfg): Make sure merge_blocks doesn't
index afc08f4b8cea91f53d8c0464785675af997b072e..f90d62d0b3d396fde2fecf237c3a8c8ad5ff10fd 100644 (file)
@@ -2,6 +2,8 @@
 
        * gcc.c-torture/compile/20020605-1.c: New test.
 
+       * g++.dg/opt/vt1.C: New test.
+
 2002-06-07  Roger Sayle  <roger@eyesopen.com>
 
        * gcc.dg/20020607-2.c: New test case.
diff --git a/gcc/testsuite/g++.dg/opt/vt1.C b/gcc/testsuite/g++.dg/opt/vt1.C
new file mode 100644 (file)
index 0000000..536a252
--- /dev/null
@@ -0,0 +1,11 @@
+// Test whether vtable for S is not put into read-only section.
+// { dg-do compile }
+// { dg-options "-O2 -fpic -fno-rtti" }
+// Origin: Jakub Jelinek <jakub@redhat.com>
+
+struct S
+{
+  virtual void vm (void) {};
+} x;
+
+// { dg-final { scan-assembler-not "section.*_ZTV1S.*\"\[^w\"\]*\"" } }
index 908f166ca81cd44747dcbd50837a33fe02a627d6..1b358116bf84e83dd325b8668ed6ad03a764e925 100644 (file)
@@ -2320,6 +2320,7 @@ const_hash (exp)
        }
 
     case ADDR_EXPR:
+    case FDESC_EXPR:
       {
        struct addr_const value;
 
@@ -2485,6 +2486,7 @@ compare_constant (t1, t2)
        }
 
     case ADDR_EXPR:
+    case FDESC_EXPR:
       {
        struct addr_const value1, value2;
 
@@ -3653,6 +3655,7 @@ output_addressed_constants (exp)
   switch (TREE_CODE (exp))
     {
     case ADDR_EXPR:
+    case FDESC_EXPR:
       /* Go inside any operations that get_inner_reference can handle and see
         if what's inside is a constant: no need to do anything here for
         addresses of variables or functions.  */
This page took 0.110328 seconds and 5 git commands to generate.