Linux PARISC architecture development
 help / color / mirror / Atom feed
* [parisc-linux] pa reload problem
@ 2000-12-01  0:23 Alan Modra
  2000-12-01  6:12 ` John David Anglin
  0 siblings, 1 reply; 51+ messages in thread
From: Alan Modra @ 2000-12-01  0:23 UTC (permalink / raw)
  To: John David Anglin, Jeffrey A Law; +Cc: Richard Hirst, parisc-linux

Hi Dave, Jeff,
  This little testcase triggers a bug on hppa64.  It's been around for
quite a while, so it's not something due to Dave's recent changes.

*******
extern void foo (int);
extern unsigned int cpu_hz;

int hppa_dp_bug (void)
{
  foo (42);
  return (5 * ((unsigned long)cpu_hz / 1000000UL));
}
*******

-O2 generates code like

        b,l foo,%r2
        copy %r27,%r4
        addil LT'cpu_hz,%r4	! know r27 trashed in call, so use r4
        ldd RT'cpu_hz(%r1),%r1
        ldd -144(%r30),%r2
        ldw 0(%r1),%r19
        addil LT'L$C0000,%r27	! oops, should be using r4
        ldd RT'L$C0000(%r1),%r1

The bad code codes from config/pa/pa.c:legitimize_pic_address

  if (GET_CODE (orig) == SYMBOL_REF)
    {
      if (reg == 0)
	abort ();

      if (flag_pic == 2)
	{
	  emit_move_insn (reg,
			  gen_rtx_PLUS (word_mode, pic_offset_table_rtx,
					gen_rtx_HIGH (word_mode, orig)));

To fix the problem, it seems to me that we should be testing whether
pic_offset_table_rtx is valid at this point, and if not, use the saved reg
instead.  I'm not exactly sure how to go about testing whether r27 is
valid here, and I'm sure one of you can point me in the right direction.

Alan Modra
-- 
Linuxcare.  Support for the Revolution.

^ permalink raw reply	[flat|nested] 51+ messages in thread
[parent not found: <20001201202613.E7166@linuxcare.com>]
[parent not found: <no.id>]

end of thread, other threads:[~2001-01-02  0:41 UTC | newest]

Thread overview: 51+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-12-01  0:23 [parisc-linux] pa reload problem Alan Modra
2000-12-01  6:12 ` John David Anglin
2000-12-01  7:00   ` Alan Modra
2000-12-02  7:33     ` John David Anglin
2000-12-02  7:48       ` John David Anglin
2000-12-02 23:28         ` John David Anglin
2000-12-05 19:42           ` John David Anglin
2000-12-06 20:41             ` John David Anglin
2000-12-07  0:16               ` Richard Henderson
2000-12-07  0:57                 ` John David Anglin
2000-12-07  1:18                   ` John David Anglin
2000-12-08 22:05                 ` John David Anglin
2000-12-08 23:45                   ` Richard Henderson
2000-12-09  1:07                     ` John David Anglin
2000-12-09  1:39                       ` Richard Henderson
2000-12-09  3:12                         ` John David Anglin
2000-12-09  4:05                         ` Jeffrey A Law
2000-12-09  6:55                           ` Richard Henderson
2000-12-11 17:29                             ` Jeffrey A Law
2000-12-11 18:48                               ` John David Anglin
2000-12-11 23:51                                 ` Alan Modra
2000-12-09  7:52                           ` Alan Modra
2000-12-09  7:55                             ` Richard Henderson
2000-12-09  8:35                               ` Alan Modra
2000-12-09 13:57                                 ` Alan Modra
2000-12-09 18:56                                   ` Richard Henderson
2000-12-09 23:35                                     ` Alan Modra
2000-12-22 17:21                         ` John David Anglin
2000-12-30 19:05                           ` John David Anglin
2001-01-01 23:24                             ` Jeffrey A Law
2000-12-11 21:27                     ` Michael Meissner
2000-12-02 12:35       ` Alan Modra
2000-12-02 19:43         ` Richard Henderson
2000-12-02 23:01           ` John David Anglin
2000-12-03  1:50             ` Richard Henderson
2000-12-03  3:30           ` Alan Modra
2000-12-02 23:08         ` John David Anglin
2000-12-04  1:41         ` Alan Modra
2000-12-04 18:41           ` Richard Hirst
     [not found] <20001201202613.E7166@linuxcare.com>
2000-12-02  7:15 ` Alan Modra
2000-12-04 18:40   ` Richard Hirst
2000-12-04 22:55     ` Alan Modra
2000-12-04 23:08       ` John David Anglin
2000-12-04 23:59         ` Alan Modra
2000-12-05  0:50           ` John David Anglin
2000-12-05  5:33             ` Alan Modra
     [not found] <no.id>
2000-12-14  0:48 ` John David Anglin
2000-12-14  3:43   ` Jeffrey A Law
2000-12-14 16:40     ` John David Anglin
2000-12-27 20:08       ` Jeffrey A Law
2000-12-28  5:18         ` John David Anglin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox