A serious bug in ptxas?

I have recently started to port a working PTX code, targeting sm_13, to Fermi,
when the following, for now unavoidable, bug in ptxas has emerged. A minimal
code to reproduce the bug is given in bug.ptx (i.e., bug.txt for upload) file.

ptxas --gpu-name sm_20 --opt-level 4 --verbose bug.ptx
Such an attempt gives:
-> on Windows XP Professional x64 Edition,
with CUDA toolkit 3.1 running in 64-bit mode,
ptxas info : Compiling entry function ‘Kernel2’ for ‘sm_20’
Internal error
-> on 64-bit openSUSE 11.2,
with CUDA toolkit 3.1 running in 64-bit mode,
ptxas info : Compiling entry function ‘Kernel2’ for ‘sm_20’
Segmentation fault

If .target is changed to sm_13, and command-line to
ptxas --gpu-name sm_13 --opt-level 4 --verbose bug.ptx
it works as expected, i.e., 0 registers and 512+16 bytes smem for both kernels
and on both platforms.

I would also like to note that the original file has two kernels (.entries)
and a bunch of functions (.func). The only change was .target sm_13 replaced
with .target sm_20. When compiling the second kernel for Fermi ptxas produces
ptxas original.ptx, line 0; Hâ∞(Ç=¥╔R: (C6001) Temporary register limit of 7 exceeded; 9 registers needed to compile program
(The garbage characters copy-pasted from Windows console with CP437.)

I’ve tried various optimization levels, without success.

Please, could someone try to confirm this bug?

TIA, Vedran

Indeed happens on Mac OS X (64 bit, toolkit 3.1) as well:

$ gdb ptxas

GNU gdb 6.3.50-20050815 (Apple version gdb-1469) (Wed May  5 04:36:56 UTC 2010)

[...]

This GDB was configured as "x86_64-apple-darwin"...Reading symbols for shared libraries .... done

(gdb) r -arch sm_20 bug.ptx

Starting program: /usr/local/cuda/bin/ptxas -arch sm_20 bug.ptx

Reading symbols for shared libraries +++. done

Program received signal EXC_BAD_ACCESS, Could not access memory.

Reason: KERN_PROTECTION_FAILURE at address: 0x00000004

0x00502ea0 in ProfileData_Fermi_vp::IsVertexProfile ()

Indeed happens on Mac OS X (64 bit, toolkit 3.1) as well:

$ gdb ptxas

GNU gdb 6.3.50-20050815 (Apple version gdb-1469) (Wed May  5 04:36:56 UTC 2010)

[...]

This GDB was configured as "x86_64-apple-darwin"...Reading symbols for shared libraries .... done

(gdb) r -arch sm_20 bug.ptx

Starting program: /usr/local/cuda/bin/ptxas -arch sm_20 bug.ptx

Reading symbols for shared libraries +++. done

Program received signal EXC_BAD_ACCESS, Could not access memory.

Reason: KERN_PROTECTION_FAILURE at address: 0x00000004

0x00502ea0 in ProfileData_Fermi_vp::IsVertexProfile ()

Thank you for bringing this issue to our attention. I was able to reproduce this failure with the 3.1 toolchain on WinXP64. I will file a compiler bug.

Thank you for bringing this issue to our attention. I was able to reproduce this failure with the 3.1 toolchain on WinXP64. I will file a compiler bug.