+2008-02-22 Andrew Pinski <andrew_pinski@playstation.sony.com>
+
+ PR C++/34715
+ * decl.c (duplicate_decls): Merge DECL_DISREGARD_INLINE_LIMITS for
+ template decls' function decl.
+
2008-02-22 Paolo Carlini <pcarlini@suse.de>
PR c++/35282
= DECL_INTERFACE_KNOWN (new_result);
DECL_DECLARED_INLINE_P (old_result)
= DECL_DECLARED_INLINE_P (new_result);
+ DECL_DISREGARD_INLINE_LIMITS (old_result)
+ |= DECL_DISREGARD_INLINE_LIMITS (new_result);
+
}
else
{
|= DECL_INLINE (new_result);
DECL_DECLARED_INLINE_P (old_result)
|= DECL_DECLARED_INLINE_P (new_result);
+ DECL_DISREGARD_INLINE_LIMITS (old_result)
+ |= DECL_DISREGARD_INLINE_LIMITS (new_result);
check_redeclaration_exception_specification (newdecl, olddecl);
}
}
+2008-02-22 Andrew Pinski <andrew_pinski@playstation.sony.com>
+
+ PR C++/34715
+ * g++.dg/ext/always_inline-1.C: New test.
+ * g++.dg/ext/always_inline-2.C: New test.
+ * g++.dg/ext/always_inline-3.C: New test.
+ * g++.dg/ext/always_inline-4.C: New test.
+
2008-02-22 Hans-Peter Nilsson <hp@axis.com>
* gcc.target/cris/asm-b-1.c: New test.
--- /dev/null
+// { dg-options "-O0" }
+// { dg-do compile }
+// PR C++/34715
+
+
+namespace X
+{
+ template <class T>
+ const T& min(const T& a, const T& b);
+
+ template <class T>
+ inline __attribute__ ((always_inline)) const T& min(const T& a, const T& b)
+ {
+ return a < b ? a : b;
+ }
+}
+template <class T>
+inline __attribute__ ((always_inline)) T y(const T& a, const T& b)
+{
+ return X::min(a, b);
+}
+int main()
+{
+ int a = 0, b = 0;
+ return y(a, b);
+}
--- /dev/null
+// { dg-options "-O0" }
+// { dg-do compile }
+// PR C++/34715
+
+
+namespace X
+{
+ template <class T>
+ const T& min123(const T& a, const T& b);
+}
+
+
+template <class T>
+inline __attribute__ ((always_inline)) const T& X::min123(const T& a, const T& b)
+{
+ return a < b ? a : b;
+}
+int main()
+{
+ int a, b;
+ return X::min123(a, b);
+}
+
+
+
+// { dg-final { scan-assembler-not "min123" } }
--- /dev/null
+// { dg-options "-O0" }
+// { dg-do compile }
+// PR C++/34715
+
+
+namespace X
+{
+ template <class T>
+ inline __attribute__ ((always_inline)) const T& min123(const T& a, const T& b);
+}
+
+
+template <class T>
+inline __attribute__ ((always_inline)) const T& X::min123(const T& a, const T& b)
+{
+ return a < b ? a : b;
+}
+int main()
+{
+ int a, b;
+ return X::min123(a, b);
+}
+
+
+
+// { dg-final { scan-assembler-not "min123" } }
--- /dev/null
+// { dg-options "-O0" }
+// { dg-do compile }
+// PR C++/34715
+
+ template <class T>
+ const T& min123(const T& a, const T& b);
+template <class T>
+inline __attribute__ ((always_inline)) const T&
+min123(const T& a, const T& b)
+{
+ return a < b ? a : b;
+}
+int main()
+{
+ int a, b;
+ return min123(a, b);
+}
+
+
+// { dg-final { scan-assembler-not "min123" } }