FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian GCC

 
 
LinkBack Thread Tools
 
Old 06-21-2012, 05:59 AM
Philipp Marek
 
Default Bug#678122: output difference?

Just out of curiosity, could you show the disassembler output of the
OutputWrite() function for gcc-4.6, and gcc-4.7 with -O1 and -O2?

# objdump -Sgd <name-of-obj-file>

and pasting only this function might be a good way.


Regards,

Phil



--
To UNSUBSCRIBE, email to debian-gcc-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 201206210759.06948.philipp.marek@linbit.com">http://lists.debian.org/201206210759.06948.philipp.marek@linbit.com
 
Old 06-21-2012, 11:54 AM
James McCoy
 
Default Bug#678122: output difference?

On Thu, Jun 21, 2012 at 07:59:06AM +0200, Philipp Marek wrote:
> Just out of curiosity, could you show the disassembler output of the
> OutputWrite() function for gcc-4.6, and gcc-4.7 with -O1 and -O2?
>
> # objdump -Sgd <name-of-obj-file>
>
> and pasting only this function might be a good way.

Sure, attached files for those combinations.

Cheers,
--
James
GPG Key: 4096R/331BA3DB 2011-12-05 James McCoy <jamessan@debian.org>
0000000000001b2a <OutputWrite>:
/* Output buffer management
*/

static PyObject *
OutputWrite(PyObject *self, PyObject *args)
{
1b2a: 55 push %rbp
1b2b: 53 push %rbx
1b2c: 48 83 ec 18 sub $0x18,%rsp
1b30: 48 89 f0 mov %rsi,%rax
int len;
char *str = NULL;
1b33: 48 c7 04 24 00 00 00 movq $0x0,(%rsp)
1b3a: 00
int error = ((OutputObject *)(self))->error;
1b3b: 8b 5f 18 mov 0x18(%rdi),%ebx

if (!PyArg_ParseTuple(args, "et#", ENC_OPT, &str, &len))
1b3e: 4c 8d 44 24 0c lea 0xc(%rsp),%r8
1b43: 48 89 e1 mov %rsp,%rcx
1b46: 48 8b 15 00 00 00 00 mov 0x0(%rip),%rdx # 1b4d <OutputWrite+0x23>
1b4d: be 00 00 00 00 mov $0x0,%esi
1b52: 48 89 c7 mov %rax,%rdi
1b55: b8 00 00 00 00 mov $0x0,%eax
1b5a: e8 00 00 00 00 callq 1b5f <OutputWrite+0x35>
1b5f: 85 c0 test %eax,%eax
1b61: 74 4d je 1bb0 <OutputWrite+0x86>
return NULL;

/* TODO: This works around a gcc optimizer problem and avoids Vim
* from crashing. Should find a real solution. */
if (str == NULL)
1b63: 48 83 3c 24 00 cmpq $0x0,(%rsp)
1b68: 74 4d je 1bb7 <OutputWrite+0x8d>
return NULL;

Py_BEGIN_ALLOW_THREADS
1b6a: e8 00 00 00 00 callq 1b6f <OutputWrite+0x45>
1b6f: 48 89 c5 mov %rax,%rbp
Python_Lock_Vim();
writer((writefn)(error ? emsg : msg), (char_u *)str, len);
1b72: 48 63 54 24 0c movslq 0xc(%rsp),%rdx
1b77: 85 db test %ebx,%ebx
1b79: b8 00 00 00 00 mov $0x0,%eax
1b7e: bf 00 00 00 00 mov $0x0,%edi
1b83: 48 0f 45 f8 cmovne %rax,%rdi
1b87: 48 8b 34 24 mov (%rsp),%rsi
1b8b: e8 e2 fc ff ff callq 1872 <writer>
Python_Release_Vim();
Py_END_ALLOW_THREADS
1b90: 48 89 ef mov %rbp,%rdi
1b93: e8 00 00 00 00 callq 1b98 <OutputWrite+0x6e>
PyMem_Free(str);
1b98: 48 8b 3c 24 mov (%rsp),%rdi
1b9c: e8 00 00 00 00 callq 1ba1 <OutputWrite+0x77>

Py_INCREF(Py_None);
1ba1: 48 83 05 00 00 00 00 addq $0x1,0x0(%rip) # 1ba9 <OutputWrite+0x7f>
1ba8: 01
return Py_None;
1ba9: b8 00 00 00 00 mov $0x0,%eax
1bae: eb 0c jmp 1bbc <OutputWrite+0x92>
int len;
char *str = NULL;
int error = ((OutputObject *)(self))->error;

if (!PyArg_ParseTuple(args, "et#", ENC_OPT, &str, &len))
return NULL;
1bb0: b8 00 00 00 00 mov $0x0,%eax
1bb5: eb 05 jmp 1bbc <OutputWrite+0x92>

/* TODO: This works around a gcc optimizer problem and avoids Vim
* from crashing. Should find a real solution. */
if (str == NULL)
return NULL;
1bb7: b8 00 00 00 00 mov $0x0,%eax
Py_END_ALLOW_THREADS
PyMem_Free(str);

Py_INCREF(Py_None);
return Py_None;
}
1bbc: 48 83 c4 18 add $0x18,%rsp
1bc0: 5b pop %rbx
1bc1: 5d pop %rbp
1bc2: c3 retq
0000000000000500 <OutputWrite>:
/* Output buffer management
*/

static PyObject *
OutputWrite(PyObject *self, PyObject *args)
{
500: 55 push %rbp
501: 48 89 f0 mov %rsi,%rax
int len;
char *str = NULL;
int error = ((OutputObject *)(self))->error;

if (!PyArg_ParseTuple(args, "et#", ENC_OPT, &str, &len))
504: be 00 00 00 00 mov $0x0,%esi
/* Output buffer management
*/

static PyObject *
OutputWrite(PyObject *self, PyObject *args)
{
509: 53 push %rbx
50a: 48 83 ec 18 sub $0x18,%rsp
int len;
char *str = NULL;
int error = ((OutputObject *)(self))->error;

if (!PyArg_ParseTuple(args, "et#", ENC_OPT, &str, &len))
50e: 48 8b 15 00 00 00 00 mov 0x0(%rip),%rdx # 515 <OutputWrite+0x15>
static PyObject *
OutputWrite(PyObject *self, PyObject *args)
{
int len;
char *str = NULL;
int error = ((OutputObject *)(self))->error;
515: 8b 5f 18 mov 0x18(%rdi),%ebx

if (!PyArg_ParseTuple(args, "et#", ENC_OPT, &str, &len))
518: 4c 8d 44 24 04 lea 0x4(%rsp),%r8
51d: 48 8d 4c 24 08 lea 0x8(%rsp),%rcx
522: 48 89 c7 mov %rax,%rdi
525: 31 c0 xor %eax,%eax

static PyObject *
OutputWrite(PyObject *self, PyObject *args)
{
int len;
char *str = NULL;
527: 48 c7 44 24 08 00 00 movq $0x0,0x8(%rsp)
52e: 00 00
int error = ((OutputObject *)(self))->error;

if (!PyArg_ParseTuple(args, "et#", ENC_OPT, &str, &len))
530: e8 00 00 00 00 callq 535 <OutputWrite+0x35>
535: 85 c0 test %eax,%eax
537: 74 57 je 590 <OutputWrite+0x90>
return NULL;

/* TODO: This works around a gcc optimizer problem and avoids Vim
* from crashing. Should find a real solution. */
if (str == NULL)
539: 48 83 7c 24 08 00 cmpq $0x0,0x8(%rsp)
53f: 74 4f je 590 <OutputWrite+0x90>
return NULL;

Py_BEGIN_ALLOW_THREADS
541: e8 00 00 00 00 callq 546 <OutputWrite+0x46>
Python_Lock_Vim();
writer((writefn)(error ? emsg : msg), (char_u *)str, len);
546: 48 63 54 24 04 movslq 0x4(%rsp),%rdx
54b: 48 8b 74 24 08 mov 0x8(%rsp),%rsi
550: 85 db test %ebx,%ebx
/* TODO: This works around a gcc optimizer problem and avoids Vim
* from crashing. Should find a real solution. */
if (str == NULL)
return NULL;

Py_BEGIN_ALLOW_THREADS
552: 48 89 c5 mov %rax,%rbp
Python_Lock_Vim();
writer((writefn)(error ? emsg : msg), (char_u *)str, len);
555: bf 00 00 00 00 mov $0x0,%edi
55a: b8 00 00 00 00 mov $0x0,%eax
55f: 48 0f 44 f8 cmove %rax,%rdi
563: e8 28 fd ff ff callq 290 <writer>
Python_Release_Vim();
Py_END_ALLOW_THREADS
568: 48 89 ef mov %rbp,%rdi
56b: e8 00 00 00 00 callq 570 <OutputWrite+0x70>
PyMem_Free(str);
570: 48 8b 7c 24 08 mov 0x8(%rsp),%rdi
575: e8 00 00 00 00 callq 57a <OutputWrite+0x7a>

Py_INCREF(Py_None);
57a: 48 83 05 00 00 00 00 addq $0x1,0x0(%rip) # 582 <OutputWrite+0x82>
581: 01
return Py_None;
}
582: 48 83 c4 18 add $0x18,%rsp
Python_Release_Vim();
Py_END_ALLOW_THREADS
PyMem_Free(str);

Py_INCREF(Py_None);
return Py_None;
586: b8 00 00 00 00 mov $0x0,%eax
}
58b: 5b pop %rbx
58c: 5d pop %rbp
58d: c3 retq
58e: 66 90 xchg %ax,%ax
590: 48 83 c4 18 add $0x18,%rsp
int len;
char *str = NULL;
int error = ((OutputObject *)(self))->error;

if (!PyArg_ParseTuple(args, "et#", ENC_OPT, &str, &len))
return NULL;
594: 31 c0 xor %eax,%eax
Py_END_ALLOW_THREADS
PyMem_Free(str);

Py_INCREF(Py_None);
return Py_None;
}
596: 5b pop %rbx
597: 5d pop %rbp
598: c3 retq
599: 0f 1f 80 00 00 00 00 nopl 0x0(%rax)
0000000000001ade <OutputWrite>:
/* Output buffer management
*/

static PyObject *
OutputWrite(PyObject *self, PyObject *args)
{
1ade: 55 push %rbp
1adf: 53 push %rbx
1ae0: 48 83 ec 18 sub $0x18,%rsp
1ae4: 48 89 f0 mov %rsi,%rax
int len;
char *str = NULL;
1ae7: 48 c7 04 24 00 00 00 movq $0x0,(%rsp)
1aee: 00
int error = ((OutputObject *)(self))->error;
1aef: 48 8b 5f 18 mov 0x18(%rdi),%rbx

if (!PyArg_ParseTuple(args, "et#", ENC_OPT, &str, &len))
1af3: 4c 8d 44 24 0c lea 0xc(%rsp),%r8
1af8: 48 89 e1 mov %rsp,%rcx
1afb: 48 8b 15 00 00 00 00 mov 0x0(%rip),%rdx # 1b02 <OutputWrite+0x24>
1b02: be 00 00 00 00 mov $0x0,%esi
1b07: 48 89 c7 mov %rax,%rdi
1b0a: b8 00 00 00 00 mov $0x0,%eax
1b0f: e8 00 00 00 00 callq 1b14 <OutputWrite+0x36>
return NULL;
1b14: ba 00 00 00 00 mov $0x0,%edx
{
int len;
char *str = NULL;
int error = ((OutputObject *)(self))->error;

if (!PyArg_ParseTuple(args, "et#", ENC_OPT, &str, &len))
1b19: 85 c0 test %eax,%eax
1b1b: 74 4b je 1b68 <OutputWrite+0x8a>
return NULL;

/* TODO: This works around a gcc optimizer problem and avoids Vim
* from crashing. Should find a real solution. */
if (str == NULL)
1b1d: 48 83 3c 24 00 cmpq $0x0,(%rsp)
1b22: 74 44 je 1b68 <OutputWrite+0x8a>
return NULL;

Py_BEGIN_ALLOW_THREADS
1b24: e8 00 00 00 00 callq 1b29 <OutputWrite+0x4b>
1b29: 48 89 c5 mov %rax,%rbp
Python_Lock_Vim();
writer((writefn)(error ? emsg : msg), (char_u *)str, len);
1b2c: 48 63 54 24 0c movslq 0xc(%rsp),%rdx
1b31: 85 db test %ebx,%ebx
1b33: b8 00 00 00 00 mov $0x0,%eax
1b38: bf 00 00 00 00 mov $0x0,%edi
1b3d: 48 0f 45 f8 cmovne %rax,%rdi
1b41: 48 8b 34 24 mov (%rsp),%rsi
1b45: e8 d9 fc ff ff callq 1823 <writer>
Python_Release_Vim();
Py_END_ALLOW_THREADS
1b4a: 48 89 ef mov %rbp,%rdi
1b4d: e8 00 00 00 00 callq 1b52 <OutputWrite+0x74>
PyMem_Free(str);
1b52: 48 8b 3c 24 mov (%rsp),%rdi
1b56: e8 00 00 00 00 callq 1b5b <OutputWrite+0x7d>

Py_INCREF(Py_None);
1b5b: 48 83 05 00 00 00 00 addq $0x1,0x0(%rip) # 1b63 <OutputWrite+0x85>
1b62: 01
return Py_None;
1b63: ba 00 00 00 00 mov $0x0,%edx
}
1b68: 48 89 d0 mov %rdx,%rax
1b6b: 48 83 c4 18 add $0x18,%rsp
1b6f: 5b pop %rbx
1b70: 5d pop %rbp
1b71: c3 retq
00000000000005d0 <OutputWrite>:
/* Output buffer management
*/

static PyObject *
OutputWrite(PyObject *self, PyObject *args)
{
5d0: 55 push %rbp
5d1: 48 89 f0 mov %rsi,%rax
int len;
char *str = NULL;
int error = ((OutputObject *)(self))->error;

if (!PyArg_ParseTuple(args, "et#", ENC_OPT, &str, &len))
5d4: be 00 00 00 00 mov $0x0,%esi
/* Output buffer management
*/

static PyObject *
OutputWrite(PyObject *self, PyObject *args)
{
5d9: 53 push %rbx
5da: 48 83 ec 18 sub $0x18,%rsp
int len;
char *str = NULL;
int error = ((OutputObject *)(self))->error;

if (!PyArg_ParseTuple(args, "et#", ENC_OPT, &str, &len))
5de: 48 8b 15 00 00 00 00 mov 0x0(%rip),%rdx # 5e5 <OutputWrite+0x15>
static PyObject *
OutputWrite(PyObject *self, PyObject *args)
{
int len;
char *str = NULL;
int error = ((OutputObject *)(self))->error;
5e5: 48 8b 5f 18 mov 0x18(%rdi),%rbx

if (!PyArg_ParseTuple(args, "et#", ENC_OPT, &str, &len))
5e9: 4c 8d 44 24 0c lea 0xc(%rsp),%r8
5ee: 48 89 c7 mov %rax,%rdi
5f1: 48 89 e1 mov %rsp,%rcx
5f4: 31 c0 xor %eax,%eax

static PyObject *
OutputWrite(PyObject *self, PyObject *args)
{
int len;
char *str = NULL;
5f6: 48 c7 04 24 00 00 00 movq $0x0,(%rsp)
5fd: 00
int error = ((OutputObject *)(self))->error;

if (!PyArg_ParseTuple(args, "et#", ENC_OPT, &str, &len))
5fe: e8 00 00 00 00 callq 603 <OutputWrite+0x33>
return NULL;
603: 31 d2 xor %edx,%edx
{
int len;
char *str = NULL;
int error = ((OutputObject *)(self))->error;

if (!PyArg_ParseTuple(args, "et#", ENC_OPT, &str, &len))
605: 85 c0 test %eax,%eax
607: 74 4b je 654 <OutputWrite+0x84>
return NULL;

/* TODO: This works around a gcc optimizer problem and avoids Vim
* from crashing. Should find a real solution. */
if (str == NULL)
609: 48 83 3c 24 00 cmpq $0x0,(%rsp)
60e: 74 44 je 654 <OutputWrite+0x84>
return NULL;

Py_BEGIN_ALLOW_THREADS
610: e8 00 00 00 00 callq 615 <OutputWrite+0x45>
Python_Lock_Vim();
writer((writefn)(error ? emsg : msg), (char_u *)str, len);
615: 48 63 54 24 0c movslq 0xc(%rsp),%rdx
61a: 48 8b 34 24 mov (%rsp),%rsi
61e: 85 db test %ebx,%ebx
/* TODO: This works around a gcc optimizer problem and avoids Vim
* from crashing. Should find a real solution. */
if (str == NULL)
return NULL;

Py_BEGIN_ALLOW_THREADS
620: 48 89 c5 mov %rax,%rbp
Python_Lock_Vim();
writer((writefn)(error ? emsg : msg), (char_u *)str, len);
623: bf 00 00 00 00 mov $0x0,%edi
628: b8 00 00 00 00 mov $0x0,%eax
62d: 48 0f 44 f8 cmove %rax,%rdi
631: e8 da fc ff ff callq 310 <writer>
Python_Release_Vim();
Py_END_ALLOW_THREADS
636: 48 89 ef mov %rbp,%rdi
639: e8 00 00 00 00 callq 63e <OutputWrite+0x6e>
PyMem_Free(str);
63e: 48 8b 3c 24 mov (%rsp),%rdi
642: e8 00 00 00 00 callq 647 <OutputWrite+0x77>

Py_INCREF(Py_None);
647: 48 83 05 00 00 00 00 addq $0x1,0x0(%rip) # 64f <OutputWrite+0x7f>
64e: 01
return Py_None;
64f: ba 00 00 00 00 mov $0x0,%edx
}
654: 48 83 c4 18 add $0x18,%rsp
658: 48 89 d0 mov %rdx,%rax
65b: 5b pop %rbx
65c: 5d pop %rbp
65d: c3 retq
65e: 66 90 xchg %ax,%ax
 
Old 06-22-2012, 01:58 AM
James McCoy
 
Default Bug#678122: output difference?

On Thu, Jun 21, 2012 at 07:54:35AM -0400, James McCoy wrote:
> On Thu, Jun 21, 2012 at 07:59:06AM +0200, Philipp Marek wrote:
> > Just out of curiosity, could you show the disassembler output of the
> > OutputWrite() function for gcc-4.6, and gcc-4.7 with -O1 and -O2?
> >
> > # objdump -Sgd <name-of-obj-file>
> >
> > and pasting only this function might be a good way.
>
> Sure, attached files for those combinations.

Another potentially useful data point is that adding -fstack-protector causes
-O1 to no longer work. I noticed this while trying to prepare an upload of
Vim which works around the optimization problem. With -fstack-protector, I
have to drop down to -O0 to get the code to work.

--
James
GPG Key: 4096R/331BA3DB 2011-12-05 James McCoy <jamessan@debian.org>
0000000000001b2a <OutputWrite>:
/* Output buffer management
*/

static PyObject *
OutputWrite(PyObject *self, PyObject *args)
{
1b2a: 55 push %rbp
1b2b: 53 push %rbx
1b2c: 48 83 ec 18 sub $0x18,%rsp
1b30: 48 89 f0 mov %rsi,%rax
int len;
char *str = NULL;
1b33: 48 c7 44 24 08 00 00 movq $0x0,0x8(%rsp)
1b3a: 00 00
int error = ((OutputObject *)(self))->error;
1b3c: 8b 5f 18 mov 0x18(%rdi),%ebx

if (!PyArg_ParseTuple(args, "et#", ENC_OPT, &str, &len))
1b3f: 4c 8d 44 24 04 lea 0x4(%rsp),%r8
1b44: 48 8d 4c 24 08 lea 0x8(%rsp),%rcx
1b49: 48 8b 15 00 00 00 00 mov 0x0(%rip),%rdx # 1b50 <OutputWrite+0x26>
1b50: be 00 00 00 00 mov $0x0,%esi
1b55: 48 89 c7 mov %rax,%rdi
1b58: b8 00 00 00 00 mov $0x0,%eax
1b5d: e8 00 00 00 00 callq 1b62 <OutputWrite+0x38>
1b62: 85 c0 test %eax,%eax
1b64: 74 50 je 1bb6 <OutputWrite+0x8c>
return NULL;

/* TODO: This works around a gcc optimizer problem and avoids Vim
* from crashing. Should find a real solution. */
if (str == NULL)
1b66: 48 83 7c 24 08 00 cmpq $0x0,0x8(%rsp)
1b6c: 74 4f je 1bbd <OutputWrite+0x93>
return NULL;

Py_BEGIN_ALLOW_THREADS
1b6e: e8 00 00 00 00 callq 1b73 <OutputWrite+0x49>
1b73: 48 89 c5 mov %rax,%rbp
Python_Lock_Vim();
writer((writefn)(error ? emsg : msg), (char_u *)str, len);
1b76: 48 63 54 24 04 movslq 0x4(%rsp),%rdx
1b7b: 85 db test %ebx,%ebx
1b7d: b8 00 00 00 00 mov $0x0,%eax
1b82: bf 00 00 00 00 mov $0x0,%edi
1b87: 48 0f 45 f8 cmovne %rax,%rdi
1b8b: 48 8b 74 24 08 mov 0x8(%rsp),%rsi
1b90: e8 dd fc ff ff callq 1872 <writer>
Python_Release_Vim();
Py_END_ALLOW_THREADS
1b95: 48 89 ef mov %rbp,%rdi
1b98: e8 00 00 00 00 callq 1b9d <OutputWrite+0x73>
PyMem_Free(str);
1b9d: 48 8b 7c 24 08 mov 0x8(%rsp),%rdi
1ba2: e8 00 00 00 00 callq 1ba7 <OutputWrite+0x7d>

Py_INCREF(Py_None);
1ba7: 48 83 05 00 00 00 00 addq $0x1,0x0(%rip) # 1baf <OutputWrite+0x85>
1bae: 01
return Py_None;
1baf: b8 00 00 00 00 mov $0x0,%eax
1bb4: eb 0c jmp 1bc2 <OutputWrite+0x98>
int len;
char *str = NULL;
int error = ((OutputObject *)(self))->error;

if (!PyArg_ParseTuple(args, "et#", ENC_OPT, &str, &len))
return NULL;
1bb6: b8 00 00 00 00 mov $0x0,%eax
1bbb: eb 05 jmp 1bc2 <OutputWrite+0x98>

/* TODO: This works around a gcc optimizer problem and avoids Vim
* from crashing. Should find a real solution. */
if (str == NULL)
return NULL;
1bbd: b8 00 00 00 00 mov $0x0,%eax
Py_END_ALLOW_THREADS
PyMem_Free(str);

Py_INCREF(Py_None);
return Py_None;
}
1bc2: 48 83 c4 18 add $0x18,%rsp
1bc6: 5b pop %rbx
1bc7: 5d pop %rbp
1bc8: c3 retq
000000000000000c <OutputWrite>:
/* Output buffer management
*/

static PyObject *
OutputWrite(PyObject *self, PyObject *args)
{
c: 55 push %rbp
d: 48 89 e5 mov %rsp,%rbp
10: 48 83 ec 30 sub $0x30,%rsp
14: 48 89 7d d8 mov %rdi,-0x28(%rbp)
18: 48 89 75 d0 mov %rsi,-0x30(%rbp)
int len;
char *str = NULL;
1c: 48 c7 45 f0 00 00 00 movq $0x0,-0x10(%rbp)
23: 00
int error = ((OutputObject *)(self))->error;
24: 48 8b 45 d8 mov -0x28(%rbp),%rax
28: 48 8b 40 18 mov 0x18(%rax),%rax
2c: 89 45 ec mov %eax,-0x14(%rbp)

if (!PyArg_ParseTuple(args, "et#", ENC_OPT, &str, &len))
2f: 48 8b 15 00 00 00 00 mov 0x0(%rip),%rdx # 36 <OutputWrite+0x2a>
36: 48 8d 75 e8 lea -0x18(%rbp),%rsi
3a: 48 8d 4d f0 lea -0x10(%rbp),%rcx
3e: 48 8b 45 d0 mov -0x30(%rbp),%rax
42: 49 89 f0 mov %rsi,%r8
45: be 00 00 00 00 mov $0x0,%esi
4a: 48 89 c7 mov %rax,%rdi
4d: b8 00 00 00 00 mov $0x0,%eax
52: e8 00 00 00 00 callq 57 <OutputWrite+0x4b>
57: 85 c0 test %eax,%eax
59: 75 07 jne 62 <OutputWrite+0x56>
return NULL;
5b: b8 00 00 00 00 mov $0x0,%eax
60: eb 79 jmp db <OutputWrite+0xcf>

/* TODO: This works around a gcc optimizer problem and avoids Vim
* from crashing. Should find a real solution. */
if (str == NULL)
62: 48 8b 45 f0 mov -0x10(%rbp),%rax
66: 48 85 c0 test %rax,%rax
69: 75 07 jne 72 <OutputWrite+0x66>
return NULL;
6b: b8 00 00 00 00 mov $0x0,%eax
70: eb 69 jmp db <OutputWrite+0xcf>

Py_BEGIN_ALLOW_THREADS
72: e8 00 00 00 00 callq 77 <OutputWrite+0x6b>
77: 48 89 45 f8 mov %rax,-0x8(%rbp)
Python_Lock_Vim();
7b: e8 80 ff ff ff callq 0 <Python_Lock_Vim>
writer((writefn)(error ? emsg : msg), (char_u *)str, len);
80: 8b 45 e8 mov -0x18(%rbp),%eax
83: 48 63 d0 movslq %eax,%rdx
86: 48 8b 4d f0 mov -0x10(%rbp),%rcx
8a: 83 7d ec 00 cmpl $0x0,-0x14(%rbp)
8e: 74 07 je 97 <OutputWrite+0x8b>
90: b8 00 00 00 00 mov $0x0,%eax
95: eb 05 jmp 9c <OutputWrite+0x90>
97: b8 00 00 00 00 mov $0x0,%eax
9c: 48 89 ce mov %rcx,%rsi
9f: 48 89 c7 mov %rax,%rdi
a2: e8 ca 02 00 00 callq 371 <writer>
Python_Release_Vim();
a7: e8 5a ff ff ff callq 6 <Python_Release_Vim>
Py_END_ALLOW_THREADS
ac: 48 8b 45 f8 mov -0x8(%rbp),%rax
b0: 48 89 c7 mov %rax,%rdi
b3: e8 00 00 00 00 callq b8 <OutputWrite+0xac>
PyMem_Free(str);
b8: 48 8b 45 f0 mov -0x10(%rbp),%rax
bc: 48 89 c7 mov %rax,%rdi
bf: e8 00 00 00 00 callq c4 <OutputWrite+0xb8>

Py_INCREF(Py_None);
c4: 48 8b 05 00 00 00 00 mov 0x0(%rip),%rax # cb <OutputWrite+0xbf>
cb: 48 83 c0 01 add $0x1,%rax
cf: 48 89 05 00 00 00 00 mov %rax,0x0(%rip) # d6 <OutputWrite+0xca>
return Py_None;
d6: b8 00 00 00 00 mov $0x0,%eax
}
db: c9 leaveq
dc: c3 retq
 
Old 06-23-2012, 10:39 AM
Matthias Klose
 
Default Bug#678122: output difference?

On 22.06.2012 03:58, James McCoy wrote:
> On Thu, Jun 21, 2012 at 07:54:35AM -0400, James McCoy wrote:
>> On Thu, Jun 21, 2012 at 07:59:06AM +0200, Philipp Marek wrote:
>>> Just out of curiosity, could you show the disassembler output of the
>>> OutputWrite() function for gcc-4.6, and gcc-4.7 with -O1 and -O2?
>>>
>>> # objdump -Sgd <name-of-obj-file>
>>>
>>> and pasting only this function might be a good way.
>>
>> Sure, attached files for those combinations.
>
> Another potentially useful data point is that adding -fstack-protector
> causes -O1 to no longer work. I noticed this while trying to prepare an
> upload of Vim which works around the optimization problem. With
> -fstack-protector, I have to drop down to -O0 to get the code to work.

Kees, Moritz, please could you have a look?



--
To UNSUBSCRIBE, email to debian-gcc-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 4FE59CFA.4010100@debian.org">http://lists.debian.org/4FE59CFA.4010100@debian.org
 

Thread Tools




All times are GMT. The time now is 06:44 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org