]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
trans.c (Pragma_to_gnu): Use a simple memory constraint in all cases.
authorEric Botcazou <ebotcazou@adacore.com>
Mon, 22 Oct 2018 10:45:25 +0000 (10:45 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Mon, 22 Oct 2018 10:45:25 +0000 (10:45 +0000)
* gcc-interface/trans.c (Pragma_to_gnu) <Pragma_Inspection_Point>: Use
a simple memory constraint in all cases.

From-SVN: r265380

gcc/ada/ChangeLog
gcc/ada/gcc-interface/trans.c

index 7cefa12f305f460a7c28042aa37d4d94f52a637d..54928957b960a58868848f519aea79c646412e3d 100644 (file)
@@ -1,3 +1,8 @@
+2018-10-22  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * gcc-interface/trans.c (Pragma_to_gnu) <Pragma_Inspection_Point>: Use
+       a simple memory constraint in all cases.
+
 2018-09-13  Eric Botcazou  <ebotcazou@adacore.com>
 
        Backport from mainline
index 47c8a286220e44c40b2a30131eebd9a98d8470fc..b8d593b6ea5891034d40db8480cf66c0dcd1969c 100644 (file)
@@ -1266,32 +1266,18 @@ Pragma_to_gnu (Node_Id gnat_node)
        {
          Node_Id gnat_expr = Expression (gnat_temp);
          tree gnu_expr = gnat_to_gnu (gnat_expr);
-         int use_address;
-         machine_mode mode;
          tree asm_constraint = NULL_TREE;
 #ifdef ASM_COMMENT_START
          char *comment;
 #endif
-
-         if (TREE_CODE (gnu_expr) == UNCONSTRAINED_ARRAY_REF)
-           gnu_expr = TREE_OPERAND (gnu_expr, 0);
-
-         /* Use the value only if it fits into a normal register,
-            otherwise use the address.  */
-         mode = TYPE_MODE (TREE_TYPE (gnu_expr));
-         use_address = ((GET_MODE_CLASS (mode) != MODE_INT
-                         && GET_MODE_CLASS (mode) != MODE_PARTIAL_INT)
-                        || GET_MODE_SIZE (mode) > UNITS_PER_WORD);
-
-         if (use_address)
-           gnu_expr = build_unary_op (ADDR_EXPR, NULL_TREE, gnu_expr);
+         gnu_expr = maybe_unconstrained_array (gnu_expr);
+         gnat_mark_addressable (gnu_expr);
 
 #ifdef ASM_COMMENT_START
          comment = concat (ASM_COMMENT_START,
                            " inspection point: ",
                            Get_Name_String (Chars (gnat_expr)),
-                           use_address ? " address" : "",
-                           " is in %0",
+                           " is at %0",
                            NULL);
          asm_constraint = build_string (strlen (comment), comment);
          free (comment);
@@ -1301,8 +1287,8 @@ Pragma_to_gnu (Node_Id gnat_node)
                             NULL_TREE,
                             tree_cons
                             (build_tree_list (NULL_TREE,
-                                              build_string (1, "g")),
-                             gnu_expr, NULL_TREE),
+                                              build_string (1, "m")),
+                                              gnu_expr, NULL_TREE),
                             NULL_TREE, NULL_TREE);
          ASM_VOLATILE_P (gnu_expr) = 1;
          set_expr_location_from_node (gnu_expr, gnat_node);