public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: Patch to fix gcc.c-torture/compile/20010102-1.c on IA64 HP-UX
@ 2008-11-06 20:43 David Edelsohn
  2008-11-06 22:05 ` Jeff Law
  0 siblings, 1 reply; 51+ messages in thread
From: David Edelsohn @ 2008-11-06 20:43 UTC (permalink / raw)
  To: Jeff Law
  Cc: luisgpm, Andrew Pinski, sje, Richard Henderson, Peter Bergner,
	gcc-patches, paolo.carlini

Jeff,

The RTL is a pair of (high (symbol_ref)) and (lo_sum (reg) (symbol_ref)).

alias.c:find_base_value() has a special case for lo_sum:

    case LO_SUM:
      /* The standard form is (lo_sum reg sym) so look only at the
         second operand.  */
      return find_base_value (XEXP (src, 1));

However, find_base_term() throws lo_sum in with PLUS and MINUS,
which prefers the REG.  find_base_term() appears to expect that the
symbol_ref from the HIGH will be recorded with the REG and picked
up by the LO_SUM from that source.

find_base_term() either could check for non-zero base before returning
in the lo_sum/plus/minus case statement or could handle lo_sum
explicitly, like find_base_value().

David

^ permalink raw reply	[flat|nested] 51+ messages in thread
* Patch to fix gcc.c-torture/compile/20010102-1.c on IA64 HP-UX
@ 2008-09-16 18:21 Steve Ellcey
  2008-09-16 19:00 ` Peter Bergner
  0 siblings, 1 reply; 51+ messages in thread
From: Steve Ellcey @ 2008-09-16 18:21 UTC (permalink / raw)
  To: gcc-patches; +Cc: bergner, paolo.carlini

The test case gcc.c-torture/compile/20010102-1.c is failing on IA64
HP-UX in 32 bit mode when compiled with -O3 -funroll-loops.  My analysis
shows that this is because regrename is not copying the REG_POINTER
attribute of a register when renaming it.  This causes a problem with
the use of the IA64 addp4 instruction which, when used with two
registers, requires that one of the registers be a pointer and the other
be an offset (and that we know which one is which).  Without this
patch neither register is marked as a pointer.

This patch copies the REG_POINTER setting of a register whenever we
are copying the attributes.  Tested on IA64 HP-UX and Linux with
no regressions.

I am cc'ing Paolo and Peter Bergner because this problem started with
the patch to PR 28690.

OK for checkin?

Steve Ellcey
sje@cup.hp.com


2008-08-16  Steve Ellcey  <sje@cup.hp.com>

	* regrename.c (do_replace): Copy REG_POINTER value to new reg.
	(find_oldest_value_reg): Ditto.
	(copyprop_hardreg_forward_1): Ditto.


Index: regrename.c
===================================================================
--- regrename.c	(revision 140386)
+++ regrename.c	(working copy)
@@ -357,11 +357,13 @@ do_replace (struct du_chain *chain, int 
     {
       unsigned int regno = ORIGINAL_REGNO (*chain->loc);
       struct reg_attrs * attr = REG_ATTRS (*chain->loc);
+      int reg_ptr = REG_POINTER (*chain->loc);
 
       *chain->loc = gen_raw_REG (GET_MODE (*chain->loc), reg);
       if (regno >= FIRST_PSEUDO_REGISTER)
 	ORIGINAL_REGNO (*chain->loc) = regno;
       REG_ATTRS (*chain->loc) = attr;
+      REG_POINTER (*chain->loc) = reg_ptr;
       df_insn_rescan (chain->insn);
       chain = chain->next_use;
     }
@@ -1375,6 +1377,7 @@ find_oldest_value_reg (enum reg_class cl
 	{
 	  ORIGINAL_REGNO (new_rtx) = ORIGINAL_REGNO (reg);
 	  REG_ATTRS (new_rtx) = REG_ATTRS (reg);
+	  REG_POINTER (new_rtx) = REG_POINTER (reg);
 	  return new_rtx;
 	}
     }
@@ -1673,6 +1676,7 @@ copyprop_hardreg_forward_1 (basic_block 
 		    {
 		      ORIGINAL_REGNO (new_rtx) = ORIGINAL_REGNO (src);
 		      REG_ATTRS (new_rtx) = REG_ATTRS (src);
+		      REG_POINTER (new_rtx) = REG_POINTER (src);
 		      if (dump_file)
 			fprintf (dump_file,
 				 "insn %u: replaced reg %u with %u\n",

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

end of thread, other threads:[~2009-06-01 15:21 UTC | newest]

Thread overview: 51+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-06 20:43 Patch to fix gcc.c-torture/compile/20010102-1.c on IA64 HP-UX David Edelsohn
2008-11-06 22:05 ` Jeff Law
2008-11-06 23:29   ` David Edelsohn
2008-11-06 23:48     ` Jeff Law
2008-11-07 18:58       ` Luis Machado
2008-11-27 14:34       ` Luis Machado
2008-11-27 15:46         ` Richard Guenther
2008-11-27 20:32         ` Jeff Law
2008-11-27 21:07           ` Luis Machado
2008-11-27 23:24             ` Jeff Law
2009-05-26 16:50               ` Luis Machado
2009-06-01  3:55                 ` Ian Lance Taylor
2009-06-01 15:21                   ` Luis Machado
  -- strict thread matches above, loose matches on Subject: below --
2008-09-16 18:21 Steve Ellcey
2008-09-16 19:00 ` Peter Bergner
2008-09-16 19:20   ` Steve Ellcey
2008-09-16 19:40     ` Peter Bergner
2008-09-16 21:55       ` Jakub Jelinek
2008-09-17  1:22         ` Peter Bergner
2008-09-16 19:44     ` Jeff Law
2008-09-16 20:20       ` Peter Bergner
2008-09-16 20:49         ` Jeff Law
2008-09-16 20:49           ` Steve Ellcey
2008-09-16 21:31             ` Jeff Law
2008-09-16 21:40               ` Steve Ellcey
2008-09-17  1:54                 ` Peter Bergner
2008-09-17 17:31                   ` Steve Ellcey
2008-09-18 16:03                   ` Steve Ellcey
2008-09-18 20:38                     ` Peter Bergner
2008-09-16 21:48             ` Jeff Law
2008-09-16 22:00               ` Steve Ellcey
2008-09-18 20:59                 ` Richard Henderson
2008-09-19 18:56                   ` Steve Ellcey
2008-09-23 20:55                     ` Jeff Law
2008-09-23 21:08                       ` Steve Ellcey
2008-10-03 19:35                         ` Luis Machado
2008-10-04  0:47                           ` Jeff Law
2008-10-04  1:09                             ` Andrew Pinski
2008-10-16 21:46                               ` Luis Machado
2008-10-16 22:02                                 ` Jeff Law
2008-10-30 22:27                                   ` Luis Machado
2008-10-31  2:23                                     ` Steve Ellcey
2008-10-31  2:17                                       ` Peter Bergner
2008-10-31  2:03                                         ` Jeff Law
2008-10-31  1:50                                           ` Steve Ellcey
2008-11-06 18:00                                             ` Jeff Law
2008-10-31 10:53                                           ` Jakub Jelinek
2008-10-31 20:29                                           ` Peter Bergner
2008-10-31 20:50                                             ` Luis Machado
2008-10-31 21:27                                             ` Jakub Jelinek
2008-11-06 18:25                                     ` Jeff Law

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