aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/semantics.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2003-08-29 23:11:14 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2003-08-29 23:11:14 +0000
commitfc2b84778bb51750c841f53b1ba30950935cc901 (patch)
tree9804609df286984088c3db599152fdef7af2c07f /gcc/cp/semantics.c
parentd560a41c5c43524d82795ac4421eab2df6764e30 (diff)
downloadgcc-fc2b84778bb51750c841f53b1ba30950935cc901.zip
gcc-fc2b84778bb51750c841f53b1ba30950935cc901.tar.gz
gcc-fc2b84778bb51750c841f53b1ba30950935cc901.tar.bz2
re PR middle-end/6196 (ICE in copy_to_mode_reg, at explow.c:711)
PR c++/6196 * pt.c (tsubst_copy_and_build): Correct handling of address-of-label extension. * semantics.c (finish_goto_stmt): The address of a label must go through the lvalue-to-rvalue conversion. PR c++/6196 * g++.dg/ext/label1.C: New test. * g++.dg/ext/label2.C: Likewise. From-SVN: r70932
Diffstat (limited to 'gcc/cp/semantics.c')
-rw-r--r--gcc/cp/semantics.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index ee80bee..c38bdd3 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -378,13 +378,17 @@ finish_goto_stmt (tree destination)
mark the used labels as used. */
if (TREE_CODE (destination) == LABEL_DECL)
TREE_USED (destination) = 1;
-
- if (TREE_CODE (destination) != LABEL_DECL)
- /* We don't inline calls to functions with computed gotos.
- Those functions are typically up to some funny business,
- and may be depending on the labels being at particular
- addresses, or some such. */
- DECL_UNINLINABLE (current_function_decl) = 1;
+ else
+ {
+ /* The DESTINATION is being used as an rvalue. */
+ if (!processing_template_decl)
+ destination = decay_conversion (destination);
+ /* We don't inline calls to functions with computed gotos.
+ Those functions are typically up to some funny business,
+ and may be depending on the labels being at particular
+ addresses, or some such. */
+ DECL_UNINLINABLE (current_function_decl) = 1;
+ }
check_goto (destination);