]> git.pld-linux.org Git - packages/gcc.git/commitdiff
- reject writting to const via asm.
authorPaweł Sikora <pluto@pld-linux.org>
Sun, 25 Sep 2005 12:50:42 +0000 (12:50 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    gcc-pr21419.patch -> 1.1

gcc-pr21419.patch [new file with mode: 0644]

diff --git a/gcc-pr21419.patch b/gcc-pr21419.patch
new file mode 100644 (file)
index 0000000..7fc847a
--- /dev/null
@@ -0,0 +1,20 @@
+This fixes PR21419 by checking that read-only expressions are not given 
+as outputs for an asm statement.  The gimplifier was already performed 
+consistency tests on asm statements, so this looked like a good place to 
+make this check.
+
+--- gcc/gcc/gimplify.c 14 Sep 2005 06:59:10 -0000
++++ gcc/gcc/gimplify.c 25 Sep 2005 12:32:41 -0000
+@@ -3543,6 +3543,12 @@ gimplify_asm_expr (tree *expr_p, tree *p
+       parse_output_constraint (&constraint, i, 0, 0,
+                              &allows_mem, &allows_reg, &is_inout);
++      if (TYPE_READONLY (TREE_TYPE (TREE_VALUE (link))))
++      {
++        error ("invalid lvalue in asm output %d", i);
++        ret = GS_ERROR;
++      }
++
+       if (!allows_reg && allows_mem)
+       lang_hooks.mark_addressable (TREE_VALUE (link));
This page took 0.189924 seconds and 4 git commands to generate.