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
06-21-2012, 11:54 AM
James McCoy
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
*/
/* 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;
/* 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);
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;
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;
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;
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
*/
/* 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;
/* 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);
/* 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>
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