public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/50299] New: entryval: bigendian 32bit->64bit extension breaks address match
@ 2011-09-05 18:13 jan.kratochvil at redhat dot com
  2011-09-05 18:33 ` [Bug debug/50299] " jakub at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: jan.kratochvil at redhat dot com @ 2011-09-05 18:13 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50299

             Bug #: 50299
           Summary: entryval: bigendian 32bit->64bit extension breaks
                    address match
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: jan.kratochvil@redhat.com
                CC: jakub@gcc.gnu.org
            Target: s390x-rhel62-linux-gnu


archer-jankratochvil-entryval:
f (r1=r1@entry=1, r2=r2@entry=2, r3=r3@entry=3, r4=r4@entry=4, r5=r5@entry=5,
s1=11) at 1.c:5
5    }
(gdb) p s1@entry
Cannot find matching parameter at DW_TAG_GNU_call_site 0x80000516 at main

static void __attribute__ ((noinline, noclone))
f (int r1, int r2, int r3, int r4, int r5, int s1)
{
  asm volatile ("" ::: "memory");
}
int
main (void)
{
  f (1, 2, 3, 4, 5, 11);
  return 0;
}

-Wall -g -O2
gcc (GCC) 4.7.0 20110805 (experimental)

In main() it is 8 bytes at %r15+160 but in f() it is 4 bytes at %r15+164.
160 != 164 and GDB cannot know how many bytes it is in main(), there is no
parameter width anywhere there.


    80000502:   e3 10 f0 a0 00 24    stg     %r1,160(%r15)
    80000510:   c0 e5 ff ff ff ea    brasl   %r14,800004e4 <f>
 <2><c3>: Abbrev Number: 6 (DW_TAG_GNU_call_site)
    <c4>   DW_AT_low_pc      : 0x80000516
    <cc>   DW_AT_abstract_origin: <0x31>
 <3><ea>: Abbrev Number: 7 (DW_TAG_GNU_call_site_parameter)
    <eb>   DW_AT_location    : 3 byte block: 7f a0 1    (DW_OP_breg15 (r15):
160)
    <ef>   DW_AT_GNU_call_site_value: 1 byte block: 3b  (DW_OP_lit11)
 <2><8c>: Abbrev Number: 3 (DW_TAG_formal_parameter)
    <8d>   DW_AT_name        : s1
    <92>   DW_AT_type        : <0x9a>
    <96>   DW_AT_location    : 2 byte block: 91 4    (DW_OP_fbreg: 4)
 <1><9a>: Abbrev Number: 4 (DW_TAG_base_type)
    <9b>   DW_AT_byte_size   : 4
    <9d>   DW_AT_name        : int
 <1><31>: Abbrev Number: 2 (DW_TAG_subprogram)
    <32>   DW_AT_name        : f
    <47>   DW_AT_frame_base  : 3 byte block: 7f a0 1    (DW_OP_breg15 (r15):
160)


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug debug/50299] entryval: bigendian 32bit->64bit extension breaks address match
  2011-09-05 18:13 [Bug debug/50299] New: entryval: bigendian 32bit->64bit extension breaks address match jan.kratochvil at redhat dot com
@ 2011-09-05 18:33 ` jakub at gcc dot gnu.org
  2011-09-06 11:22 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-09-05 18:33 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50299

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2011-09-05
         AssignedTo|unassigned at gcc dot       |jakub at gcc dot gnu.org
                   |gnu.org                     |
     Ever Confirmed|0                           |1

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-09-05 18:33:38 UTC ---
Created attachment 25200
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25200
gcc47-pr50299.patch

Untested fix.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug debug/50299] entryval: bigendian 32bit->64bit extension breaks address match
  2011-09-05 18:13 [Bug debug/50299] New: entryval: bigendian 32bit->64bit extension breaks address match jan.kratochvil at redhat dot com
  2011-09-05 18:33 ` [Bug debug/50299] " jakub at gcc dot gnu.org
@ 2011-09-06 11:22 ` jakub at gcc dot gnu.org
  2011-09-07 11:07 ` jan.kratochvil at redhat dot com
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-09-06 11:22 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50299

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-09-06 11:21:19 UTC ---
The disadvantage of the patch is that it will no longer emit
DW_TAG_call_site_parameter e.g. in
struct S { long a, b; };
void baz (void);

__attribute__((noinline, noclone))
int foo (struct S s)
{
  long a = s.a;
  long b = s.b;
  baz ();
  return 2;
}

int bar (void)
{
  struct S s = { 1, 2 };
  foo (s);
  return 0;
}

on x86_64-linux for %rdi and %rsi registers as it used to before (i.e. for
multi-register arguments).
Would gdb be actually trying to use it?  At least here DW_OP_GNU_entry_value
isn't emitted because RTL DSE doesn't adjust the debug insns.
I guess I could just use the reg's mode for use_regs to restore this.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug debug/50299] entryval: bigendian 32bit->64bit extension breaks address match
  2011-09-05 18:13 [Bug debug/50299] New: entryval: bigendian 32bit->64bit extension breaks address match jan.kratochvil at redhat dot com
  2011-09-05 18:33 ` [Bug debug/50299] " jakub at gcc dot gnu.org
  2011-09-06 11:22 ` jakub at gcc dot gnu.org
@ 2011-09-07 11:07 ` jan.kratochvil at redhat dot com
  2011-09-12 16:18 ` jakub at gcc dot gnu.org
  2011-09-12 16:39 ` jakub at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: jan.kratochvil at redhat dot com @ 2011-09-07 11:07 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50299

--- Comment #3 from Jan Kratochvil <jan.kratochvil at redhat dot com> 2011-09-07 10:57:36 UTC ---
 <2><7d>: Abbrev Number: 6 (DW_TAG_formal_parameter)
    <7e>   DW_AT_name        : s
    <86>   DW_AT_location    : 2 byte block: 91 60      (DW_OP_fbreg: -32)
vs.
  24:   bf 01 00 00 00          mov    $0x1,%edi
  29:   be 02 00 00 00        mov    $0x2,%esi
  2e:   e8 00 00 00 00          callq  33 <bar+0x13>

I do not see debug info supported even for normal values, therefore it is
irrelevant to discuss the entry values.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug debug/50299] entryval: bigendian 32bit->64bit extension breaks address match
  2011-09-05 18:13 [Bug debug/50299] New: entryval: bigendian 32bit->64bit extension breaks address match jan.kratochvil at redhat dot com
                   ` (2 preceding siblings ...)
  2011-09-07 11:07 ` jan.kratochvil at redhat dot com
@ 2011-09-12 16:18 ` jakub at gcc dot gnu.org
  2011-09-12 16:39 ` jakub at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-09-12 16:18 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50299

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-09-12 15:49:43 UTC ---
Author: jakub
Date: Mon Sep 12 15:49:38 2011
New Revision: 178784

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=178784
Log:
    PR debug/50299
    * calls.c (load_register_parameters): Use use_reg_mode instead
    of use_reg when adding a single register CALL_INSN_FUNCTION_USAGE
    entry.
    (expand_call): Set EXPR_LIST mode to TYPE_MODE of the argument
    for stack CALL_INSN_FUNCTION_USAGE uses.
    * expr.h (use_reg_mode): New prototype.
    (use_reg): Changed into inline around use_reg_mode.
    * expr.c (use_reg): Renamed to...
    (use_reg_mode): ... this.  Added MODE argument, set EXPR_LIST
    mode to that mode instead of VOIDmode.
    * var-tracking.c (prepare_call_arguments): Don't track parameters
    whose EXPR_LIST mode is VOIDmode, BLKmode or X mode isn't convertible
    to it using lowpart_subreg.  Convert VALUE and REG/MEM to the
    EXPR_LIST mode.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/calls.c
    trunk/gcc/expr.c
    trunk/gcc/expr.h
    trunk/gcc/var-tracking.c


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug debug/50299] entryval: bigendian 32bit->64bit extension breaks address match
  2011-09-05 18:13 [Bug debug/50299] New: entryval: bigendian 32bit->64bit extension breaks address match jan.kratochvil at redhat dot com
                   ` (3 preceding siblings ...)
  2011-09-12 16:18 ` jakub at gcc dot gnu.org
@ 2011-09-12 16:39 ` jakub at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-09-12 16:39 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50299

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-09-12 16:18:08 UTC ---
Fixed.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-09-12 16:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-05 18:13 [Bug debug/50299] New: entryval: bigendian 32bit->64bit extension breaks address match jan.kratochvil at redhat dot com
2011-09-05 18:33 ` [Bug debug/50299] " jakub at gcc dot gnu.org
2011-09-06 11:22 ` jakub at gcc dot gnu.org
2011-09-07 11:07 ` jan.kratochvil at redhat dot com
2011-09-12 16:18 ` jakub at gcc dot gnu.org
2011-09-12 16:39 ` jakub at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).