public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* alpha-dec-vms __sync_lock_test_and_set char/short -O2 fails on all  4.3.x and 4.4.x
@ 2010-04-26  4:42 Jay K
  2010-04-26  4:47 ` Manuel López-Ibáñez
  0 siblings, 1 reply; 3+ messages in thread
From: Jay K @ 2010-04-26  4:42 UTC (permalink / raw)
  To: gcc-help


For the archives:

void f5( short* a,  short b,  short c)
    {  __sync_lock_test_and_set(a, b, c); }

jbook2:~ jay$  /obj/gcc442/avms/gcc/cc1 4.c -O2
 f5
Analyzing compilation unit
Performing interprocedural optimizations
 <visibility> <early_local_cleanups> <summary generate> <cp> <inline> <static-var> <pure-const>Assembling functions:
 f5
4.c: In function 'f5':
4.c:2: internal compiler error: in emit_move_insn, at expr.c:3405
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

Seems to occur on all of 4.3.0, 4.3.1, 4.3.2, 4.3.3, 4.3.4, 4.4.0, 4.4.1, 4.4.2, 4.4.3.
  I'm not sure I tried all of them, but I tried many.
It also occurs for char, unsigned short, presumably unsigned char.
This platform is a bit wierd because it has 64bit registers but 32bit long/void*/size_t.
It does not occur without -O2.
It does NOT occur on 4.5.0.
I'll compare 4.4.3 and 4.5.0, try to find a small patch to fix, since I'm using a 4.3.0-based tree.
ChangeLog doesn't make it obvious. I tried patching 4.3.0 with some 4.5.0 changes, before I thought to try the in-between versions.

 /src/gcc-4.3.0/configure -target alpha-dec-vms -disable-multilib -disable-dependency-tracking -disable-shared -enable-static -verbose -enable-sjlj-exceptions

There are also assertion failures and other problems in some of these releases when building libgcc.
e.g.:

/src/gcc-4.4.1/libgcc/../gcc/libgcc2.c: In function ‘__gcc_bcmp’:
/src/gcc-4.4.1/libgcc/../gcc/libgcc2.c:1993: error: unrecognizable insn:
(insn 61 60 62 6 /src/gcc-4.4.1/libgcc/../gcc/libgcc2.c:1987 (set (reg:DI 122)
        (plus:SI (subreg:SI (reg:DI 119) 0)
            (const_int 1 [0x1]))) -1 (nil))
/src/gcc-4.4.1/libgcc/../gcc/libgcc2.c:1993: internal compiler error: in extract_insn, at recog.c:2048
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
make[2]: *** [__gcc_bcmp.o] Error 1
make[1]: *** [all-target-libgcc] Error 2
make: *** [all] Error 2


Can just remove the __gcc_bcmp function I think.
(I don't have a working-enough cross toolset to know it isn't referenced.)



/src/gcc-4.4.2/gcc/config/alpha/vms-dwarf2eh.asm:31:Unknown pseudo-op: .global
/src/gcc-4.4.2/gcc/config/alpha/vms-dwarf2eh.asm:31:Rest of line ignored. 1st junk character valued 95 (_).m

Fix is to change it to .globl I think.

  - Jay

 		 	   		  

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

* Re: alpha-dec-vms __sync_lock_test_and_set char/short -O2 fails on   all 4.3.x and 4.4.x
  2010-04-26  4:42 alpha-dec-vms __sync_lock_test_and_set char/short -O2 fails on all 4.3.x and 4.4.x Jay K
@ 2010-04-26  4:47 ` Manuel López-Ibáñez
  2010-04-26 13:51   ` Jay K
  0 siblings, 1 reply; 3+ messages in thread
From: Manuel López-Ibáñez @ 2010-04-26  4:47 UTC (permalink / raw)
  To: Jay K; +Cc: gcc-help

On 25 April 2010 17:22, Jay K <jay.krell@cornell.edu> wrote:
>
> For the archives:

A better place would be http://gcc.gnu.org/bugzilla/

Cheers,

Manuel.

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

* RE: alpha-dec-vms __sync_lock_test_and_set char/short -O2 fails on  all 4.3.x and 4.4.x
  2010-04-26  4:47 ` Manuel López-Ibáñez
@ 2010-04-26 13:51   ` Jay K
  0 siblings, 0 replies; 3+ messages in thread
From: Jay K @ 2010-04-26 13:51 UTC (permalink / raw)
  To: lopezibanez; +Cc: gcc-help


In get_builtin_sync_mem, mem->u.fld.rt_rtx.code is REG in 4.5.0, SUBREG earlier.
So then compare that function and notice convert_memory_address added in 4.5.0 and then:

The same problem hit 32bit IA64/HP-UX (-milp32)

bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41801
fix: http://gcc.gnu.org/viewcvs/trunk/gcc/builtins.c?r1=153488&r2=153669&diff_format=h


jbook2:gcc jay$ diff -U5 builtins.c.orig builtins.c
--- builtins.c.orig    2010-04-25 09:55:44.000000000 -0700
+++ builtins.c    2010-04-25 09:55:58.000000000 -0700
@@ -6003,11 +6003,12 @@
 static rtx
 get_builtin_sync_mem (tree loc, enum machine_mode mode)
 {
   rtx addr, mem;
 
-  addr = expand_expr (loc, NULL_RTX, Pmode, EXPAND_SUM);
+  addr = expand_expr (loc, NULL_RTX, ptr_mode, EXPAND_SUM);
+  addr = convert_memory_address (Pmode, addr);
 
 - Jay

----------------------------------------
> From: lopezibanez@gmail.com
> Date: Sun, 25 Apr 2010 17:28:10 +0200
> Subject: Re: alpha-dec-vms __sync_lock_test_and_set char/short -O2 fails on all 4.3.x and 4.4.x
> To: jay.krell@cornell.edu
> CC: gcc-help@gcc.gnu.org
>
> On 25 April 2010 17:22, Jay K  wrote:
>>
>> For the archives:
>
> A better place would be http://gcc.gnu.org/bugzilla/
>
> Cheers,
>
> Manuel.
 		 	   		  

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

end of thread, other threads:[~2010-04-25 17:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-26  4:42 alpha-dec-vms __sync_lock_test_and_set char/short -O2 fails on all 4.3.x and 4.4.x Jay K
2010-04-26  4:47 ` Manuel López-Ibáñez
2010-04-26 13:51   ` Jay K

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