public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/43942]  New: -fcompare-debug faulure
@ 2010-04-29 17:55 hjl dot tools at gmail dot com
  2010-04-29 17:57 ` [Bug debug/43942] " hjl dot tools at gmail dot com
                   ` (20 more replies)
  0 siblings, 21 replies; 22+ messages in thread
From: hjl dot tools at gmail dot com @ 2010-04-29 17:55 UTC (permalink / raw)
  To: gcc-bugs

>From PR 43936, -fcompare-debug failed with external declaration in function.


-- 
           Summary: -fcompare-debug faulure
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: hjl dot tools at gmail dot com


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


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

* [Bug debug/43942] -fcompare-debug faulure
  2010-04-29 17:55 [Bug debug/43942] New: -fcompare-debug faulure hjl dot tools at gmail dot com
@ 2010-04-29 17:57 ` hjl dot tools at gmail dot com
  2010-04-29 18:05 ` pinskia at gcc dot gnu dot org
                   ` (19 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: hjl dot tools at gmail dot com @ 2010-04-29 17:57 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from hjl dot tools at gmail dot com  2010-04-29 17:57 -------
Created an attachment (id=20518)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20518&action=view)
A testcase

On Linux/x86-64,

[hjl@gnu-6 stage2-gcc]$ ./xgcc -B./  -c  -g -O2 -Wc++-compat -fno-common
pr43942.i -fcompare-debug
xgcc: pr43942.i: -fcompare-debug failure (length)
[hjl@gnu-6 stage2-gcc]$ 


-- 


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


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

* [Bug debug/43942] -fcompare-debug faulure
  2010-04-29 17:55 [Bug debug/43942] New: -fcompare-debug faulure hjl dot tools at gmail dot com
  2010-04-29 17:57 ` [Bug debug/43942] " hjl dot tools at gmail dot com
@ 2010-04-29 18:05 ` pinskia at gcc dot gnu dot org
  2010-04-29 18:16 ` hjl dot tools at gmail dot com
                   ` (18 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2010-04-29 18:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2010-04-29 18:05 -------
Reducing.


-- 


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


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

* [Bug debug/43942] -fcompare-debug faulure
  2010-04-29 17:55 [Bug debug/43942] New: -fcompare-debug faulure hjl dot tools at gmail dot com
  2010-04-29 17:57 ` [Bug debug/43942] " hjl dot tools at gmail dot com
  2010-04-29 18:05 ` pinskia at gcc dot gnu dot org
@ 2010-04-29 18:16 ` hjl dot tools at gmail dot com
  2010-04-29 18:18 ` [Bug debug/43942] -fcompare-debug faulure with external declaration in function hjl dot tools at gmail dot com
                   ` (17 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: hjl dot tools at gmail dot com @ 2010-04-29 18:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from hjl dot tools at gmail dot com  2010-04-29 18:16 -------
[hjl@gnu-6 stage2-gcc]$ cat x.i
enum plugin_event { PLUGIN_GGC_START, PLUGIN_GGC_END };
extern int invoke_plugin_callbacks_full (int, void *);
static __inline__ int
invoke_plugin_callbacks (int event __attribute__ ((__unused__)),
    void *gcc_data __attribute__ ((__unused__)))
{
  extern unsigned char flag_plugin_added;
  if (flag_plugin_added)
    return invoke_plugin_callbacks_full (event, gcc_data);
  return 3;
}
void
ggc_collect (void)
{
  invoke_plugin_callbacks (PLUGIN_GGC_START, ((void *)0));
  invoke_plugin_callbacks (PLUGIN_GGC_END, ((void *)0));
}
[hjl@gnu-6 stage2-gcc]$ ./xgcc -B./  -c  -g -O2  x.i -fcompare-debug
xgcc: x.i: -fcompare-debug failure (length)
[hjl@gnu-6 stage2-gcc]$ 


-- 


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


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

* [Bug debug/43942] -fcompare-debug faulure with external declaration in function.
  2010-04-29 17:55 [Bug debug/43942] New: -fcompare-debug faulure hjl dot tools at gmail dot com
                   ` (2 preceding siblings ...)
  2010-04-29 18:16 ` hjl dot tools at gmail dot com
@ 2010-04-29 18:18 ` hjl dot tools at gmail dot com
  2010-04-29 18:23 ` hjl dot tools at gmail dot com
                   ` (16 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: hjl dot tools at gmail dot com @ 2010-04-29 18:18 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from hjl dot tools at gmail dot com  2010-04-29 18:18 -------
It also failed with gcc 4.5.0.


-- 

hjl dot tools at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |4.5.0 4.6.0
            Summary|-fcompare-debug faulure     |-fcompare-debug faulure with
                   |                            |external declaration in
                   |                            |function.


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


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

* [Bug debug/43942] -fcompare-debug faulure with external declaration in function.
  2010-04-29 17:55 [Bug debug/43942] New: -fcompare-debug faulure hjl dot tools at gmail dot com
                   ` (3 preceding siblings ...)
  2010-04-29 18:18 ` [Bug debug/43942] -fcompare-debug faulure with external declaration in function hjl dot tools at gmail dot com
@ 2010-04-29 18:23 ` hjl dot tools at gmail dot com
  2010-04-29 18:26 ` [Bug debug/43942] -fcompare-debug failure " hjl dot tools at gmail dot com
                   ` (15 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: hjl dot tools at gmail dot com @ 2010-04-29 18:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from hjl dot tools at gmail dot com  2010-04-29 18:23 -------
Tail call optimization is disabled with -g.


-- 


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


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

* [Bug debug/43942] -fcompare-debug failure with external declaration in function
  2010-04-29 17:55 [Bug debug/43942] New: -fcompare-debug faulure hjl dot tools at gmail dot com
                   ` (4 preceding siblings ...)
  2010-04-29 18:23 ` hjl dot tools at gmail dot com
@ 2010-04-29 18:26 ` hjl dot tools at gmail dot com
  2010-04-29 18:27 ` [Bug debug/43942] [4.5/4.6 Regression] -fcompare-debug faulure " pinskia at gcc dot gnu dot org
                   ` (14 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: hjl dot tools at gmail dot com @ 2010-04-29 18:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from hjl dot tools at gmail dot com  2010-04-29 18:26 -------
-foptimize-sibling-calls is affected by external declaration in function.


-- 

hjl dot tools at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|-fcompare-debug faulure with|-fcompare-debug failure with
                   |external declaration in     |external declaration in
                   |function.                   |function


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


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

* [Bug debug/43942] [4.5/4.6 Regression] -fcompare-debug faulure with external declaration in function.
  2010-04-29 17:55 [Bug debug/43942] New: -fcompare-debug faulure hjl dot tools at gmail dot com
                   ` (5 preceding siblings ...)
  2010-04-29 18:26 ` [Bug debug/43942] -fcompare-debug failure " hjl dot tools at gmail dot com
@ 2010-04-29 18:27 ` pinskia at gcc dot gnu dot org
  2010-04-29 18:45 ` hjl dot tools at gmail dot com
                   ` (13 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2010-04-29 18:27 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from pinskia at gcc dot gnu dot org  2010-04-29 18:27 -------
Even more reduced testcase:
invoke_plugin_callbacks (int event)
{
  extern unsigned char flag_plugin_added;
  return invoke_plugin_callbacks_full (event);
}
ggc_collect (void)
{
  invoke_plugin_callbacks (0);
}


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |build, wrong-code
   Last reconfirmed|0000-00-00 00:00:00         |2010-04-29 18:27:21
               date|                            |
            Summary|-fcompare-debug failure with|[4.5/4.6 Regression] -
                   |external declaration in     |fcompare-debug faulure with
                   |function                    |external declaration in
                   |                            |function.
   Target Milestone|---                         |4.5.1


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


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

* [Bug debug/43942] [4.5/4.6 Regression] -fcompare-debug faulure with external declaration in function.
  2010-04-29 17:55 [Bug debug/43942] New: -fcompare-debug faulure hjl dot tools at gmail dot com
                   ` (6 preceding siblings ...)
  2010-04-29 18:27 ` [Bug debug/43942] [4.5/4.6 Regression] -fcompare-debug faulure " pinskia at gcc dot gnu dot org
@ 2010-04-29 18:45 ` hjl dot tools at gmail dot com
  2010-04-29 19:17 ` hjl dot tools at gmail dot com
                   ` (12 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: hjl dot tools at gmail dot com @ 2010-04-29 18:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from hjl dot tools at gmail dot com  2010-04-29 18:44 -------
Tail call optimization doesn't handle

# DEBUG event => 0

properly.


-- 

hjl dot tools at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.5.1                       |---


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


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

* [Bug debug/43942] [4.5/4.6 Regression] -fcompare-debug faulure with external declaration in function.
  2010-04-29 17:55 [Bug debug/43942] New: -fcompare-debug faulure hjl dot tools at gmail dot com
                   ` (7 preceding siblings ...)
  2010-04-29 18:45 ` hjl dot tools at gmail dot com
@ 2010-04-29 19:17 ` hjl dot tools at gmail dot com
  2010-04-29 19:23 ` jakub at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: hjl dot tools at gmail dot com @ 2010-04-29 19:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from hjl dot tools at gmail dot com  2010-04-29 19:16 -------
This patch

---
diff --git a/gcc/tree.c b/gcc/tree.c
index 8eeecff..0d79020 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -7937,7 +7937,8 @@ auto_var_in_fn_p (const_tree var, const_tree fn)
 {
   return (DECL_P (var) && DECL_CONTEXT (var) == fn
     && (((TREE_CODE (var) == VAR_DECL || TREE_CODE (var) == PARM_DECL)
-         && ! TREE_STATIC (var))
+         && ! TREE_STATIC (var)
+         && ! TREE_PUBLIC (var))
         || TREE_CODE (var) == LABEL_DECL
         || TREE_CODE (var) == RESULT_DECL));
 }
---

works for me.


-- 


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


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

* [Bug debug/43942] [4.5/4.6 Regression] -fcompare-debug faulure with external declaration in function.
  2010-04-29 17:55 [Bug debug/43942] New: -fcompare-debug faulure hjl dot tools at gmail dot com
                   ` (8 preceding siblings ...)
  2010-04-29 19:17 ` hjl dot tools at gmail dot com
@ 2010-04-29 19:23 ` jakub at gcc dot gnu dot org
  2010-04-29 20:30 ` jakub at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-04-29 19:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from jakub at gcc dot gnu dot org  2010-04-29 19:23 -------
That doesn't sound like the right fix.

I'll look into this.


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jakub at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2010-04-29 18:27:21         |2010-04-29 19:23:46
               date|                            |


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


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

* [Bug debug/43942] [4.5/4.6 Regression] -fcompare-debug faulure with external declaration in function.
  2010-04-29 17:55 [Bug debug/43942] New: -fcompare-debug faulure hjl dot tools at gmail dot com
                   ` (9 preceding siblings ...)
  2010-04-29 19:23 ` jakub at gcc dot gnu dot org
@ 2010-04-29 20:30 ` jakub at gcc dot gnu dot org
  2010-04-29 20:41 ` jakub at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-04-29 20:30 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from jakub at gcc dot gnu dot org  2010-04-29 20:29 -------
So, the first difference that happens is that with -g the extern var is removed
from BLOCK_VARs, with -g it is kept there.  This happens in
remove_unused_scope_block_p.  Next during inlining in remap_decls
can_be_nonlocal decides the extern var can't be non-local (remapped_type for
int is NULL at that point - int hasn't been remapped yet, so it returns false).
This is something I don't understand at all - for variably_modified_type_p
(TREE_TYPE (decl), id->src_fn) perhaps it makes sense, but aren't all other
types just remapped to itself?
Thus, remap_decls decides to remap_decl it (in -g case only) and that actually
means the remapped var makes it into REFERENCED_VARS.

One question is whether auto_var_in_fn_p should return true or false for
DECL_EXTERNAL vars with DECL_CONTEXT being the FUNCTION_DECL.  Apparently in
many places in tree-inline.c this predicate is used to tell whether the decl
should be remapped.  So, either we need something like H.J.'s patch, but with
&& !DECL_EXTERNAL (var)  (for VAR_DECL only), or e.g. tree-tailcall.c should
add a && !DECL_EXTERNAL (var) or && !is_global_var (var) check.


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hubicka at gcc dot gnu dot
                   |                            |org


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


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

* [Bug debug/43942] [4.5/4.6 Regression] -fcompare-debug faulure with external declaration in function.
  2010-04-29 17:55 [Bug debug/43942] New: -fcompare-debug faulure hjl dot tools at gmail dot com
                   ` (10 preceding siblings ...)
  2010-04-29 20:30 ` jakub at gcc dot gnu dot org
@ 2010-04-29 20:41 ` jakub at gcc dot gnu dot org
  2010-04-29 20:45 ` jakub at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-04-29 20:41 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from jakub at gcc dot gnu dot org  2010-04-29 20:40 -------
Created an attachment (id=20519)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20519&action=view)
patch1

Patch for tree-tailcall.c, only useful if the second patch isn't used.


-- 


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


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

* [Bug debug/43942] [4.5/4.6 Regression] -fcompare-debug faulure with external declaration in function.
  2010-04-29 17:55 [Bug debug/43942] New: -fcompare-debug faulure hjl dot tools at gmail dot com
                   ` (11 preceding siblings ...)
  2010-04-29 20:41 ` jakub at gcc dot gnu dot org
@ 2010-04-29 20:45 ` jakub at gcc dot gnu dot org
  2010-04-29 20:46 ` jakub at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-04-29 20:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from jakub at gcc dot gnu dot org  2010-04-29 20:45 -------
Created an attachment (id=20520)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20520&action=view)
patch2

Alternative patch for auto_var_in_fn_p


-- 


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


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

* [Bug debug/43942] [4.5/4.6 Regression] -fcompare-debug faulure with external declaration in function.
  2010-04-29 17:55 [Bug debug/43942] New: -fcompare-debug faulure hjl dot tools at gmail dot com
                   ` (12 preceding siblings ...)
  2010-04-29 20:45 ` jakub at gcc dot gnu dot org
@ 2010-04-29 20:46 ` jakub at gcc dot gnu dot org
  2010-04-29 20:47 ` jakub at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-04-29 20:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #14 from jakub at gcc dot gnu dot org  2010-04-29 20:46 -------
Created an attachment (id=20521)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20521&action=view)
patch3

Patch to allow vars with non-vla types to be nonlocal if they weren't used and
their type hasn't been remapped yet.


-- 


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


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

* [Bug debug/43942] [4.5/4.6 Regression] -fcompare-debug faulure with external declaration in function.
  2010-04-29 17:55 [Bug debug/43942] New: -fcompare-debug faulure hjl dot tools at gmail dot com
                   ` (13 preceding siblings ...)
  2010-04-29 20:46 ` jakub at gcc dot gnu dot org
@ 2010-04-29 20:47 ` jakub at gcc dot gnu dot org
  2010-04-29 23:53 ` hjl dot tools at gmail dot com
                   ` (5 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-04-29 20:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #15 from jakub at gcc dot gnu dot org  2010-04-29 20:46 -------
All the patches so far completely untested.


-- 


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


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

* [Bug debug/43942] [4.5/4.6 Regression] -fcompare-debug faulure with external declaration in function.
  2010-04-29 17:55 [Bug debug/43942] New: -fcompare-debug faulure hjl dot tools at gmail dot com
                   ` (14 preceding siblings ...)
  2010-04-29 20:47 ` jakub at gcc dot gnu dot org
@ 2010-04-29 23:53 ` hjl dot tools at gmail dot com
  2010-04-29 23:58 ` hjl dot tools at gmail dot com
                   ` (4 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: hjl dot tools at gmail dot com @ 2010-04-29 23:53 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #16 from hjl dot tools at gmail dot com  2010-04-29 23:53 -------
Another testcase

---
char *
bar (void)
{
  extern char ext[];
  return ext;
}
char *
foo (void)
{
  return bar ();
}
--

#2  0x0000000000cecc94 in can_be_nonlocal (decl=0x7ffff190b0a0, 
    id=0x7fffffffdba0) at /export/gnu/import/git/gcc/gcc/tree-inline.c:506
#3  0x0000000000cecd7f in remap_decls (decls=0x7ffff190b0a0, 
    nonlocalized_list=0x7ffff18fb2e8, id=0x7fffffffdba0)
    at /export/gnu/import/git/gcc/gcc/tree-inline.c:542
#4  0x0000000000ced348 in remap_block (block=0x7fffffffd808, id=0x7fffffffdba0)
    at /export/gnu/import/git/gcc/gcc/tree-inline.c:603
#5  0x0000000000ced3c5 in remap_blocks (block=0x7ffff18fb058, 
    id=0x7fffffffdba0) at /export/gnu/import/git/gcc/gcc/tree-inline.c:624
#6  0x0000000000cf9255 in expand_call_inline (bb=0x7ffff18f5340, 
    stmt=0x7ffff1952000, id=0x7fffffffdba0)
    at /export/gnu/import/git/gcc/gcc/tree-inline.c:3742
#7  0x0000000000cf9b80 in gimple_expand_calls_inline (bb=0x7ffff18f5340, 
    id=0x7fffffffdba0) at /export/gnu/import/git/gcc/gcc/tree-inline.c:3926
#8  0x0000000000cfa1c9 in optimize_inline_calls (fn=0x7ffff18f6b00)
    at /export/gnu/import/git/gcc/gcc/tree-inline.c:4076
#9  0x0000000000cb3d07 in cgraph_early_inlining ()
    at /export/gnu/import/git/gcc/gcc/ipa-inline.c:1696
---Type <return> to continue, or q <return> to quit---
#10 0x00000000008c51de in execute_one_pass (pass=0x1781240)
    at /export/gnu/import/git/gcc/gcc/passes.c:1590
#11 0x00000000008c53d2 in execute_pass_list (pass=0x1781240)
    at /export/gnu/import/git/gcc/gcc/passes.c:1645
#12 0x00000000008c4531 in do_per_function_toporder (
    callback=0x8c5391 <execute_pass_list>, data=0x16ba1e0)
    at /export/gnu/import/git/gcc/gcc/passes.c:1156
#13 0x00000000008c5e3e in execute_ipa_pass_list (pass=0x16ba060)
    at /export/gnu/import/git/gcc/gcc/passes.c:1925
#14 0x0000000000ca7b9d in ipa_passes ()
    at /export/gnu/import/git/gcc/gcc/cgraphunit.c:1849
#15 0x0000000000ca7d0e in cgraph_optimize ()
    at /export/gnu/import/git/gcc/gcc/cgraphunit.c:1910
#16 0x0000000000ca58e7 in cgraph_finalize_compilation_unit ()
    at /export/gnu/import/git/gcc/gcc/cgraphunit.c:1166
#17 0x00000000004b6614 in c_write_global_declarations ()
    at /export/gnu/import/git/gcc/gcc/c-decl.c:9552
#18 0x00000000009bef13 in compile_file ()
    at /export/gnu/import/git/gcc/gcc/toplev.c:1065
#19 0x00000000009c1192 in do_compile ()
    at /export/gnu/import/git/gcc/gcc/toplev.c:2424
#20 0x00000000009c1268 in toplev_main (argc=15, argv=0x7fffffffdf58)
    at /export/gnu/import/git/gcc/gcc/toplev.c:2466
---Type <return> to continue, or q <return> to quit---
#21 0x00000000005733b0 in main (argc=15, argv=0x7fffffffdf58)
    at /export/gnu/import/git/gcc/gcc/main.c:35
#2  0x0000000000cecc94 in can_be_nonlocal (decl=0x7ffff190b0a0, 
    id=0x7fffffffdba0) at /export/gnu/import/git/gcc/gcc/tree-inline.c:506
506           && !auto_var_in_fn_p (decl, id->src_fn))
(gdb) call debug_tree (decl)
 <var_decl 0x7ffff190b0a0 ext
    type <array_type 0x7ffff18f7540
        type <integer_type 0x7ffff1a152a0 char public string-flag QI
            size <integer_cst 0x7ffff1a03758 constant 8>
            unit size <integer_cst 0x7ffff1a03780 constant 1>
            align 8 symtab 0 alias set -1 canonical type 0x7ffff1a152a0
precision 8 min <integer_cst 0x7ffff1a03708 -128> max <integer_cst
0x7ffff1a03820 127>
            pointer_to_this <pointer_type 0x7ffff1a2a930>>
        BLK
        align 8 symtab 0 alias set -1 canonical type 0x7ffff18f7540
        pointer_to_this <pointer_type 0x7ffff18f75e8>>
    addressable public external common BLK defer-output file y.i line 4 col 15
    align 8 context <function_decl 0x7ffff18f6a00 bar>>
(gdb) 

I don't think auto_var_in_fn_p should return true.


-- 


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


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

* [Bug debug/43942] [4.5/4.6 Regression] -fcompare-debug faulure with external declaration in function.
  2010-04-29 17:55 [Bug debug/43942] New: -fcompare-debug faulure hjl dot tools at gmail dot com
                   ` (15 preceding siblings ...)
  2010-04-29 23:53 ` hjl dot tools at gmail dot com
@ 2010-04-29 23:58 ` hjl dot tools at gmail dot com
  2010-04-30 10:24 ` jakub at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: hjl dot tools at gmail dot com @ 2010-04-29 23:58 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #17 from hjl dot tools at gmail dot com  2010-04-29 23:57 -------
(In reply to comment #13)
> Created an attachment (id=20520)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20520&action=view) [edit]
> patch2
> 
> Alternative patch for auto_var_in_fn_p
> 

I think auto_var_in_fn_p should be fixed properly.


-- 


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


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

* [Bug debug/43942] [4.5/4.6 Regression] -fcompare-debug faulure with external declaration in function.
  2010-04-29 17:55 [Bug debug/43942] New: -fcompare-debug faulure hjl dot tools at gmail dot com
                   ` (16 preceding siblings ...)
  2010-04-29 23:58 ` hjl dot tools at gmail dot com
@ 2010-04-30 10:24 ` jakub at gcc dot gnu dot org
  2010-04-30 11:25 ` jakub at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-04-30 10:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #18 from jakub at gcc dot gnu dot org  2010-04-30 10:24 -------
All patches bootstrapped/regtested on x86_64-linux and i686-linux,
unfortunately patch3 had slightly negative impact on debuginfo quality (about
4000 variables
in rtl checking cc1plus lost DW_AT_location attribute).

So I've posted patch2 and for the time being am not proposing patch3.


-- 


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


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

* [Bug debug/43942] [4.5/4.6 Regression] -fcompare-debug faulure with external declaration in function.
  2010-04-29 17:55 [Bug debug/43942] New: -fcompare-debug faulure hjl dot tools at gmail dot com
                   ` (17 preceding siblings ...)
  2010-04-30 10:24 ` jakub at gcc dot gnu dot org
@ 2010-04-30 11:25 ` jakub at gcc dot gnu dot org
  2010-04-30 11:32 ` jakub at gcc dot gnu dot org
  2010-04-30 12:06 ` rguenth at gcc dot gnu dot org
  20 siblings, 0 replies; 22+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-04-30 11:25 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #19 from jakub at gcc dot gnu dot org  2010-04-30 11:24 -------
Subject: Bug 43942

Author: jakub
Date: Fri Apr 30 11:24:16 2010
New Revision: 158931

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=158931
Log:
        PR debug/43942
        * tree.c (auto_var_in_fn_p): Return false for DECL_EXTERNAL vars.

        * c-c++-common/pr43942.c: New test.

Added:
    trunk/gcc/testsuite/c-c++-common/pr43942.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree.c


-- 


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


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

* [Bug debug/43942] [4.5/4.6 Regression] -fcompare-debug faulure with external declaration in function.
  2010-04-29 17:55 [Bug debug/43942] New: -fcompare-debug faulure hjl dot tools at gmail dot com
                   ` (18 preceding siblings ...)
  2010-04-30 11:25 ` jakub at gcc dot gnu dot org
@ 2010-04-30 11:32 ` jakub at gcc dot gnu dot org
  2010-04-30 12:06 ` rguenth at gcc dot gnu dot org
  20 siblings, 0 replies; 22+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-04-30 11:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #20 from jakub at gcc dot gnu dot org  2010-04-30 11:31 -------
Subject: Bug 43942

Author: jakub
Date: Fri Apr 30 11:30:52 2010
New Revision: 158932

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=158932
Log:
        PR debug/43942
        * tree.c (auto_var_in_fn_p): Return false for DECL_EXTERNAL vars.

        * c-c++-common/pr43942.c: New test.

Added:
    branches/gcc-4_5-branch/gcc/testsuite/c-c++-common/pr43942.c
Modified:
    branches/gcc-4_5-branch/gcc/ChangeLog
    branches/gcc-4_5-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_5-branch/gcc/tree.c


-- 


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


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

* [Bug debug/43942] [4.5/4.6 Regression] -fcompare-debug faulure with external declaration in function.
  2010-04-29 17:55 [Bug debug/43942] New: -fcompare-debug faulure hjl dot tools at gmail dot com
                   ` (19 preceding siblings ...)
  2010-04-30 11:32 ` jakub at gcc dot gnu dot org
@ 2010-04-30 12:06 ` rguenth at gcc dot gnu dot org
  20 siblings, 0 replies; 22+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-04-30 12:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #21 from rguenth at gcc dot gnu dot org  2010-04-30 12:06 -------
Fixed.


-- 

rguenth at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2010-04-30 12:06 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-29 17:55 [Bug debug/43942] New: -fcompare-debug faulure hjl dot tools at gmail dot com
2010-04-29 17:57 ` [Bug debug/43942] " hjl dot tools at gmail dot com
2010-04-29 18:05 ` pinskia at gcc dot gnu dot org
2010-04-29 18:16 ` hjl dot tools at gmail dot com
2010-04-29 18:18 ` [Bug debug/43942] -fcompare-debug faulure with external declaration in function hjl dot tools at gmail dot com
2010-04-29 18:23 ` hjl dot tools at gmail dot com
2010-04-29 18:26 ` [Bug debug/43942] -fcompare-debug failure " hjl dot tools at gmail dot com
2010-04-29 18:27 ` [Bug debug/43942] [4.5/4.6 Regression] -fcompare-debug faulure " pinskia at gcc dot gnu dot org
2010-04-29 18:45 ` hjl dot tools at gmail dot com
2010-04-29 19:17 ` hjl dot tools at gmail dot com
2010-04-29 19:23 ` jakub at gcc dot gnu dot org
2010-04-29 20:30 ` jakub at gcc dot gnu dot org
2010-04-29 20:41 ` jakub at gcc dot gnu dot org
2010-04-29 20:45 ` jakub at gcc dot gnu dot org
2010-04-29 20:46 ` jakub at gcc dot gnu dot org
2010-04-29 20:47 ` jakub at gcc dot gnu dot org
2010-04-29 23:53 ` hjl dot tools at gmail dot com
2010-04-29 23:58 ` hjl dot tools at gmail dot com
2010-04-30 10:24 ` jakub at gcc dot gnu dot org
2010-04-30 11:25 ` jakub at gcc dot gnu dot org
2010-04-30 11:32 ` jakub at gcc dot gnu dot org
2010-04-30 12:06 ` rguenth at gcc dot gnu dot 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).