aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-cfg.cc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2023-04-28 09:25:16 +0200
committerRichard Biener <rguenther@suse.de>2023-04-28 11:07:54 +0200
commit977a43f5ba778b5c5cf9c56ba04ed4fde5d1ae78 (patch)
tree7d72072212b6d99d37f602ba829329170a5062c6 /gcc/tree-cfg.cc
parent821ef93976e750c118d42a2ad33b96dbd1b9f3a5 (diff)
downloadgcc-977a43f5ba778b5c5cf9c56ba04ed4fde5d1ae78.zip
gcc-977a43f5ba778b5c5cf9c56ba04ed4fde5d1ae78.tar.gz
gcc-977a43f5ba778b5c5cf9c56ba04ed4fde5d1ae78.tar.bz2
Avoid more invalid GIMPLE with register bases
The Ada frontend, for example with gnat.dg/inline2_pkg.adb, tends to create VIEW_CONVERT expressions with aggregate type even of non-aggregate entities. In this case for example return <retval> = (BIT_FIELD_REF <VIEW_CONVERT_EXPR<struct inline2_pkg__ieee_short_real>(number), 16, 16> & 32640) != 32640; currently gimplification and SSA rewrite turn this into _1 = BIT_FIELD_REF <VIEW_CONVERT_EXPR<struct inline2_pkg__ieee_short_real>(number_2(D)); which is two operations on a register. While as seen with PR109652 we might not want to completely rule out register to aggregate type VIEW_CONVERTs we definitely do not want to stack multiple ops here. The solution is to make sure the gimplifier puts a non-register as the base object. For the above this will add number.1 = number; and use number.1 in the compound reference. Code generation is unchanged, FRE optimizes this to BIT_FIELD_REF <number_2(D), ...>. I think BIT_FIELD_REF <VIEW_CONVERT (x), ...> could be always rewritten into BIT_FIELD_REF <x, ...>, but that's a separate thing. * gimplify.cc (gimplify_compound_lval): When there's a non-register type produced by one of the handled component operations make sure we get a non-register base.
Diffstat (limited to 'gcc/tree-cfg.cc')
0 files changed, 0 insertions, 0 deletions