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] |
On 2015-04-27 6:12 AM, Kyrill Tkachov wrote:
I started a build and test with your patch on hppa64-hp-hpux11.11 this morning.On 22/04/15 12:51, Kyrill Tkachov wrote:On 21/04/15 18:33, Kyrill Tkachov wrote:On 21/04/15 15:09, Jeff Law wrote:On 04/21/2015 02:30 AM, Kyrill Tkachov wrote:From reading config/stormy16/stormy-abi it seems to me that we don't pass arguments partially in stormy16, so this code would never be calledthere. That leaves pa as the potential problematic target.I don't suppose there's an easy way to test on pa? My checkout of binutilsdoesn't seem to include a sim target for it.No simulator, no machines in the testfarm, the box I had access to via parisc-linux.org seems dead and my ancient PA overheats well before a bootstrap could complete. I often regret knowing about the backwards way many things were done on the PA because it makes me think about cases that only matter on dead architectures.So what should be the action plan here? I can't add an assert on positive result as a negative result is valid. We want to catch the case where this would cause trouble on pa, or change the patch until we're confident that it's fine for pa. That being said, reading the documentation of STACK_GROWS_UPWARD and ARGS_GROW_DOWNWARD I'm having a hard time visualising a case where this would cause trouble on pa. Is the problem that in the function: +/* Add SIZE to X and check whether it's greater than Y.+ If it is, return the constant amount by which it's greater or smaller. + If the two are not statically comparable (for example, X and Y contain + different registers) return -1. This is used in expand_push_insn to + figure out if reading SIZE bytes from location X will end up reading from+ location Y. */ +static int +memory_load_overlap (rtx x, rtx y, HOST_WIDE_INT size) +{ + rtx tmp = plus_constant (Pmode, x, size); + rtx sub = simplify_gen_binary (MINUS, Pmode, tmp, y); + + if (!CONST_INT_P (sub)) + return -1; + + return INTVAL (sub); +} for ARGS_GROW_DOWNWARD we would be reading 'backwards' from x, so the function should something like the following? static int memory_load_overlap (rtx x, rtx y, HOST_WIDE_INT size) { #ifdef ARGS_GROW_DOWNWARD rtx tmp = plus_constant (Pmode, x, -size); #else rtx tmp = plus_constant (Pmode, x, size); #endif rtx sub = simplify_gen_binary (MINUS, Pmode, tmp, y); if (!CONST_INT_P (sub)) return -1; #ifdef ARGS_GROW_DOWNWARD return INTVAL (-sub); #else return INTVAL (sub); #endif } now, say for x == sp + 4, y == sp + 8, size == 16: This would be a problematic case for arm, so this code on arm (where ARGS_GROW_DOWNWARD is *not* defined) would return 12, which is the number of bytes that overlap. On a target where ARGS_GROW_DOWNWARD is defined this would return -20, meaning that no overlap occurs (because we read in the descending direction from x, IIUC).Hi Jeff, Here's an attempt to make this more concrete. Only the memory_load_overlap function has changed. This time I tried to take into account the case when ARGS_GROW_DOWNWARD. Take the case where x == sp, y == sp + 8, size == 16. For arm, this would return 8 as that is the number of bytes that overlap. On pa, since ARGS_GROW_DOWNWARD is defined it would return -1 as we're reading down from x rather than up towards y. In the case when x == sp + 8, y == sp, size == 16 This would return -1 on arm since we're reading upwards from x and thefore no overlap would happen. On pa, this would return 8, which I think is the right thing. But again, I don't have access to any pa means of testing. What do you think of this approach?Hi Dave, Would it be possible for you to test this patch on a 64-bit hppa or at least bootstrap it? https://gcc.gnu.org/ml/gcc-patches/2015-04/msg01288.html
There is a concern that it may potentially affect the passing of complex arguments partially on the stack and partially in regs on pa because of the way the args and stack grow on that target. Unfortunately I don't have access to any hardware or simulators. It would help a lot with getting this patch in.
If you write to linux-parisc@vger.kernel.org, arrangements can be made for an account on a Debian parisc linux machine for development testing. Helge Deller has arranged for some new machines since we took over the Debian buildd infrastructure for parisc. More info is here: https://parisc.wiki.kernel.org/index.php/Main_Page
Thanks, KyrillThanks, Kyrill P.S. I've included the testcase from Honggyu in the patch. 2015-04-22 Kyrylo Tkachov <kyrylo.tkachov@arm.com> PR target/65358 * expr.c (memory_load_overlap): New function. (emit_push_insn): When pushing partial args to the stack would clobber the register part load the overlapping part into a pseudo and put it into the hard reg after pushing. 2015-04-22 Honggyu Kim <hong.gyu.kim@lge.com> PR target/65358 * gcc.dg/pr65358.c: New test.Thanks, KyrillJeff
Regards, Dave -- John David Anglin dave.anglin@bell.net
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |