aboutsummaryrefslogtreecommitdiff
path: root/gcc/c/c-parser.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2012-12-20 11:41:47 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2012-12-20 11:41:47 +0100
commiteadd3d0d54b72308446ce8e615b180fe33eed36a (patch)
tree915b2cceb4b2f29233795c10d764160a76b6b505 /gcc/c/c-parser.c
parent1ac13b9c058d6ff982b1fa6cf2fa1515a9692b5e (diff)
downloadgcc-eadd3d0d54b72308446ce8e615b180fe33eed36a.zip
gcc-eadd3d0d54b72308446ce8e615b180fe33eed36a.tar.gz
gcc-eadd3d0d54b72308446ce8e615b180fe33eed36a.tar.bz2
re PR c++/55619 (Chromium build fails with: error: memory input is not directly addressable)
PR c++/55619 * c-parser.c (c_parser_asm_operands): Remove CONVERT_P argument, don't call default_function_array_conversion nor c_fully_fold here. (c_parser_asm_statement): Adjust callers. * c-typeck.c (build_asm_expr): Call c_fully_fold on inputs and outputs here, and call default_function_array_conversion on inputs that don't need to be addressable. * c-c++-common/pr55619.c: New test. From-SVN: r194631
Diffstat (limited to 'gcc/c/c-parser.c')
-rw-r--r--gcc/c/c-parser.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c
index d85bff0..ef5973f 100644
--- a/gcc/c/c-parser.c
+++ b/gcc/c/c-parser.c
@@ -1154,7 +1154,7 @@ static void c_parser_while_statement (c_parser *);
static void c_parser_do_statement (c_parser *);
static void c_parser_for_statement (c_parser *);
static tree c_parser_asm_statement (c_parser *);
-static tree c_parser_asm_operands (c_parser *, bool);
+static tree c_parser_asm_operands (c_parser *);
static tree c_parser_asm_goto_operands (c_parser *);
static tree c_parser_asm_clobbers (c_parser *);
static struct c_expr c_parser_expr_no_commas (c_parser *, struct c_expr *);
@@ -5150,10 +5150,10 @@ c_parser_asm_statement (c_parser *parser)
/* For asm goto, we don't allow output operands, but reserve
the slot for a future extension that does allow them. */
if (!is_goto)
- outputs = c_parser_asm_operands (parser, false);
+ outputs = c_parser_asm_operands (parser);
break;
case 1:
- inputs = c_parser_asm_operands (parser, true);
+ inputs = c_parser_asm_operands (parser);
break;
case 2:
clobbers = c_parser_asm_clobbers (parser);
@@ -5191,9 +5191,7 @@ c_parser_asm_statement (c_parser *parser)
goto error;
}
-/* Parse asm operands, a GNU extension. If CONVERT_P (for inputs but
- not outputs), apply the default conversion of functions and arrays
- to pointers.
+/* Parse asm operands, a GNU extension.
asm-operands:
asm-operand
@@ -5205,10 +5203,9 @@ c_parser_asm_statement (c_parser *parser)
*/
static tree
-c_parser_asm_operands (c_parser *parser, bool convert_p)
+c_parser_asm_operands (c_parser *parser)
{
tree list = NULL_TREE;
- location_t loc;
while (true)
{
tree name, str;
@@ -5243,12 +5240,8 @@ c_parser_asm_operands (c_parser *parser, bool convert_p)
parser->lex_untranslated_string = true;
return NULL_TREE;
}
- loc = c_parser_peek_token (parser)->location;
expr = c_parser_expression (parser);
mark_exp_read (expr.value);
- if (convert_p)
- expr = default_function_array_conversion (loc, expr);
- expr.value = c_fully_fold (expr.value, false, NULL);
parser->lex_untranslated_string = true;
if (!c_parser_require (parser, CPP_CLOSE_PAREN, "expected %<)%>"))
{