* Re: aarch64 gdb failures in testsuite
@ 2017-07-25 19:45 Steve Ellcey
2017-07-25 22:13 ` Andrew Pinski
0 siblings, 1 reply; 5+ messages in thread
From: Steve Ellcey @ 2017-07-25 19:45 UTC (permalink / raw)
To: gdb
Following up to my own mail at
ttps://sourceware.org/ml/gdb/2017-07/msg00037.html
It looks like the problem is with the GCC compiler. If I use
GCC 4.8.4 to run the gdb.base/store.c test case it works,
if I use GCC 5.4.0 it does not. I actually get around 50 or
more gdb failures when I use GCC 5.4.0 rather than GCC 4.8.0.
I believe that this may be due to aarch64 changing over from
reload to lra during this timeframe.
I have also found that the test case works if I remove the
register keywords from the test. Apparently the register
keyword is ignored when optimizing but not at -O0.
Steve Ellcey
sellcey@cavium.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: aarch64 gdb failures in testsuite
2017-07-25 19:45 aarch64 gdb failures in testsuite Steve Ellcey
@ 2017-07-25 22:13 ` Andrew Pinski
2017-07-25 22:26 ` Steve Ellcey
0 siblings, 1 reply; 5+ messages in thread
From: Andrew Pinski @ 2017-07-25 22:13 UTC (permalink / raw)
To: sellcey; +Cc: GDB Development
On Tue, Jul 25, 2017 at 12:45 PM, Steve Ellcey <sellcey@cavium.com> wrote:
>
> Following up to my own mail at
> ttps://sourceware.org/ml/gdb/2017-07/msg00037.html
>
> It looks like the problem is with the GCC compiler. If I use
> GCC 4.8.4 to run the gdb.base/store.c test case it works,
> if I use GCC 5.4.0 it does not. I actually get around 50 or
> more gdb failures when I use GCC 5.4.0 rather than GCC 4.8.0.
> I believe that this may be due to aarch64 changing over from
> reload to lra during this timeframe.
>
> I have also found that the test case works if I remove the
> register keywords from the test. Apparently the register
> keyword is ignored when optimizing but not at -O0.
function.c:
/* Return true if we should assign DECL a pseudo register; false if it
should live on the local stack. */
bool
use_register_for_decl (const_tree decl)
{
....
if (optimize)
return true;
if (!DECL_REGISTER (decl))
return false;
/* When not optimizing, disregard register keyword for types that
could have methods, otherwise the methods won't be callable from
the debugger. */
if (RECORD_OR_UNION_TYPE_P (TREE_TYPE (decl)))
return false;
return true;
}
--------- CUT ------
This code has been that way since 2009 (r144939) but that function
returned true for DECL_REGISTER before that.
Thanks,
Andrew Pinski
>
> Steve Ellcey
> sellcey@cavium.com
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: aarch64 gdb failures in testsuite
2017-07-25 22:13 ` Andrew Pinski
@ 2017-07-25 22:26 ` Steve Ellcey
2017-07-26 17:51 ` Steve Ellcey
0 siblings, 1 reply; 5+ messages in thread
From: Steve Ellcey @ 2017-07-25 22:26 UTC (permalink / raw)
To: Andrew Pinski; +Cc: GDB Development
On Tue, 2017-07-25 at 15:13 -0700, Andrew Pinski wrote:
>Â
> function.c:
> /* Return true if we should assign DECL a pseudo register; false if it
>    should live on the local stack.  */
>
> bool
> use_register_for_decl (const_tree decl)
> {
>
Yes, I just tried tweaking that function to return false when not
optimizing, even if the decl has DECL_REGISTER set.  If fixed
gdb.base/store.exp but not much else. Â The other things that did
not fail after the change were:
FAIL: gdb.base/step-over-syscall.exp: clone: displaced=off: single step over clone
FAIL: gdb.base/watchpoint.exp: next over global_ptr_ptr buffer set
FAIL: gdb.base/watchpoint.exp: next over global_ptr_ptr init
FAIL: gdb.base/watchpoint.exp: next over global_ptr_ptr pointer advance
And I don't actually see why those would change behaviour, I didn't see
any register variables in those tests  I could submit a patch to GCC
with this change but it seems like a rather large hammer to use on a
few fixes. Â Maybe changing gdb.base/store.exp to not use register
variables would be a reasonable fix. Â Originally, I thought that was a
bad idea because I thought the problem affected more tests, now I am
not so sure.
Steve Ellcey
sellcey@cavium.com
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: aarch64 gdb failures in testsuite
2017-07-25 22:26 ` Steve Ellcey
@ 2017-07-26 17:51 ` Steve Ellcey
0 siblings, 0 replies; 5+ messages in thread
From: Steve Ellcey @ 2017-07-26 17:51 UTC (permalink / raw)
To: Andrew Pinski; +Cc: GDB Development
On Tue, 2017-07-25 at 15:26 -0700, Steve Ellcey wrote:
>Â
> And I don't actually see why those would change behaviour, I didn't see
> any register variables in those tests  I could submit a patch to GCC
> with this change but it seems like a rather large hammer to use on a
> few fixes. Â Maybe changing gdb.base/store.exp to not use register
> variables would be a reasonable fix. Â Originally, I thought that was
> a
> bad idea because I thought the problem affected more tests, now I am
> not so sure.
>
> Steve Ellcey
> sellcey@cavium.com
FYI: I submitted a bug against gcc that gdb.base/store.exp does not
work with GCC 5.4.0 (or later) but was working with GCC 4.8.0.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81562
Steve Ellcey
sellcey@cavium.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* aarch64 gdb failures in testsuite
@ 2017-07-25 17:16 Steve Ellcey
0 siblings, 0 replies; 5+ messages in thread
From: Steve Ellcey @ 2017-07-25 17:16 UTC (permalink / raw)
To: gdb
I am getting some aarch64 gdb failures that do not seem to be showing up
in other peoples test runs from the gdb-testers mailing list and I was
wondering if anyone could help me figure out why these tests are failing
for me.
As an example, here is gdb.base/store.exp. In my test case I am
getting this failuire:
Temporary breakpoint 9, wack_doublest (u=-1, v=-2) at /home/sellcey/gdb-std/src/binutils-gdb/gdb/testsuite/gdb.base/store.c:125
125 register doublest l = u, r = v;
(gdb) next
126 l = add_doublest (l, r);
(gdb) PASS: gdb.base/store.exp: continue to wack_doublest
print l
$29 = -1
(gdb) PASS: gdb.base/store.exp: var doublest l; print old l, expecting -1
print r
$30 = <optimized out>
(gdb) FAIL: gdb.base/store.exp: var doublest l; print old r, expecting -2
set variable l = 4
But when I look at https://sourceware.org/ml/gdb-testers/2017-q3/msg01016.html
and look at the gdb.log file I see it passes there:
Temporary breakpoint 9, wack_doublest (u=-1, v=-2) at /home/qiyao/buildbot/ubuntu-aarch64-m64/build/gdb/testsuite/../../../binutils-gdb/gdb/testsuite/gdb.base/store.c:125
125 register doublest l = u, r = v;
(gdb) next
126 l = add_doublest (l, r);
(gdb) PASS: gdb.base/store.exp: continue to wack_doublest
print l
$29 = -1
(gdb) PASS: gdb.base/store.exp: var doublest l; print old l, expecting -1
print r
$30 = -2
(gdb) PASS: gdb.base/store.exp: var doublest l; print old r, expecting -2
set variable l = 4
In looking for differences in the runs I see the passing test uses GCC 4.8.4
and I am using GCC 5.4.0 (Ubuntu 16.04). I don't think that should make
a difference but maybe it does.
I looked at the compiler options since for something to be <optimized out>
I assume we would have to be compiling with some optimization option but
both compilers are just using -g.
spawn -ignore SIGHUP gcc /home/sellcey/gdb-std/obj/binutils-gdb/gdb/testsuite/outputs/gdb.base/store/store0.o -g -lm -o /home/sellcey/gdb-std/obj/binutils-gdb/gdb/testsuite/outputs/gdb.base/store/store
I compiled the test case (gdb/testsuite/gdb.base/store.c) with -g using
the system GCC (5.4.0) and then ran the system GDB on it to see what
happened there and I get the same <optimized out> message there that I
do with the latest GDB sources.
% gcc -g store.c -o x
% gdb x
(gdb) b wack_doublest
Breakpoint 1 at 0x4008cc: file store.c, line 125.
(gdb) r
Starting program: /home/sellcey/gdb-std/x
Breakpoint 1, wack_doublest (u=-1, v=-2) at store.c:125
125 register doublest l = u, r = v;
(gdb) n
126 l = add_doublest (l, r);
(gdb) print l
$1 = -1
(gdb) print r
$2 = <optimized out>
Any ideas on what is happening here? Does anyone else get this failure?
Steve Ellcey
sellcey@cavium.com
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-07-26 17:51 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-25 19:45 aarch64 gdb failures in testsuite Steve Ellcey
2017-07-25 22:13 ` Andrew Pinski
2017-07-25 22:26 ` Steve Ellcey
2017-07-26 17:51 ` Steve Ellcey
-- strict thread matches above, loose matches on Subject: below --
2017-07-25 17:16 Steve Ellcey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox