public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* latch mem to reg before multi-access in convert_move
@ 2012-04-05 15:30 Olivier Hainque
  2012-05-03 10:27 ` ping: " Olivier Hainque
  2012-05-24 21:53 ` ping x2 : " Olivier Hainque
  0 siblings, 2 replies; 8+ messages in thread
From: Olivier Hainque @ 2012-04-05 15:30 UTC (permalink / raw)
  To: GCC Patches; +Cc: Olivier Hainque

[-- Attachment #1: Type: text/plain, Size: 1422 bytes --]

Hello,

At some point in convert_move we have:

<<    /* No special multiword conversion insn; do it by hand.  */

      start_sequence ();

      /* Since we will turn this into a no conflict block, we must ensure
	 that the source does not overlap the target.  */

      if (reg_overlap_mentioned_p (to, from))
	from = force_reg (from_mode, from);
 
      ... emit a multi-insn sequence ...
>>

With a previous version of the compiler, we happened to get there
pretty easily with MEM_P(from) and the multi-insn sequence producing
multiple memory references to the source.

The original problem we had with this was the introduction of an
artificial race condition in addition to the potential performance
impact.

We had fixed this with the attached patch, which simply forces "from"
into a REG if it is a MEM, in addition to the current condition.
While our original testcases don't expose the problem with current
versions of the compiler, the issue appears to remain latent and the
change still looks sensible in any case.

We have been running with it for years across several versions of 
gcc on numerous platforms. I have just bootstrapped and regtested
with mainline on x86_64-linux.

OK to commit ?

Thanks in advance,

Olivier

2012-04056  Olivier Hainque  <hainque@adacore.com>

        * expr.c (convert_move): Latch mem integer inputs into a
        register before expanding a multi-instructions sequence.


[-- Attachment #2: memlatch.dif --]
[-- Type: video/x-dv, Size: 1240 bytes --]

[-- Attachment #3: Type: text/plain, Size: 2 bytes --]




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

end of thread, other threads:[~2012-06-26 20:29 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-05 15:30 latch mem to reg before multi-access in convert_move Olivier Hainque
2012-05-03 10:27 ` ping: " Olivier Hainque
2012-05-24 21:53 ` ping x2 : " Olivier Hainque
2012-06-24 10:26   ` ping x3 " Olivier Hainque
2012-06-25 19:05     ` Richard Henderson
2012-06-26 11:29       ` Olivier Hainque
2012-06-26 16:17         ` Richard Henderson
2012-06-26 21:05           ` Olivier Hainque

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).