re PR c++/51992 (internal compiler error: tree code ‘target_expr’ is not supported...
authorJason Merrill <jason@redhat.com>
Wed, 25 Jan 2012 17:16:28 +0000 (12:16 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Wed, 25 Jan 2012 17:16:28 +0000 (12:16 -0500)
PR c++/51992
* tree.c (find_decls_types_in_node): Walk gimple_call_fntype.

From-SVN: r183527

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/lto/pr51992_0.C [new file with mode: 0644]
gcc/tree.c

index b3be4c013690c40351a87ab945580aed098a2264..82e5165d04a096a70a6a8c8005a7ab9854d00e9e 100644 (file)
@@ -1,3 +1,8 @@
+2012-01-25  Jason Merrill  <jason@redhat.com>
+
+       PR c++/51992
+       * tree.c (find_decls_types_in_node): Walk gimple_call_fntype.
+
 2012-01-25  Jakub Jelinek  <jakub@redhat.com>
 
        PR tree-optimization/51987
index ea0cc24800f9f843c9036389cabe08fca30cf714..493b040c4d8df57ec965c0328d2626ac581d0de5 100644 (file)
@@ -1,3 +1,8 @@
+2012-01-25  Jason Merrill  <jason@redhat.com>
+
+       PR c++/51992
+       * g++.dg/lto/pr51992_0.C: New.
+
 2012-01-25  Jakub Jelinek  <jakub@redhat.com>
 
        PR tree-optimization/51987
diff --git a/gcc/testsuite/g++.dg/lto/pr51992_0.C b/gcc/testsuite/g++.dg/lto/pr51992_0.C
new file mode 100644 (file)
index 0000000..deb232c
--- /dev/null
@@ -0,0 +1,53 @@
+// PR c++/51992
+// { dg-lto-do assemble }
+
+template<typename Enum>
+class QFlags
+{
+    int i;
+    inline QFlags(Enum f) : i(f) {}
+};
+class QString {};
+class KComponentData;
+class KConfig
+{
+public:
+    enum OpenFlag {
+        IncludeGlobals = 0x01,
+       CascadeConfig = 0x02,
+       FullConfig = IncludeGlobals|CascadeConfig
+    };
+    typedef QFlags<OpenFlag> OpenFlags;
+};
+template <class T>
+class KSharedPtr {};
+class KSharedConfig : public KConfig
+{
+public:
+  typedef KSharedPtr<KSharedConfig> Ptr;
+    static KSharedConfig::Ptr openConfig(const QString& fileName = QString(),
+                                        OpenFlags mode = FullConfig,
+                                        const char *resourceType = "config");
+    static KSharedConfig::Ptr openConfig(const KComponentData &componentData,
+                                        const QString &fileName = QString(),
+                                         OpenFlags mode = FullConfig,
+                                        const char *resourceType = "config");
+};
+typedef KSharedConfig::Ptr KSharedConfigPtr;
+namespace KGlobal
+{
+    KComponentData &mainComponent();
+};
+KSharedConfigPtr KSharedConfig::openConfig(const QString& fileName,
+                                           OpenFlags flags,
+                                           const char *resType)
+{
+    return openConfig(KGlobal::mainComponent(), fileName, flags, resType);
+}
+KSharedConfigPtr KSharedConfig::openConfig(const KComponentData &componentData,
+                                           const QString& fileName,
+                                           OpenFlags flags,
+                                           const char *resType)
+{
+    return KSharedConfigPtr();
+}
index ec78616bd63b63b002eb2aa2300aeaaeae9db13a..34bcb39b8e90e17d47e32550efc451e9effc37b9 100644 (file)
@@ -5037,6 +5037,9 @@ find_decls_types_in_node (struct cgraph_node *n, struct free_lang_data_d *fld)
        {
          gimple stmt = gsi_stmt (si);
 
+         if (is_gimple_call (stmt))
+           find_decls_types (gimple_call_fntype (stmt), fld);
+
          for (i = 0; i < gimple_num_ops (stmt); i++)
            {
              tree arg = gimple_op (stmt, i);