Re: performance regression with trunk's gengtype on ARM?

2011-08-29 Thread Mikael Pettersson
Mikael Pettersson writes:
 > I'm seeing what appears to be a recent massive performance regression
 > with trunk's gengtype, as compiled and run in stage 2, on ARM V5TE.
 > 
 > Right now 4.7-20110827's stage2 gengtype has been running for almost
 > 10 hours on my ARM build machine, but the process is tiny and no swapping
 > occurs.  To put those 10 hours in perspective, on this machine (1.6 GHz
 > ARM V5TE uniprocessor running Linux) I regularly do full bootstraps and
 > regression test suite runs for c,c++,ada,fortran in about 18 hours for
 > gcc 4.4, about 20 hours for gcc 4.5, about 24 hours for gcc 4.6, and
 > about 27 hours for trunk until recently.  So 10 hours or more just in
 > stage 2 gengtype is suspicious.
 > 
 > I believe 4.7-20110820 also was unusually slow to build, but I didn't
 > monitor that build very carefully so can't say if gengtype was involved
 > then too.

It's now been running for almost 21 hours, with no output produced at all.
According to strace it's currently not doing any syscalls, and according
to gdb it's looping in yylex().  I suspect a miscompilation.

Anyway I'm killing that build now.  I have a pile of stable branch
backports to test, after that I might try a regression hunt on trunk.


Re: ARM Linux EABI: unwinding through a segfault handler

2011-08-29 Thread Ken Werner

On 08/25/2011 02:26 PM, Andrew Haley wrote:

Throwing an exception through a segfault handler doesn't always work
on ARM: the attached example fails on current gcc trunk.

panda-9:~ $ g++ segv.cc -fnon-call-exceptions -g
panda-9:~ $ ./a.out
terminate called after throwing an instance of 'FoobarException*'
Aborted

The bug is that _Unwind_GetIPInfo doesn't correctly set ip_before_insn.
Instead, it always sets it to zero; it should be set to 1 if this
is a frame created by a signal handler:


#define _Unwind_GetIPInfo(context, ip_before_insn) \
   (*ip_before_insn = 0, _Unwind_GetGR (context, 15)&  ~(_Unwind_Word)1)


Fixing this on ARM is hard because signal frames aren't specially
marked as they are on systems that use DWARF unwinder data.  I have
a patch that works on systems where the signal restorer is exactly

 mov r7, $SYS_rt_sigreturn
 swi 0x0

It works as a proof of concept, but it's fugly.

So, suggestions welcome.  Is there a nice way to detect a signal frame?


Libunwind also reads the IP to detect signal frames on ARM Linux:
http://git.savannah.gnu.org/gitweb/?p=libunwind.git;a=blob;f=src/arm/Gis_signal_frame.c;hb=HEAD

I'd also be interested if there are better approaches to detect them. :)

Regards
Ken


Re: ARM summit at Plumbers 2011

2011-08-29 Thread Jeff Law
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 08/28/11 22:02, Jon Masters wrote:
> On Tue, 2011-08-23 at 17:11 +0100, Steve McIntyre wrote:
> 
>> UPDATE: we've not had many people confirm interest in this event
>> yet, which is a shame. If you would like to join us for this
>> session, please reply and let me know. If we don't get enough
>> interest by the end of Sunday (28th August), then we'll have to
>> cancel the meeting.
> 
> I'm obviously confirming, but I'll repeat that for the record. My 
> interests here include helping to lead up Fedora's ARMv7 efforts,
> but also wider ARM platform standardization (boot, device
> enumeration, multi-arch, ABI, kernel consolidation, and many other
> things).
> 
> If there's at least representation from a few of the distros (as it 
> seems is the case at this point) then I think it's worthwhile having
> the formal slots. Nothing is lost in so doing. In any case, many
> discussions will take place if we have the opportunity to do so.
I've certain got an interest in hashing out ARM relative issues from a
tools standpoint.  So count me in.

jeff

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJOW7VaAAoJEBRtltQi2kC74u8IAIJi+BTmyxbyg8fnYm+lMjq5
K0CKMTpOcDCjZjEOcRx5YrTgOZsEwJKpngvqI82zzbz9vK6Gdw+0HydygaBSZSF7
wBJGv6mmKrP2/ZUts3c68cQDSoNisfeEEZk2MVCrHqm1RZAWW2vynb8zSBr589kV
f7WNEDNTZJwvam7DEZa4/ZAhPUfKxTwREl0H0ZK+miiW47vJtrQiZ6C9KJtFcgLN
Kqo5Jlmtdn2Jmv5s0LXSABtfwRtULqRnTICzZIE8440T4RVDbDI7Sc4jOIy6d31C
YQcKWOjXD9eYzYkOqeJfbLX5bLlOyjfbqfi8lA+jZbTVldjthOGAsmNR5E2h25Q=
=mnMM
-END PGP SIGNATURE-


Re: ARM Linux EABI: unwinding through a segfault handler

2011-08-29 Thread Daniel Jacobowitz
On Mon, Aug 29, 2011 at 11:18 AM, Ken Werner  wrote:
> On 08/25/2011 02:26 PM, Andrew Haley wrote:
>>
>> Throwing an exception through a segfault handler doesn't always work
>> on ARM: the attached example fails on current gcc trunk.
>>
>> panda-9:~ $ g++ segv.cc -fnon-call-exceptions -g
>> panda-9:~ $ ./a.out
>> terminate called after throwing an instance of 'FoobarException*'
>> Aborted
>>
>> The bug is that _Unwind_GetIPInfo doesn't correctly set ip_before_insn.
>> Instead, it always sets it to zero; it should be set to 1 if this
>> is a frame created by a signal handler:
>>
>>
>> #define _Unwind_GetIPInfo(context, ip_before_insn) \
>>   (*ip_before_insn = 0, _Unwind_GetGR (context, 15)&  ~(_Unwind_Word)1)
>>
>>
>> Fixing this on ARM is hard because signal frames aren't specially
>> marked as they are on systems that use DWARF unwinder data.  I have
>> a patch that works on systems where the signal restorer is exactly
>>
>>         mov     r7, $SYS_rt_sigreturn
>>         swi     0x0
>>
>> It works as a proof of concept, but it's fugly.
>>
>> So, suggestions welcome.  Is there a nice way to detect a signal frame?
>
> Libunwind also reads the IP to detect signal frames on ARM Linux:
> http://git.savannah.gnu.org/gitweb/?p=libunwind.git;a=blob;f=src/arm/Gis_signal_frame.c;hb=HEAD
>
> I'd also be interested if there are better approaches to detect them. :)

There aren't better ways - this is pretty much the standard for
on-stack signal frames :-)

I thought we used a handler in GLIBC that was properly annotated,
nowadays, but I might be mistaken.

-- 
Thanks,
Daniel


What command does dg-test generate?

2011-08-29 Thread Lawrence Crowl
Inside a C++ .exp file, I want to know the compiler command that
would be executed for a given dg-test command.  That is, given

set dg-do-what-default compile
dg-test -keep-output $source "$options -I." ""

what is a command that I can execute to compile the source file
without dejagnu trying to interpret it as a test?

It might be sufficient if I just knew the path to the compiler.

Any ideas?

-- 
Lawrence Crowl


Re: What command does dg-test generate?

2011-08-29 Thread Ian Lance Taylor
Lawrence Crowl  writes:

> Inside a C++ .exp file, I want to know the compiler command that
> would be executed for a given dg-test command.  That is, given
>
> set dg-do-what-default compile
> dg-test -keep-output $source "$options -I." ""
>
> what is a command that I can execute to compile the source file
> without dejagnu trying to interpret it as a test?
>
> It might be sufficient if I just knew the path to the compiler.
>
> Any ideas?

Welcome to DejaGNU, a horrible program which should be removed from
reality and sent to spend a thousand lifetimes as a servant to the elder
gods.  The cruel ones.

That said, you can try something along the lines of

  global target_triplet
  set comp_output [g++_target_compile "source.c" "source.o" "object" ""]
  set comp_output [g++-dg-prune $target_triplet $comp_output]
  if [string match "" $comp_output] {
# Success!
  } else {
# failure
verbose -log $comp_output
  }

Ian