public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/59821] __builtin_LINE and __builtin_FILE for new'd objects is wrong
       [not found] <bug-59821-4@http.gcc.gnu.org/bugzilla/>
@ 2014-01-15 11:47 ` rguenth at gcc dot gnu.org
  2014-01-16 17:06 ` jason at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-01-15 11:47 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-debug
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-01-15
     Ever confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
    [t.C : 12:3] Foo::Foo ([t.C : 12] &D.2242, 12);
    [t.C : 12:42] try
      {
        [t.C : 12:3] D.2247 = D.2242.line;
        [t.C : 12:3] D.2244 = 5;
        [t.C : 12:3] D.2243 = operator new (4);
        [t.C : 12:3] try
          {
            [t.C : 12:3] Foo::Foo (D.2243, D.2244);

looks like location info is broken for the new case.


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

* [Bug c++/59821] __builtin_LINE and __builtin_FILE for new'd objects is wrong
       [not found] <bug-59821-4@http.gcc.gnu.org/bugzilla/>
  2014-01-15 11:47 ` [Bug c++/59821] __builtin_LINE and __builtin_FILE for new'd objects is wrong rguenth at gcc dot gnu.org
@ 2014-01-16 17:06 ` jason at gcc dot gnu.org
  2014-01-16 17:10 ` jakub at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu.org @ 2014-01-16 17:06 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |aldyh at gcc dot gnu.org

--- Comment #3 from Jason Merrill <jason at gcc dot gnu.org> ---
I think gimplify_arg clobbering a valid EXPR_LOCATION is wrong; both cases
should give the location of the default argument definition.

Aldy, what was the rationale for that change (r140917)?


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

* [Bug c++/59821] __builtin_LINE and __builtin_FILE for new'd objects is wrong
       [not found] <bug-59821-4@http.gcc.gnu.org/bugzilla/>
  2014-01-15 11:47 ` [Bug c++/59821] __builtin_LINE and __builtin_FILE for new'd objects is wrong rguenth at gcc dot gnu.org
  2014-01-16 17:06 ` jason at gcc dot gnu.org
@ 2014-01-16 17:10 ` jakub at gcc dot gnu.org
  2014-01-16 18:02 ` aldyh at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-01-16 17:10 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
While I agree with that, for _builtin_{LINE,FILE,FUNCTION} (), those were added
specifically for the use in default arguments and were I think from the start
meant to give you the location of the call, not of the token where it appears,
otherwise those builtins don't make much sense (you could use __LINE__,
__FILE__
or __FUNCTION__ instead).


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

* [Bug c++/59821] __builtin_LINE and __builtin_FILE for new'd objects is wrong
       [not found] <bug-59821-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2014-01-16 17:10 ` jakub at gcc dot gnu.org
@ 2014-01-16 18:02 ` aldyh at gcc dot gnu.org
  2014-01-16 18:41 ` jason at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: aldyh at gcc dot gnu.org @ 2014-01-16 18:02 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Aldy Hernandez <aldyh at gcc dot gnu.org> ---
(In reply to Jason Merrill from comment #3)
> I think gimplify_arg clobbering a valid EXPR_LOCATION is wrong; both cases
> should give the location of the default argument definition.
> 
> Aldy, what was the rationale for that change (r140917)?

Unfortunately this was by design to make multi-line non-trivial arguments play
nice with the debugger.  Perhaps it's time to revisit the ``is_stmt'' DWARF
flag for this?

More details here:

http://gcc.gnu.org/ml/gcc-patches/2008-10/msg00191.html


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

* [Bug c++/59821] __builtin_LINE and __builtin_FILE for new'd objects is wrong
       [not found] <bug-59821-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2014-01-16 18:02 ` aldyh at gcc dot gnu.org
@ 2014-01-16 18:41 ` jason at gcc dot gnu.org
  2014-01-16 19:55 ` jason at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu.org @ 2014-01-16 18:41 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |jason at gcc dot gnu.org


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

* [Bug c++/59821] __builtin_LINE and __builtin_FILE for new'd objects is wrong
       [not found] <bug-59821-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2014-01-16 18:41 ` jason at gcc dot gnu.org
@ 2014-01-16 19:55 ` jason at gcc dot gnu.org
  2014-01-16 19:57 ` jason at gcc dot gnu.org
  2014-01-17 12:41 ` rguenth at gcc dot gnu.org
  7 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu.org @ 2014-01-16 19:55 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Thu Jan 16 19:55:12 2014
New Revision: 206686

URL: http://gcc.gnu.org/viewcvs?rev=206686&root=gcc&view=rev
Log:
    PR c++/59821
    * tree.c (bot_manip): Update the location of builtin_LINE and
    builtin_FILE calls.

Added:
    trunk/gcc/testsuite/g++.dg/ext/builtin-line1.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/tree.c
    trunk/gcc/doc/extend.texi


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

* [Bug c++/59821] __builtin_LINE and __builtin_FILE for new'd objects is wrong
       [not found] <bug-59821-4@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2014-01-16 19:55 ` jason at gcc dot gnu.org
@ 2014-01-16 19:57 ` jason at gcc dot gnu.org
  2014-01-17 12:41 ` rguenth at gcc dot gnu.org
  7 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu.org @ 2014-01-16 19:57 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |4.9.0

--- Comment #8 from Jason Merrill <jason at gcc dot gnu.org> ---
Fixed for 4.9.


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

* [Bug c++/59821] __builtin_LINE and __builtin_FILE for new'd objects is wrong
       [not found] <bug-59821-4@http.gcc.gnu.org/bugzilla/>
                   ` (6 preceding siblings ...)
  2014-01-16 19:57 ` jason at gcc dot gnu.org
@ 2014-01-17 12:41 ` rguenth at gcc dot gnu.org
  7 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-01-17 12:41 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Richard Biener <rguenth at gcc dot gnu.org> ---
Yeah - sorry for this.  As it "worked" for the testcases I tested I was
assuming
that the locations for the default argument computation (!) stmts should be
that of the call, not that of the definition.  Appearantly that isn't so.

Thanks for fixing it.


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

end of thread, other threads:[~2014-01-17 12:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-59821-4@http.gcc.gnu.org/bugzilla/>
2014-01-15 11:47 ` [Bug c++/59821] __builtin_LINE and __builtin_FILE for new'd objects is wrong rguenth at gcc dot gnu.org
2014-01-16 17:06 ` jason at gcc dot gnu.org
2014-01-16 17:10 ` jakub at gcc dot gnu.org
2014-01-16 18:02 ` aldyh at gcc dot gnu.org
2014-01-16 18:41 ` jason at gcc dot gnu.org
2014-01-16 19:55 ` jason at gcc dot gnu.org
2014-01-16 19:57 ` jason at gcc dot gnu.org
2014-01-17 12:41 ` rguenth 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).