aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2019-11-06 08:08:39 +0000
committerJakub Jelinek <jakub@redhat.com>2019-11-06 08:08:39 +0000
commite3981a43956bc5bc18314964b66acd4caf7ff028 (patch)
tree8599cb1c9c49a0d79201ce71e4f7fdb570486bae
parentdc460051959691e0ff3be166e3cb28de576e0aad (diff)
PR inline-asm/92352
* gimplify.c (gimplify_asm_expr): Reject VLA in output or input operands with non-memory constraints. * c-c++-common/pr92352.c: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@277873 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog31
-rw-r--r--gcc/c-family/ChangeLog10
-rw-r--r--gcc/gimplify.c15
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/c-c++-common/pr92352.c15
5 files changed, 59 insertions, 17 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e666a0ccf27..7fee0f37e9b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2019-11-06 Jakub Jelinek <jakub@redhat.com>
+
+ PR inline-asm/92352
+ * gimplify.c (gimplify_asm_expr): Reject VLA in output or input
+ operands with non-memory constraints.
+
2019-11-05 Martin Sebor <msebor@redhat.com>
PR tree-optimization/92373
@@ -530,10 +536,7 @@
PR middle-end/91647
PR middle-end/91463
PR middle-end/92312
- * c-family/c-pretty-print.c (direct_abstract_declarator): Print
- bound in zero-length arrays.
- * gcc/c-family/c.opt (-Wzero-length-bounds): New option.
- * gcc/doc/invoke.texi (-Wzero-length-bounds): Document.
+ * doc/invoke.texi (-Wzero-length-bounds): Document.
* gimple-match-head.c (try_conditional_simplification): Use memcpy
instead of a hand-rolled loop to avoid PR 92323.
* tree-vrp.c (vrp_prop::check_array_ref): Handle trailing arrays
@@ -962,7 +965,7 @@
* tree-ssa-loop-niter.h (simplify_replace_tree): Change declaration.
* tree-ssa-loop-niter.c (simplify_replace_tree): Add context parameter
and make the valueize function pointer also take a void pointer.
- * gcc/tree-ssa-sccvn.c (vn_valueize_wrapper): New function to wrap
+ * tree-ssa-sccvn.c (vn_valueize_wrapper): New function to wrap
around vn_valueize, to call it without a context.
(process_bb): Use vn_valueize_wrapper instead of vn_valueize.
* tree-vect-loop.c (_loop_vec_info): Initialize epilogue_vinfos.
@@ -3607,7 +3610,7 @@
2019-10-12 John David Anglin <danglin@gcc.gnu.org>
- * gcc/config/pa/pa.c (pa_option_override): Remove trailing comma
+ * config/pa/pa.c (pa_option_override): Remove trailing comma
from warning.
2019-10-12 Jakub Jelinek <jakub@redhat.com>
@@ -4009,7 +4012,7 @@
2019-10-08 Dmitrij Pochepko <dmitrij.pochepko@bell-sw.com>
PR tree-optimization/90836
- * gcc/match.pd (popcount): New pattern.
+ * match.pd (popcount): New pattern.
2019-10-08 Martin Sebor <msebor@redhat.com>
@@ -6878,7 +6881,7 @@
2019-09-21 Martin Sebor <msebor@redhat.com>
PR middle-end/91830
- * gcc/gimple-ssa-warn-restrict.c (builtin_memref::set_base_and_offset):
+ * gimple-ssa-warn-restrict.c (builtin_memref::set_base_and_offset):
Simplify computation of the offset of the referenced subobject.
2019-09-21 Iain Sandoe <iain@sandoe.co.uk>
@@ -9388,15 +9391,15 @@
2019-08-23 Wilco Dijkstra <wdijkstr@arm.com>
- * gcc/doc/invoke.texi (mneon-for-64bits): Deprecate option.
- * gcc/config/arm/arm.opt (mneon-for-64bits): Deprecate option.
- * gcc/config/arm/arm.h (TARGET_PREFER_NEON_64BITS): Remove.
+ * doc/invoke.texi (mneon-for-64bits): Deprecate option.
+ * config/arm/arm.opt (mneon-for-64bits): Deprecate option.
+ * config/arm/arm.h (TARGET_PREFER_NEON_64BITS): Remove.
(prefer_neon_for_64bits): Remove.
- * gcc/config/arm/arm.c (prefer_neon_for_64bits): Remove.
+ * config/arm/arm.c (prefer_neon_for_64bits): Remove.
(tune_params): Remove PREF_NEON_64_FALSE uses.
(arm_option_override): Remove prefer_neon selection code.
(arm_print_tune_info): Remove prefer_neon_for_64bits.
- * gcc/config/arm/arm-protos.h (tune_params): Remove
+ * config/arm/arm-protos.h (tune_params): Remove
prefer_neon_for_64bits.
(prefer_neon_for_64bits): Remove.
@@ -11607,7 +11610,7 @@
2019-08-13 Wilco Dijkstra <wdijkstr@arm.com>
PR target/81800
- * gcc/config/aarch64/aarch64.md (lrint): Disable lrint pattern if GPF
+ * config/aarch64/aarch64.md (lrint): Disable lrint pattern if GPF
operand is larger than a long int.
2019-08-13 Richard Sandiford <richard.sandiford@arm.com>
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index 7f402960fc3..1859fddb4bf 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -21,6 +21,16 @@
* c-common.h (enum rid): Add RID_CONSTEVAL.
* c-common.c (c_common_reswords): Add consteval.
+2019-11-01 Martin Sebor <msebor@redhat.com>
+
+ PR middle-end/91679
+ PR middle-end/91647
+ PR middle-end/91463
+ PR middle-end/92312
+ * c-pretty-print.c (direct_abstract_declarator): Print
+ bound in zero-length arrays.
+ * c.opt (-Wzero-length-bounds): New option.
+
2019-10-30 Nathan Sidwell <nathan@acm.org>
* c-cppbuiltin.c (c_cpp_builtins): Add 'L' suffix to feature
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index d06b3ce5709..8feb2464b97 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -6235,8 +6235,13 @@ gimplify_asm_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p)
is_inout = false;
}
- /* If we can't make copies, we can only accept memory. */
- if (TREE_ADDRESSABLE (TREE_TYPE (TREE_VALUE (link))))
+ /* If we can't make copies, we can only accept memory.
+ Similarly for VLAs. */
+ tree outtype = TREE_TYPE (TREE_VALUE (link));
+ if (outtype != error_mark_node
+ && (TREE_ADDRESSABLE (outtype)
+ || !COMPLETE_TYPE_P (outtype)
+ || !tree_fits_poly_uint64_p (TYPE_SIZE_UNIT (outtype))))
{
if (allows_mem)
allows_reg = 0;
@@ -6392,7 +6397,11 @@ gimplify_asm_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p)
oconstraints, &allows_mem, &allows_reg);
/* If we can't make copies, we can only accept memory. */
- if (TREE_ADDRESSABLE (TREE_TYPE (TREE_VALUE (link))))
+ tree intype = TREE_TYPE (TREE_VALUE (link));
+ if (intype != error_mark_node
+ && (TREE_ADDRESSABLE (intype)
+ || !COMPLETE_TYPE_P (intype)
+ || !tree_fits_poly_uint64_p (TYPE_SIZE_UNIT (intype))))
{
if (allows_mem)
allows_reg = 0;
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 6e4820fb86e..a0f52ec2c5c 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2019-11-06 Jakub Jelinek <jakub@redhat.com>
+
+ PR inline-asm/92352
+ * c-c++-common/pr92352.c: New test.
+
2019-11-06 Xiong Hu Luo <luoxhu@linux.ibm.com>
PR92090
diff --git a/gcc/testsuite/c-c++-common/pr92352.c b/gcc/testsuite/c-c++-common/pr92352.c
new file mode 100644
index 00000000000..d714e9fa32a
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/pr92352.c
@@ -0,0 +1,15 @@
+/* PR inline-asm/92352 */
+
+void
+foo (int x)
+{
+ int var[x];
+ asm volatile ("" : "+r" (var)); /* { dg-error "impossible constraint in 'asm'" } */
+} /* { dg-error "non-memory output 0 must stay in memory" "" { target *-*-* } .-1 } */
+
+void
+bar (int x)
+{
+ int var[x];
+ asm volatile ("" : "+m" (var));
+}