public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Suspicious code in assign_parms
@ 2002-07-22 13:35 Momchil Velikov
  2002-07-23  5:44 ` Momchil Velikov
  0 siblings, 1 reply; 3+ messages in thread
From: Momchil Velikov @ 2002-07-22 13:35 UTC (permalink / raw)
  To: gcc

I'm seeing extra zero/sign extension operations on argument registers
and came to the following code in ``assign_parms'':

                if (GET_CODE (tempreg) == SUBREG
		  && GET_MODE (tempreg) == nominal_mode
		  && GET_CODE (SUBREG_REG (tempreg)) == REG
		  && nominal_mode == passed_mode
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
		  && GET_MODE (SUBREG_REG (tempreg)) == GET_MODE (entry_parm)
		  && GET_MODE_SIZE (GET_MODE (tempreg))
		     < GET_MODE_SIZE (GET_MODE (entry_parm)))
		{
		  /* The argument is already sign/zero extended, so note it
		     into the subreg.  */
		  SUBREG_PROMOTED_VAR_P (tempreg) = 1;
		  SUBREG_PROMOTED_UNSIGNED_SET (tempreg, unsignedp);
		}

Note the underlined comparison.  Does it look right ?  I thought that
should be ``promoted_nominal_mode == passed_mode''.

Could somebody explain the meaning of and difference between the
variables ``promoted_mode'' and ``promoted_nominal_mode'' throughout
``assign_parms'' ?

~velco

PS. Changing above ``nominal_mode'' to ``promoted_nominal_mode'' seems
to get rid of the extra conversions on v850e.

Bootstrapping + regtesting on i686-pc-linux-gnu (though it wouldn't
make a difference, I guess) and regtesting on arm-unknown-elf in
progress.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Suspicious code in assign_parms
  2002-07-22 13:35 Suspicious code in assign_parms Momchil Velikov
@ 2002-07-23  5:44 ` Momchil Velikov
  2002-07-23 11:28   ` Momchil Velikov
  0 siblings, 1 reply; 3+ messages in thread
From: Momchil Velikov @ 2002-07-23  5:44 UTC (permalink / raw)
  To: gcc

>>>>> "Momchil" == Momchil Velikov <velco@fadata.bg> writes:

Momchil> Note the underlined comparison.  Does it look right ?  I thought that
Momchil> should be ``promoted_nominal_mode == passed_mode''.

Momchil> Could somebody explain the meaning of and difference between the
Momchil> variables ``promoted_mode'' and ``promoted_nominal_mode'' throughout
Momchil> ``assign_parms'' ?

Uh, never mind, figured that out (kinda) ...

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Suspicious code in assign_parms
  2002-07-23  5:44 ` Momchil Velikov
@ 2002-07-23 11:28   ` Momchil Velikov
  0 siblings, 0 replies; 3+ messages in thread
From: Momchil Velikov @ 2002-07-23 11:28 UTC (permalink / raw)
  To: gcc

>>>>> "Momchil" == Momchil Velikov <velco@fadata.bg> writes:

>>>>> "Momchil" == Momchil Velikov <velco@fadata.bg> writes:
Momchil> Note the underlined comparison.  Does it look right ?  I thought that
Momchil> should be ``promoted_nominal_mode == passed_mode''.

Momchil> Could somebody explain the meaning of and difference between the
Momchil> variables ``promoted_mode'' and ``promoted_nominal_mode'' throughout
Momchil> ``assign_parms'' ?

Momchil> Uh, never mind, figured that out (kinda) ...

But still ...
How about this patch ? Comments ?

***************
*** 4765,4771 ****
  	      if (GET_CODE (tempreg) == SUBREG
  		  && GET_MODE (tempreg) == nominal_mode
  		  && GET_CODE (SUBREG_REG (tempreg)) == REG
! 		  && nominal_mode == passed_mode
  		  && GET_MODE (SUBREG_REG (tempreg)) == GET_MODE (entry_parm)
  		  && GET_MODE_SIZE (GET_MODE (tempreg))
  		     < GET_MODE_SIZE (GET_MODE (entry_parm)))
--- 4763,4769 ----
  	      if (GET_CODE (tempreg) == SUBREG
  		  && GET_MODE (tempreg) == nominal_mode
  		  && GET_CODE (SUBREG_REG (tempreg)) == REG
! 		  && promoted_nominal_mode == promoted_mode
  		  && GET_MODE (SUBREG_REG (tempreg)) == GET_MODE (entry_parm)
  		  && GET_MODE_SIZE (GET_MODE (tempreg))
  		     < GET_MODE_SIZE (GET_MODE (entry_parm)))

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-07-23 13:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-22 13:35 Suspicious code in assign_parms Momchil Velikov
2002-07-23  5:44 ` Momchil Velikov
2002-07-23 11:28   ` Momchil Velikov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).