The new __dmr type that is being added as a possible future PowerPC instruction
set bumps into a structure field size issue. The size of the __dmr type is 1024 bits.
The precision field in tree_type_common is currently 10 bits, so if you store
1,024 into field, you get a 0 back. When you get 0 in the precision field, the
ccp pass passes this 0 to sext_hwi in hwint.h. That function in turn generates
a shift that is equal to the host wide int bit size, which is undefined as
machine dependent for shifting in C/C++.
It turns out the x86_64 where I first did my tests returns the original input
before the two shifts, while the PowerPC always returns 0. In the ccp pass, the
original input is -1, and so it worked. When I did the runs on the PowerPC, the
result was 0, which ultimately led to the failure.
2023-02-01 Richard Biener <rguenther@suse.de>
Michael Meissner <meissner@linux.ibm.com>
PR middle-end/108623
* tree-core.h (tree_type_common): Bump up precision field to 16 bits.
Align bit fields > 1 bit to at least an 8-bit boundary.