Re: in ccio_io_pdir_entry(),BUG_ON() seems to break gcc-4.2 optimization?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Grant Grundler wrote:
> > On Thu, Jun 26, 2008 at 07:28:03AM +0100, Joel Soete wrote:
> >> Just for remind:
> >>
> >> Joel Soete wrote:
> >>  >
> >>  >
> >> [snip]
> >>  >>> But this time, it seems not consider assembly:
> >>  >>>         asm volatile ("lci %%r0(%%sr1, %1), %0" : "=r" (ci) : "r"
> >>  >>> (vba));
> >>  >>>         asm volatile ("extru %1,19,12,%0" : "+r" (ci) : "r" (ci));
> >>  >>>         asm volatile ("depw  %1,15,12,%0" : "+r" (pa) : "r" (ci));
> >>  >>>
> >>  >>> as a 'volatile' block and insert line 1c:
> >>
> >> This seems to make better what I want:
> >>         __asm__ __volatile__ (
> >>         "lci    %%r0(%%sr1, %2), %0\n"
> >>         "\textru        %0,19,12,%0\n"
> >>         "\tdepw         %0,15,12,%1\n"
> >>         : "+r" (ci), "+r" (pa)
> >>         : "r" (vba)
> >>         : "memory"
> > 
> > Why the "memory"? This asm code isn't modifying memory at all.
> > 
> well I certainly still have wrongly understand what "memory" clobber means but for me "pa" is a memory location modified 
> (the plus sign in '"+r" (pa)' and that either after 64bit computation or 32bit initialization pa=0).

The "+r" constraint indicates a register operand that is both read and written.
However, "ci" and "pa" are not read, so the constraints for them should be
"=r".  None of the instructions modify memory, so the "memory" clobber
is unnecessary.

> so why not simply get rid of its declaration (btw save a line of code ;-)) and just use a common temporay reg as r19?

r19 is the pic register in 64-bit mode and can't be used without saving
and restoring it.

Dave
-- 
J. David Anglin                                  dave.anglin@xxxxxxxxxxxxxx
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)
--
To unsubscribe from this list: send the line "unsubscribe linux-parisc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux SoC]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux