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: [mips] fix $gp restore bug


Hi Richard,

Richard Sandiford <rdsandiford@googlemail.com> writes:
> +	return ("%[daddiu\t$sp,$sp,-16\n"
> +		"\tsd\t$31,0($sp)\n"
> +		"\t%(%<bal\t1f\n"
> +		"\tlui\t%@,%%hi(%0)%>%)\n"

I think you missed the substraction by the label.  I.e.

		"\tlui\t%@,%%hi(%0-1f)%>%)\n"
                                  ^^^

> +		"1:\tdaddu\t%@,%@,$31\n"
> +		"\tld\t$31,0($sp)\n"
> +		"\tdaddiu\t%@,%@,%%lo(%0)\n"
> +		"\tdaddiu\t$sp,$sp,16");


Adam


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