diff options
author | Richard Biener <rguenther@suse.de> | 2022-02-23 11:05:50 +0100 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2022-02-23 12:15:30 +0100 |
commit | f4ed267fa5b82d6dafbc8afc82baf45bfcae549c (patch) | |
tree | 54be74e6d0c9f7ad42ba5bde1aaf5605e3ec37f9 /gcc/expr.cc | |
parent | 6e80c4f1ad9046b0a7c105660cc7b3dcae0fdb8f (diff) | |
download | gcc-f4ed267fa5b82d6dafbc8afc82baf45bfcae549c.zip gcc-f4ed267fa5b82d6dafbc8afc82baf45bfcae549c.tar.gz gcc-f4ed267fa5b82d6dafbc8afc82baf45bfcae549c.tar.bz2 |
Support SSA name declarations with pointer type
Currently we fail to parse
int * _3;
as SSA name and instead get a VAR_DECL because of the way the C
frontends declarator specs work. That causes havoc if those
supposed SSA names are used in PHIs or in other places where
VAR_DECLs are not allowed. The following fixes the pointer case
in an ad-hoc way - for more complex type declarators we probably
have to find a way to re-use the C frontend grokdeclarator without
actually creating a VAR_DECL there (or maybe make it create an
SSA name).
Pointers appear too often to be neglected though, thus the following
ad-hoc fix for this. This also adds verification that we do not
end up with SSA names without definitions as can happen when
reducing a GIMPLE testcase. Instead of working through segfaults
one-by-one we emit errors for all of those at once now.
2022-02-23 Richard Biener <rguenther@suse.de>
gcc/c
* gimple-parser.cc (c_parser_parse_gimple_body): Diagnose
SSA names without definition.
(c_parser_gimple_declaration): Handle pointer typed SSA names.
gcc/testsuite/
* gcc.dg/gimplefe-49.c: New testcase.
* gcc.dg/gimplefe-error-13.c: Likewise.
Diffstat (limited to 'gcc/expr.cc')
0 files changed, 0 insertions, 0 deletions