+2014-12-08 Bernd Edlinger <bernd.edlinger@hotmail.de>
+
+ PR ipa/64049
+ * ipa-polymorphic-call.c
+ (pa_polymorphic_call_context::ipa_polymorphic_call): Allow RESULT_DECL.
+
2014-12-08 Alex Velenko <Alex.Velenko@arm.com>
* config/aarch64/aarch64.md (and_one_cmpl<mode>3_compare0_no_reuse):
if (TREE_CODE (base_pointer) == SSA_NAME
&& SSA_NAME_IS_DEFAULT_DEF (base_pointer)
- && TREE_CODE (SSA_NAME_VAR (base_pointer)) != PARM_DECL)
+ && !(TREE_CODE (SSA_NAME_VAR (base_pointer)) == PARM_DECL
+ || TREE_CODE (SSA_NAME_VAR (base_pointer)) == RESULT_DECL))
{
invalid = true;
if (instance)
+2014-12-08 Bernd Edlinger <bernd.edlinger@hotmail.de>
+
+ PR ipa/64049
+ * g++.dg/ipa/pr64049.h: New.
+ * g++.dg/ipa/pr64049-1.C: New.
+ * g++.dg/ipa/pr64049-2.C: New.
+
2014-12-08 Alex Velenko <Alex.Velenko@arm.com>
* gcc.target/aarch64/bics_3.c : New testcase.
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-ipa-inline" } */
+
+#include "pr64049.h"
+
+EnumStatusCode
+ValueHelper::getLocalizedText (const ValueStruct* pValueStruct, LocalizedText& target)
+{
+ if (pValueStruct && pValueStruct->dataType == 0 && pValueStruct->arrayType == 0)
+ {
+ _ASSERTION (pValueStruct->value.LocalizedText, "Unexpected null pointer");
+ return LocalizedTextSet (target.getInternHandle (), pValueStruct->value.LocalizedText);
+ }
+ else
+ {
+ return StatusCode::ERROR;
+ }
+}
+
+LocalizedText
+ValueHelper::getLocalizedText (const ValueStruct* pValueStruct)
+{
+ LocalizedText returnValue;
+ EnumStatusCode status = getLocalizedText (pValueStruct, returnValue);
+ _ASSERTION (StatusCode::isSUCCEEDED (status), "Conversion failed");
+ return returnValue;
+}
+
+EnumStatusCode
+LocalizedTextSet (LocalizedTextStruct* pTarget, LocalizedTextStruct* pSource)
+{
+ __builtin_strcpy (pTarget->getT (), pSource->getT ());
+ return StatusCode::SUCCESS;
+}
+
+/* { dg-final { scan-ipa-dump-not "__builtin_unreachable" "inline" } } */
+/* { dg-final { cleanup-ipa-dump "inline" } } */
--- /dev/null
+/* { dg-do run } */
+/* { dg-options "-O3 ${srcdir}/g++.dg/ipa/pr64049-1.C" } */
+
+#include "pr64049.h"
+
+int
+main ()
+{
+ ValueStruct v;
+ v.arrayType = 0;
+ v.dataType = 0;
+ v.value.LocalizedText = new LocalizedTextStruct ("Localized Text");
+ LocalizedText t = ValueHelper::getLocalizedText (&v);
+ if (__builtin_strcmp (t.getInternHandle ()->getT (), "Localized Text"))
+ __builtin_abort ();
+ return 0;
+}
+
+LocalizedTextStruct*
+LocalizedText::getInternHandle ()
+{
+ return &t;
+}
--- /dev/null
+#define _ASSERTION(expr, message) { if (!(expr)) __builtin_abort (); } (void)0
+
+typedef unsigned int EnumStatusCode;
+
+class StatusCode
+{
+public:
+ static const EnumStatusCode ERROR = 0x8000;
+ static const EnumStatusCode SUCCESS = 0x0000;
+ static bool isSUCCEEDED (EnumStatusCode res) { return (res == SUCCESS); }
+};
+
+class LocalizedTextStruct
+{
+public:
+ LocalizedTextStruct () {}
+ LocalizedTextStruct (const char *val)
+ {
+ __builtin_strcpy (t, val);
+ }
+ char *getT () { return t; }
+private:
+ char t[99];
+};
+
+typedef union tagValueUnion
+{
+ LocalizedTextStruct* LocalizedText;
+} ValueStructUnion;
+
+typedef struct ValueStruct
+{
+ unsigned char arrayType;
+ unsigned short dataType;
+ ValueStructUnion value;
+} ValueStruct;
+
+class LocalizedText
+{
+public:
+ virtual LocalizedTextStruct* getInternHandle ();
+private:
+ LocalizedTextStruct t;
+};
+
+class ValueHelper
+{
+public:
+ static EnumStatusCode getLocalizedText (const ValueStruct* pValueStruct, LocalizedText& target);
+ static LocalizedText getLocalizedText (const ValueStruct* pValueStruct);
+};
+
+EnumStatusCode LocalizedTextSet (LocalizedTextStruct* pTarget, LocalizedTextStruct* pSource);