aboutsummaryrefslogtreecommitdiff
path: root/gcc/c/gimple-parser.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2019-07-10 13:24:32 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2019-07-10 13:24:32 +0000
commit8389386c6d55d57afc3ae01f71546ac4468f7926 (patch)
tree3c0df90f570091edafcdd5fb8f152cfb54ee4388 /gcc/c/gimple-parser.c
parentf861d731ca497443702f78b78d5090063c17539d (diff)
downloadgcc-8389386c6d55d57afc3ae01f71546ac4468f7926.zip
gcc-8389386c6d55d57afc3ae01f71546ac4468f7926.tar.gz
gcc-8389386c6d55d57afc3ae01f71546ac4468f7926.tar.bz2
gimple-parser.c (c_parser_gimple_postfix_expression): Support _Literal (int *) &x for address literals.
2019-07-10 Richard Biener <rguenther@suse.de> c/ * gimple-parser.c (c_parser_gimple_postfix_expression): Support _Literal (int *) &x for address literals. * tree-ssa-sccvn.c (vn_reference_lookup_3): Look at valueized LHS whenever possible. * gcc.dg/torture/ssa-fre-5.c: New testcase. * gcc.dg/torture/ssa-fre-6.c: Likewise. * gcc.dg/torture/ssa-fre-7.c: Likewise. From-SVN: r273354
Diffstat (limited to 'gcc/c/gimple-parser.c')
-rw-r--r--gcc/c/gimple-parser.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/c/gimple-parser.c b/gcc/c/gimple-parser.c
index 9a65394..a0ea721 100644
--- a/gcc/c/gimple-parser.c
+++ b/gcc/c/gimple-parser.c
@@ -1606,8 +1606,10 @@ c_parser_gimple_postfix_expression (gimple_parser &parser)
tree val = c_parser_gimple_postfix_expression (parser).value;
if (! val
|| val == error_mark_node
- || ! CONSTANT_CLASS_P (val)
- || (addr_p && TREE_CODE (val) != STRING_CST))
+ || (!CONSTANT_CLASS_P (val)
+ && !(addr_p
+ && (TREE_CODE (val) == STRING_CST
+ || DECL_P (val)))))
{
c_parser_error (parser, "invalid _Literal");
return expr;