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]

Re: SH: use register names instead of numbers


On Nov 19, 2000, NIIBE Yutaka <gniibe@chroot.org> wrote:

> Alexandre Oliva wrote:
>> There shouldn't be any.  All CODE_LABELs should be wrapped inside
>> LABEL_REFs.  Can you please post a test case that exposes a naked
>> CODE_LABEL?

> Sure.  Here's the "gzio-problem.i" and the backtrace.  I should have
> filed the bug report, before submitting patches.

No problem.  Thanks for reporting it anyway :-)

> The CODE_LABEL in question is the one in:

> (define_insn "calli_pcrel"
>   [(call (mem:SI (match_operand:SI 0 "arith_reg_operand" "r"))
> 	 (match_operand 1 "" ""))
>    (use (reg:SI 48))
>    (use (match_operand 2 "" "")) <------------------------------ THIS!!

Ugh!  There should have been a label_ref around it, just like in
sym_label2reg and symPLT_label2reg.  Please try this patch.

Index: gcc/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* config/sh/sh.md (calli_pcrel, call_valuei_pcrel): Enclose
	CODE_LABEL in LABEL_REF.

Index: gcc/config/sh/sh.md
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/sh/sh.md,v
retrieving revision 1.55
diff -u -p -r1.55 sh.md
--- gcc/config/sh/sh.md 2000/11/10 16:01:27 1.55
+++ gcc/config/sh/sh.md 2000/11/20 02:15:38
@@ -3285,7 +3285,7 @@
   [(call (mem:SI (match_operand:SI 0 "arith_reg_operand" "r"))
 	 (match_operand 1 "" ""))
    (use (reg:SI 48))
-   (use (match_operand 2 "" ""))
+   (use (label_ref (match_operand 2 "" "")))
    (clobber (reg:SI 17))]
   "TARGET_SH2"
   "bsrf	%0\\n%O2:%#"
@@ -3314,7 +3314,7 @@
 	(call (mem:SI (match_operand:SI 1 "arith_reg_operand" "r"))
 	      (match_operand 2 "" "")))
    (use (reg:SI 48))
-   (use (match_operand 3 "" ""))
+   (use (label_ref (match_operand 3 "" "")))
    (clobber (reg:SI 17))]
   "TARGET_SH2"
   "bsrf	%1\\n%O3:%#"

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]