This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: patch: reject incompatible classes in simplify_subreg


On Mon, Nov 29, 2004 at 03:48:58PM -0800, Richard Henderson wrote:

Sorry for taking so long on this, I've been moving, etc.  Sigh...

> > 	* simplify-rtx.c (simplify_subreg): Reject class incompatability,
> > 	and avoid making invalid subregs.
> 
> This *should* be redundant with the validate_subreg check later.
> Do you have a test case that denies this?  Remember that we *do*
> currently allow (subreg:SI (reg:DF) 0) for a 32-bit target...

Yes, I have a testcase (attached), but unfortunately the subreg created
is a (subreg:SI (reg:DF) 0) which you say is valid.  It was my 
understanding that we were allowing such subregs because of clumsy
back-ends...I didn't know we were allowing the middle end to create them.

The problem here in this testcase is that operand_subword is called on: 

	(subreg:DI (reg:DF 122 [ a ]) 0)

Down the call chain we call simplify_subreg, reducing the above into 
(subreg:SI (reg:DF 122 [ a ]) 0), which *I* thought was suspect.

This is causing us to choose, and modify, the wrong end in a multi-register 
DF hard register later on.

Are you unconvinced this is a worthwhile fix?

Perhaps I could somehow salvage GCC sanity later on...or perhaps I'm
attacking this incorrectly.

??

Aldy

Attachment: a.c
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]