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

* gcc-interface/lang-specs.h: Bump copyright year.

From-SVN: r265378

gcc/ada/ChangeLog
gcc/ada/gcc-interface/lang-specs.h
gcc/ada/gcc-interface/trans.c

index 0d134237912b3690d602099bc7d2f722720ad7dd..c002cdb1a1ef01af6f11142910733e37069f0833 100644 (file)
@@ -1,3 +1,10 @@
+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.
+
+       * gcc-interface/lang-specs.h: Bump copyright year.
+
 2018-10-17  David Malcolm  <dmalcolm@redhat.com>
 
        * gcc-interface/Make-lang.in (selftest-ada): New.
index c7bf32c03905d5937fe98bfad1734aecfc14a70e..374fc1e9527c182a0bc627d26ed9978e2139ffe6 100644 (file)
@@ -6,7 +6,7 @@
  *                                                                          *
  *                              C Header File                               *
  *                                                                          *
- *           Copyright (C) 1992-2015, Free Software Foundation, Inc.        *
+ *           Copyright (C) 1992-2018, Free Software Foundation, Inc.        *
  *                                                                          *
  * GNAT is free software;  you can  redistribute it  and/or modify it under *
  * terms of the  GNU General Public License as published  by the Free Soft- *
index 6757c2fedc0b5d1e3ebb8537bbd59b645dbb2a44..ce2d43f989e71734f7e16b66a5dafe87f2a9bdcb 100644 (file)
@@ -1285,32 +1285,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;
-         scalar_int_mode int_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 = (!is_a <scalar_int_mode> (mode, &int_mode)
-                        || GET_MODE_SIZE (int_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);
@@ -1320,8 +1306,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);