Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Tigran Aivazian <tigran@veritas.com>
To: Daniel Jacobowitz <drow@false.org>
Cc: gdb@sources.redhat.com
Subject: Re: gdb problems with -O1 on x86_64 architecture.
Date: Tue, 10 May 2005 14:32:00 -0000	[thread overview]
Message-ID: <Pine.LNX.4.61.0505101530180.3789@ezer.homenet> (raw)
In-Reply-To: <Pine.LNX.4.61.0505091745180.4562@ezer.homenet>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1688 bytes --]

Hi,

I thought it is worth showing how it behaves on -O2 compiled binary as 
well:

# gcc -g -Wall -O2 -fno-optimize-sibling-calls uvar.c -o uvar-O2

(gdb) b kt_func3
Breakpoint 1 at 0x4004e0: file uvar.c, line 11.
(gdb) r
Starting program: /root/mod/uvar-O2

Breakpoint 1, kt_func3 (x1=0x11111133, x2=0x22222244, x3=0x33333355, 
x4=0x44444466, x5=0x55555577, x6=0x66666688,
     x7=0x77777799, x8=0x888888aa, x9=0x9566b560) at uvar.c:11
11              return (x1 + x2 + x3/2 + x4/4 + x5/5 + x6/6 + x7/7 + x8/8 
+ x9/9);
(gdb) bt
#0  kt_func3 (x1=0x11111133, x2=0x22222244, x3=0x33333355, x4=0x44444466, 
x5=0x55555577, x6=0x66666688, x7=0x77777799,
     x8=0x888888aa, x9=0x9566b560) at uvar.c:11
#1  0x00000000004005d3 in kt_func2 (x1=<value optimized out>, x2=<value 
optimized out>, x3=<value optimized out>,
     x4=<value optimized out>, x5=<value optimized out>, x6=<value 
optimized out>, x7=0x77777788, x8=0x88888899,
     x9=0x999999aa) at uvar.c:16
#2  0x0000000000400623 in kt_func1 (x1=<value optimized out>, x2=<value 
optimized out>, x3=<value optimized out>,
     x4=<value optimized out>, x5=<value optimized out>, x6=<value 
optimized out>, x7=0x77777777, x8=0x88888888,
     x9=0x99999999) at uvar.c:22
#3  0x000000000040067a in main (argc=<value optimized out>, argv=<value 
optimized out>) at uvar.c:30

As you see, it claims that x1,x2,x3,x4,x5,x6 are optimized out and 
x7,x8,x9 are available and shows the correct values. This is for kt_func2 
and kt_func1 functions, but for kt_func3 it shows all values correctly 
except the last one --- x9 is garbage. But with -O0 it shows everything 
correctly.

I attached the -O2 compiled uvar as well.

Kind regards
Tigran

[-- Attachment #2: uvar-O2 --]
[-- Type: APPLICATION/octet-stream, Size: 15978 bytes --]

  reply	other threads:[~2005-05-10 14:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-09 16:17 Tigran Aivazian
2005-05-09 16:39 ` Daniel Jacobowitz
2005-05-09 16:47   ` Tigran Aivazian
2005-05-10 14:32     ` Tigran Aivazian [this message]
2005-05-10 14:45       ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.61.0505101530180.3789@ezer.homenet \
    --to=tigran@veritas.com \
    --cc=drow@false.org \
    --cc=gdb@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox