bug 6499691

From
Vova Uralsky (2:5030/1115.257)
To
Victor Sudakov
Date
2008-07-03T13:45:52Z
Area
RU.UNIX.SOLARIS
Document Audience:	SPECTRUM
Document ID:	6499691
Title:	Optimisation Issues with sun studio 10 on Solaris 10 x86_64
Copyright Notice:	Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved
Update Date:	Wed Apr 09 00:00:00 MDT 2008

Bug ID: 6499691

Synopsis: Optimisation Issues with sun studio 10 on Solaris 10 x86_64

Category: compiler

Subcategory: ube

State: 11-Closed

Description:

Oracle has provided following information:

OS Details :
SunOS stapi03 5.10 Generic_118844-08 i86pc i386 i86pc
Compiler :
cc: Sun C 5.7 Patch 117837-05 2005/07/19

Disassembly at   -xO3
==================================================
   delrow+0x1130:          4c 8b 8d 38 fb ff ff  movq   -0x4c8(%rbp),%r9
    delrow+0x1137:          41 0f b6 41 08     movzbl 0x8(%r9),%eax
    delrow+0x113c:          c1 e0 08           shll   $0x8,%eax
    delrow+0x113f:          41 0f b6 49 09     movzbl 0x9(%r9),%ecx
    delrow+0x1144:          03 c1              addl   %ecx,%eax
    delrow+0x1146:          66 41 89 40 20     movw   %ax,0x20(%r8)
    delrow+0x114b:          4d 8b 48 40        movq   0x40(%r8),%r9
    delrow+0x114f:          41 c6 01 01        movb   $0x1,(%r9) <--------------  SEGV occurs here
    delrow+0x1153:          41 8a 40 17        movb   0x17(%r8),%al
    delrow+0x1157:          4d 8b 48 40        movq   0x40(%r8),%r9
    delrow+0x115b:          41 88 41 01        movb   %al,0x1(%r9)
    delrow+0x115f:          41 8a 40 16        movb   0x16(%r8),%al
    delrow+0x1163:          4d 8b 48 40        movq   0x40(%r8),%r9
============================================

Disassembly at   -xO1
=====================================================
   delrow+0x1385:          4c 8b 85 f8 fb ff ff  movq   -0x408(%rbp),%r8
    delrow+0x138c:          41 0f b6 40 08     movzbl 0x8(%r8),%eax
    delrow+0x1391:          c1 e0 08           shll   $0x8,%eax
    delrow+0x1394:          41 0f b6 48 09     movzbl 0x9(%r8),%ecx
    delrow+0x1399:          03 c1              addl   %ecx,%eax
    delrow+0x139b:          4c 8b 85 58 fb ff ff  movq   -0x4a8(%rbp),%r8
    delrow+0x13a2:          66 41 89 40 20     movw   %ax,0x20(%r8)
    delrow+0x13a7:          4c 8b 85 58 fb ff ff  movq   -0x4a8(%rbp),%r8
    delrow+0x13ae:          4d 8b 40 40        movq   0x40(%r8),%r8
    delrow+0x13b2:          41 c6 00 01        movb   $0x1,(%r8)
    delrow+0x13b6:          4c 8b 85 58 fb ff ff  movq   -0x4a8(%rbp),%r8
    delrow+0x13bd:          41 8a 40 17        movb   0x17(%r8),%al
    delrow+0x13c1:          4d 8b 40 40        movq   0x40(%r8),%r8
    delrow+0x13c5:          41 88 40 01        movb   %al,0x1(%r8)
    delrow+0x13c9:          4c 8b 85 58 fb ff ff  movq   -0x4a8(%rbp),%r8
   ==============================================

    Date Modified: 2006-12-01 14:08:01 GMT+00:00


OS Details :
SunOS stapi03 5.10 Generic_118844-08 i86pc i386 i86pc
Compiler :
cc: Sun C 5.7 Patch 117837-05 2005/07/19

Disassembly at   -xO3
==================================================
   delrow+0x1130:          4c 8b 8d 38 fb ff ff  movq   -0x4c8(%rbp),%r9
    delrow+0x1137:          41 0f b6 41 08     movzbl 0x8(%r9),%eax
    delrow+0x113c:          c1 e0 08           shll   $0x8,%eax
    delrow+0x113f:          41 0f b6 49 09     movzbl 0x9(%r9),%ecx
    delrow+0x1144:          03 c1              addl   %ecx,%eax
    delrow+0x1146:          66 41 89 40 20     movw   %ax,0x20(%r8)
    delrow+0x114b:          4d 8b 48 40        movq   0x40(%r8),%r9
    delrow+0x114f:          41 c6 01 01        movb   $0x1,(%r9) <--------------  SEGV occurs here
    delrow+0x1153:          41 8a 40 17        movb   0x17(%r8),%al
    delrow+0x1157:          4d 8b 48 40        movq   0x40(%r8),%r9
    delrow+0x115b:          41 88 41 01        movb   %al,0x1(%r9)
    delrow+0x115f:          41 8a 40 16        movb   0x16(%r8),%al
    delrow+0x1163:          4d 8b 48 40        movq   0x40(%r8),%r9
============================================

Disassembly at   -xO1
=====================================================
   delrow+0x1385:          4c 8b 85 f8 fb ff ff  movq   -0x408(%rbp),%r8
    delrow+0x138c:          41 0f b6 40 08     movzbl 0x8(%r8),%eax
    delrow+0x1391:          c1 e0 08           shll   $0x8,%eax
    delrow+0x1394:          41 0f b6 48 09     movzbl 0x9(%r8),%ecx
    delrow+0x1399:          03 c1              addl   %ecx,%eax
    delrow+0x139b:          4c 8b 85 58 fb ff ff  movq   -0x4a8(%rbp),%r8
    delrow+0x13a2:          66 41 89 40 20     movw   %ax,0x20(%r8)
    delrow+0x13a7:          4c 8b 85 58 fb ff ff  movq   -0x4a8(%rbp),%r8
    delrow+0x13ae:          4d 8b 40 40        movq   0x40(%r8),%r8
    delrow+0x13b2:          41 c6 00 01        movb   $0x1,(%r8)
    delrow+0x13b6:          4c 8b 85 58 fb ff ff  movq   -0x4a8(%rbp),%r8
    delrow+0x13bd:          41 8a 40 17        movb   0x17(%r8),%al
    delrow+0x13c1:          4d 8b 40 40        movq   0x40(%r8),%r8
    delrow+0x13c5:          41 88 40 01        movb   %al,0x1(%r8)
    delrow+0x13c9:          4c 8b 85 58 fb ff ff  movq   -0x4a8(%rbp),%r8
   ==============================================

    Date Modified: 2006-12-01 14:08:01 GMT+00:00


The guilty part of preprocessed source is located at line 349061:
( * ( ( ( ( oerdef * ) oer ) -> oerrdd . rdd_kpdRdd ) ) = 1 )

//   The definition was:
//	oerdef       *oer =  pgaoer_ ;   // line: 348905

But considering the assembler of delrow function everything looks ok:
..CGE1.38707:
        movq       pgaoer_@GOTPCREL(%rip),%r8
        movq       (%r8),%r8
..CGE2.38708:
        movq       %r8,-56(%rbp)
.....
        movq       -56(%rbp),%r8
.....
..CG173.38853:
        movq       64(%r8),%r9
        movb       $1,(%r9)

So there can be two possibilities - ether problem is in memory corruption in delrow (which can be located in debugger) or the problem was before calling of delrow. I need to see the call stack at the moment of segv.

    Date Modified: 2007-04-17 18:57:11 GMT+00:00


Work Around:

Use
-Wd,-noiropt
in compile line as workaround.

    Date Modified: 2007-11-27 17:04:09 GMT+00:00


Suggested Fix:

Evaluation:

Fixed by patch:

Integrated in Build:

Duplicate of:

Related Change Request(s):

Date Modified: 2008-04-09 20:51:53 GMT+00:00

Public Summary:
Victor Sudakov -> All wrote:
 VS> From: Victor Sudakov <vas@mpeks.tomsk.su>

 VS> Коллеги,

 VS> Доступа на SunSolve у меня нет. Не поможет ли кто узнать,
 VS> bug 6499691 имеет место на Solaris 10 8/07 s10x_u4wos_12b X86?
 VS> И если имеет, какой патч нужно, чтобы баг исправить?

 VS> Заранее спасибо.


--- Mozilla Thunderbird 1.0.8 (X11/20060417)
 * Origin:  (2:5030/1115.257)
SEEN-BY: 46/50 236/100 450/186 1024 451/30 452/25 461/1313 463/68 469/142
SEEN-BY: 550/196 5000/5000 5001/100 5001 5003/34 5004/58 5011/13 5012/30 46
SEEN-BY: 5015/28 5019/40 5020/175 400 545 715 758 760 830 1042 1604 1641 2238
SEEN-BY: 5020/4441 5021/29 44 5022/128 5023/11 5025/3 750 9595 5026/45 5028/61
SEEN-BY: 5029/60 5030/7 55 61 97 115 172 251 254 266 338 452 468 580 585 738
SEEN-BY: 5030/786 845 901 918 920 966 1014 1023 1115 1256 1340 1763 1900 1957
SEEN-BY: 5035/38 5038/9 5045/7 5052/4 5054/1 4 8 9 28 37 5058/1 42 5061/26 120
SEEN-BY: 5062/10 5064/7 5070/156 5071/22 166 5080/68 80 111 1003 5082/6 5083/1
SEEN-BY: 5085/13 87 5093/33 5095/20 5096/18 5098/11 6001/10 6055/2 6083/11 12
PATH: 5030/1115 115 5080/1003 5020/4441 545 5054/1 37