diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2011-01-04 08:58:02 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2011-01-04 08:58:02 +0000 |
commit | 89f5e978044c3086e99418ea6855bd1faacba2a0 (patch) | |
tree | b7b6750db205f4619c31198d6d97ed314e4d78bd /gcc/ada | |
parent | 2b18eb327ce8bbe24e948918c8bf04e48e3cadd8 (diff) | |
download | gcc-89f5e978044c3086e99418ea6855bd1faacba2a0.zip gcc-89f5e978044c3086e99418ea6855bd1faacba2a0.tar.gz gcc-89f5e978044c3086e99418ea6855bd1faacba2a0.tar.bz2 |
re PR ada/47131 (internal error for ACATS C34011B on SJLJ targets)
PR ada/47131
* gcc-interface/trans.c (Identifier_to_gnu): In SJLJ mode, do not make
variables that are referenced in exception handlers volatile.
From-SVN: r168454
Diffstat (limited to 'gcc/ada')
-rw-r--r-- | gcc/ada/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/ada/gcc-interface/trans.c | 23 |
2 files changed, 8 insertions, 22 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index a3aa49d..8920d8e 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,10 @@ +2011-01-04 Eric Botcazou <ebotcazou@adacore.com> + + PR ada/47131 + * gcc-interface/trans.c (Identifier_to_gnu): In SJLJ mode, do not make + variables that are referenced in exception handlers volatile. + + Copyright (C) 2011 Free Software Foundation, Inc. diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c index 689f072..673c4f8 100644 --- a/gcc/ada/gcc-interface/trans.c +++ b/gcc/ada/gcc-interface/trans.c @@ -6,7 +6,7 @@ * * * C Implementation File * * * - * Copyright (C) 1992-2010, Free Software Foundation, Inc. * + * Copyright (C) 1992-2011, 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- * @@ -980,27 +980,6 @@ Identifier_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p) else gnu_result = gnat_to_gnu_entity (gnat_temp, NULL_TREE, 0); - /* If we are in an exception handler, force this variable into memory to - ensure optimization does not remove stores that appear redundant but are - actually needed in case an exception occurs. - - ??? Note that we need not do this if the variable is declared within the - handler, only if it is referenced in the handler and declared in an - enclosing block, but we have no way of testing that right now. - - ??? We used to essentially set the TREE_ADDRESSABLE flag on the variable - here, but it can now be removed by the Tree aliasing machinery if the - address of the variable is never taken. All we can do is to make the - variable volatile, which might incur the generation of temporaries just - to access the memory in some circumstances. This can be avoided for - variables of non-constant size because they are automatically allocated - to memory. There might be no way of allocating a proper temporary for - them in any case. We only do this for SJLJ though. */ - if (VEC_last (tree, gnu_except_ptr_stack) - && TREE_CODE (gnu_result) == VAR_DECL - && TREE_CODE (DECL_SIZE_UNIT (gnu_result)) == INTEGER_CST) - TREE_THIS_VOLATILE (gnu_result) = TREE_SIDE_EFFECTS (gnu_result) = 1; - /* Some objects (such as parameters passed by reference, globals of variable size, and renamed objects) actually represent the address of the object. In that case, we must do the dereference. Likewise, |