summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2008-05-24 09:49:55 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2008-05-24 09:49:55 +0000
commitb3dd8cfdf12682bc531009fd05556a5c54db216f (patch)
tree5e79a1709061ee94b029dcc12e00a648f68b6a1f
parenta5134cedf26e38e88ba09d9ef0dbca88e3318bab (diff)
downloadppe42-gcc-b3dd8cfdf12682bc531009fd05556a5c54db216f.tar.gz
ppe42-gcc-b3dd8cfdf12682bc531009fd05556a5c54db216f.zip
* trans.c (gnat_to_gnu): Do not set source location info on NOP_EXPRs.
(Sloc_to_locus): Do not overwrite known GCC locations when translating GNAT standard locations. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@135847 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ada/ChangeLog6
-rw-r--r--gcc/ada/trans.c8
2 files changed, 12 insertions, 2 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 35f9a08d868..f7305e8ef4f 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,9 @@
+2008-05-24 Eric Botcazou <ebotcazou@adacore.com>
+
+ * trans.c (gnat_to_gnu): Do not set source location info on NOP_EXPRs.
+ (Sloc_to_locus): Do not overwrite known GCC locations when translating
+ GNAT standard locations.
+
2008-05-23 Eric Botcazou <ebotcazou@adacore.com>
* gigi.h (mark_visited): Declare.
diff --git a/gcc/ada/trans.c b/gcc/ada/trans.c
index 4bc772ddfec..5f579e71b45 100644
--- a/gcc/ada/trans.c
+++ b/gcc/ada/trans.c
@@ -4880,7 +4880,10 @@ gnat_to_gnu (Node_Id gnat_node)
the location information of their last use. Note that we may have
no result if we tried to build a CALL_EXPR node to a procedure with
no side-effects and optimization is enabled. */
- if (gnu_result && EXPR_P (gnu_result) && !REFERENCE_CLASS_P (gnu_result))
+ if (gnu_result
+ && EXPR_P (gnu_result)
+ && TREE_CODE (gnu_result) != NOP_EXPR
+ && !REFERENCE_CLASS_P (gnu_result))
set_expr_location_from_node (gnu_result, gnat_node);
/* If we're supposed to return something of void_type, it means we have
@@ -6853,7 +6856,8 @@ Sloc_to_locus (Source_Ptr Sloc, location_t *locus)
if (Sloc <= Standard_Location)
{
- *locus = BUILTINS_LOCATION;
+ if (*locus == UNKNOWN_LOCATION)
+ *locus = BUILTINS_LOCATION;
return false;
}
else
OpenPOWER on IntegriCloud