Bug 11625 - internal error in evax_frob_symbol assembling gmp 4.3.2 cntlz.asm
Summary: internal error in evax_frob_symbol assembling gmp 4.3.2 cntlz.asm
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: gas (show other bugs)
Version: 2.21
: P2 normal
Target Milestone: ---
Assignee: gingold@adacore.com
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-23 12:54 UTC by Jay
Modified: 2011-06-27 07:53 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
testcase (256 bytes, text/plain)
2010-05-26 14:04 UTC, gingold@adacore.com
Details
The right testcase (272 bytes, text/plain)
2010-05-26 15:02 UTC, gingold@adacore.com
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jay 2010-05-23 12:54:48 UTC
eek, this is quite involved to get to:

CFLAGS= CC=alpha64-dec-vms-gcc /src/gmp-4.3.2/configure -host=alpha64-dec-vms
-target=alpha64-dec-vms -prefix=$HOME/gnu/alpha64-dec-vms -disable-shared -verbose

make

m4  -DHAVE_CONFIG_H -D__GMP_WITHIN_GMP -DOPERATION_cntlz cntlz.asm >tmp-cntlz.s
 alpha64-dec-vms-gcc -std=gnu99 -c -DHAVE_CONFIG_H -I. -I/src/gmp-4.3.2/mpn -I..
-D__GMP_WITHIN_GMP -I/src/gmp-4.3.2 -DOPERATION_cntlz tmp-cntlz.s -o cntlz.obj
tmp-cntlz.s: Assembler messages:
tmp-cntlz.s:56: Warning: Bad .frame directive 3./4. param
tmp-cntlz.s:59: Error: invalid sections for operation on `L0' and
`__gmpn_count_leading_zeros'
tmp-cntlz.s:76: Internal error, aborting at
/src/binutils/src/gas/config/obj-evax.c line 128 in evax_frob_symbol
Please report this bug.
tmp-cntlz.s:76: Fatal error: can't close cntlz.obj: Section has no contents

my mistake though, I'll use host/target=none-dec-vms instead, that will skip the
entire file.

I will attach the small source file and the small file it includes.
Comment 1 Jay 2010-05-23 12:57:57 UTC
cntlz.asm is:

ASM_START()
EXTERN(__clz_tab)
PROLOGUE(mpn_count_leading_zeros,gp)
	cmpbge	r31,  r16, r1
	LEA(r3,__clz_tab)
	sra	r1,   1,   r1
	xor	r1,   127, r1
	srl	r16,  1,   r16
	addq	r1,   r3,  r1
	ldq_u	r0,   0(r1)
	lda	r2,   64
	extbl	r0,   r1,   r0
	s8subl	r0,   8,    r0
	srl	r16,  r0,   r16
	addq	r16,  r3,   r16
	ldq_u	r1,   0(r16)
	extbl	r1,   r16,  r1
	subq	r2,   r1,   r2
	subq	r2,   r0,   r0
	ret	r31,  (r26),1
EPILOGUE(mpn_count_leading_zeros)
ASM_END()



config.m4 is probably:

dnl config.m4.  Generated automatically by configure.
changequote(<,>)
ifdef(<__CONFIG_M4_INCLUDED__>,,<
define(<CONFIG_TOP_SRCDIR>,<`/src/gmp-4.3.2'>)
define(<WANT_ASSERT>,0)
define(<WANT_PROFILING>,<`no'>)
define(<SIZEOF_UNSIGNED>,<4>)
define(<GMP_LIMB_BITS>,32)
define(<GMP_NAIL_BITS>,0)
define(<GMP_NUMB_BITS>,eval(GMP_LIMB_BITS-GMP_NAIL_BITS))
>)
changequote(`,')
ifdef(`__CONFIG_M4_INCLUDED__',,`
include(CONFIG_TOP_SRCDIR`/mpn/asm-defs.m4')
define_not_for_expansion(`HAVE_HOST_CPU_none')
define_not_for_expansion(`HAVE_ABI_long')
define_not_for_expansion(`HAVE_LIMB_LITTLE_ENDIAN')
define_not_for_expansion(`HAVE_DOUBLE_IEEE_LITTLE_ENDIAN')
')
define(`__CONFIG_M4_INCLUDED__')


though I might have the wrong one.

I wasn't able to attach more than one file at a time.
Comment 2 Nick Clifton 2010-05-25 09:52:31 UTC
Hi Jay,

  I have not had a lot of luck reproducing this problem.  Is there any chance
you could capture the tmp-cntlz.s file and upload that to this PR ?

Cheers
  Nick
Comment 3 gingold@adacore.com 2010-05-26 14:04:49 UTC
Created attachment 4816 [details]
testcase
Comment 4 gingold@adacore.com 2010-05-26 14:06:49 UTC
(In reply to comment #2)
> Hi Jay,
> 
>   I have not had a lot of luck reproducing this problem.  Is there any chance
> you could capture the tmp-cntlz.s file and upload that to this PR ?

I have attached the testcase.  I plan to investigate.
The input doesn't follow alpha vms conventions, but gas shouldn't crash on it.

Tristan.
Comment 5 Nick Clifton 2010-05-26 14:36:29 UTC
Hi Tristan,

  Hmm - with that testcase do you see the abort ?  All I get is the following:

  % as-new cntlz.s
  cntlz.s: Assembler messages:
  cntlz.s:7: Warning: Bad .frame directive 3./4. param
  cntlz.s:10: Error: invalid sections for operation on `L0' and
`__gmpn_count_leading_zeros'
  cntlz.s:27: Fatal error: can't close cntlz.o: Section has no contents

  And no abort.  Ie the assembler appears to be behaving reasonably.

Cheers
  Nick
Comment 6 gingold@adacore.com 2010-05-26 15:02:49 UTC
Created attachment 4819 [details]
The right testcase

Sorry, the previous one was truncated.
Comment 7 Sourceware Commits 2011-06-24 15:44:47 UTC
CVSROOT:	/cvs/src
Module name:	src
Changes by:	gingold@sourceware.org	2011-06-24 15:44:41

Modified files:
	gas            : ChangeLog 
	gas/config     : obj-evax.c 

Log message:
	2011-06-24  Tristan Gingold  <gingold@adacore.com>
	
	PR gas/11625
	* config/obj-evax.c (evax_frob_symbol): Use as_bad instead of abort.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/ChangeLog.diff?cvsroot=src&r1=1.4516&r2=1.4517
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/config/obj-evax.c.diff?cvsroot=src&r1=1.8&r2=1.9