+2016-11-02 Will Schmidt <will_schmidt@vnet.ibm.com>
+
+ Backport from trunk
+ 2016-10-26 Will Schmidt <will_schmidt@vnet.ibm.com>
+
+ PR middle-end/72747
+ * gimplify.c (gimplify_init_constructor): Move emit of constructor
+ assignment to earlier in the if/else logic.
+
2016-10-29 John David Anglin <danglin@gcc.gnu.org>
* config/pa/pa.h (BIGGEST_ALIGNMENT): Adjust comment.
if (ret == GS_ERROR)
return GS_ERROR;
- else if (want_value)
+ /* If we have gimplified both sides of the initializer but have
+ not emitted an assignment, do so now. */
+ if (*expr_p)
+ {
+ tree lhs = TREE_OPERAND (*expr_p, 0);
+ tree rhs = TREE_OPERAND (*expr_p, 1);
+ gassign *init = gimple_build_assign (lhs, rhs);
+ gimplify_seq_add_stmt (pre_p, init);
+ }
+ if (want_value)
{
*expr_p = object;
return GS_OK;
}
else
{
- /* If we have gimplified both sides of the initializer but have
- not emitted an assignment, do so now. */
- if (*expr_p)
- {
- tree lhs = TREE_OPERAND (*expr_p, 0);
- tree rhs = TREE_OPERAND (*expr_p, 1);
- gassign *init = gimple_build_assign (lhs, rhs);
- gimplify_seq_add_stmt (pre_p, init);
- *expr_p = NULL;
- }
-
+ *expr_p = NULL;
return GS_ALL_DONE;
}
}
+2016-11-02 Will Schmidt <will_schmidt@vnet.ibm.com>
+
+ Backport from trunk
+ 2016-10-26 Will Schmidt <will_schmidt@vnet.ibm.com>
+
+ PR middle-end/72747
+ * c-c++-common/pr72747-1.c: New test.
+ * c-c++-common/pr72747-2.c: Likewise.
+
2016-11-02 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* lib/target-supports.exp (check_gc_sections_available): Use
--- /dev/null
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_altivec_ok } */
+/* { dg-options "-maltivec -fdump-tree-gimple" } */
+
+/* PR 72747: Test that cascaded definition is happening for constant vectors. */
+
+#include <altivec.h>
+
+int main (int argc, char *argv[])
+{
+ __vector int v1,v2;
+ v1 = v2 = vec_splats ((int) 42);
+ return 0;
+}
+/* { dg-final { scan-tree-dump-times " v2 = { 42, 42, 42, 42 }" 1 "gimple" } } */
+
--- /dev/null
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_altivec_ok } */
+/* { dg-options "-c -maltivec -fdump-tree-gimple" } */
+
+/* PR 72747: test that cascaded definition is happening for non constants. */
+
+void foo ()
+{
+ extern int i;
+ __vector int v,w;
+ v = w = (vector int) { i };
+}
+
+int main (int argc, char *argv[])
+{
+ return 0;
+}
+/* { dg-final { scan-tree-dump-times " w = " 1 "gimple" } } */