This is the mail archive of the
mailing list for the GCC project.
Re: [patch?] num_sign_bit_copies1: sign_extending consts
- From: Roger Sayle <roger at eyesopen dot com>
- To: DJ Delorie <dj at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 3 Nov 2003 15:53:36 -0700 (MST)
- Subject: Re: [patch?] num_sign_bit_copies1: sign_extending consts
> This code does not handle sign extension of const_ints very well.
> The test case is attached also.
Could you provide the target triple this is happening on? Your test
case works fine at -O2 with mainline CVS for i686-pc-cygwin.
Any unary operation of a constant, or binary operation of two constants
implies something has gone wrong elsewhere in preparing the RTL. Hence
we need to discover where in GCC is generating the invalid code with an
explicit SIGN_EXTEND rather than calling simplify_gen_unary, which takes
the necessary steps to ensure the RTL is valid. For example, the
routine simplify_replace_rtx calls this function if a CONST_INT is ever
substituted into an existing SIGN_EXTEND.
Let me know if I can help?