This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RFC: subreg fixing (extract_bit_field or simplify_subreg)
- From: Aldy Hernandez <aldyh at redhat dot com>
- To: gcc at gcc dot gnu dot org, rth at redhat dot com
- Date: Thu, 28 Oct 2004 13:53:21 -0400
- Subject: RFC: subreg fixing (extract_bit_field or simplify_subreg)
Yay. More subreg stupidity.
On the following testcase, we call extract_bit_field trying to extract
a DF out of a memory block:
struct __attribute__ ((packed)) W { double l; } sW;
double dd;
testW () { dd = sW.l; }
We first call operand_subword with wordnum=1, and somewhere down the call
chain, simplify_gen_subreg calls simplify_subreg, which returns 0.
This causes simplify_gen_subreg to force creation of the subreg
with gen_rtx_SUBREG.
...this creates invalid rtl: (subreg:SI (reg:DF 118) 4).
What is advisable?
Would it be ok to modify simplify_gen_subreg to return NULL_RTX for
class incompatabilities, or is the problem further up? (Obviously,
I'd have to change operand_subword to operand_subword_force).
On a similar note, invalid rtl keeps biting my butt, and has for about
5 years. Would be ok to add checks in gen_rtx_SUBREG to abort on
invalid RTL (hard coding the common cases)...or am I back to putting
yellow stickies on my monitor with the stupid cases, and matching RTL
dumps with stickies for the rest of my life?
Aldy