[Bug preprocessor/45362] [4.6 Regression] Dangling reference about saved cpp_macro for push/pop macro

2010-09-29 Thread ktietz at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45362

--- Comment #18 from Kai Tietz ktietz at gcc dot gnu.org 2010-09-29 18:18:42 
UTC ---
Author: ktietz
Date: Wed Sep 29 18:18:38 2010
New Revision: 164729

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=164729
Log:
2010-09-29  Kai Tietz  kai.ti...@onevision.com

PR preprocessor/45362
* directives.c (cpp_pop_definition): Make static.
(do_pragma_push_macro): Reworked to store text
definition.
(do_pragma_pop_macro): Add free text definition.
(cpp_push_definition): Removed.
* include/cpplib.h (cpp_push_definition): Removed.
(cpp_pop_definition): Likewise.
* internal.h (def_pragma_macro): Remove member 'value'
and add new members 'definition', 'line',
'syshdr', 'sued' and 'is_undef'.
* pch.c (_cpp_restore_pushed_macros): Rework to work
on text definition and store additional macro flags.
(_cpp_save_pushed_macros): Likewise.


Modified:
trunk/libcpp/ChangeLog
trunk/libcpp/directives.c
trunk/libcpp/include/cpplib.h
trunk/libcpp/internal.h
trunk/libcpp/pch.c


[Bug preprocessor/45362] [4.6 Regression] Dangling reference about saved cpp_macro for push/pop macro

2010-09-29 Thread ktietz at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45362

Kai Tietz ktietz at gcc dot gnu.org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED

--- Comment #19 from Kai Tietz ktietz at gcc dot gnu.org 2010-09-29 18:33:50 
UTC ---
Fixed on trunk.


[Bug preprocessor/45362] [4.6 Regression] Dangling reference about saved cpp_macro for push/pop macro

2010-09-17 Thread ktietz at gcc dot gnu dot org


--- Comment #14 from ktietz at gcc dot gnu dot org  2010-09-17 14:01 ---
Created an attachment (id=21820)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21820action=view)
testcase for problem

As this test need more then on header, please extract it and compile then
main.c to reproduce it. At least I was able to do this on linux64 by this
testcase.


-- 


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



[Bug preprocessor/45362] [4.6 Regression] Dangling reference about saved cpp_macro for push/pop macro

2010-09-17 Thread ktietz at gcc dot gnu dot org


--- Comment #15 from ktietz at gcc dot gnu dot org  2010-09-17 18:37 ---
(In reply to comment #14)
 Created an attachment (id=21820)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21820action=view) [edit]
 testcase for problem
 
 As this test need more then on header, please extract it and compile then
 main.c to reproduce it. At least I was able to do this on linux64 by this
 testcase.
 

Patch for it posted to ML. See
http://gcc.gnu.org/ml/gcc-patches/2010-09/msg01394.html


-- 

ktietz at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |ktietz at gcc dot gnu dot
   |dot org |org
 Status|NEW |ASSIGNED
   Last reconfirmed|2010-09-16 17:04:34 |2010-09-17 18:37:19
   date||


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



[Bug preprocessor/45362] [4.6 Regression] Dangling reference about saved cpp_macro for push/pop macro

2010-09-17 Thread t66667 at gmail dot com


--- Comment #16 from t7 at gmail dot com  2010-09-18 01:04 ---
(In reply to comment #15)
 (In reply to comment #14)
  Created an attachment (id=21820)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21820action=view) [edit]
  testcase for problem
  
  As this test need more then on header, please extract it and compile then
  main.c to reproduce it. At least I was able to do this on linux64 by this
  testcase.
  
 
 Patch for it posted to ML. See
 http://gcc.gnu.org/ml/gcc-patches/2010-09/msg01394.html
 

Hi, it failed produce problem with attached testcase both the gcc and xgcc.
I extracted it and compile with -c main.c


-- 


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



[Bug preprocessor/45362] [4.6 Regression] Dangling reference about saved cpp_macro for push/pop macro

2010-09-17 Thread t66667 at gmail dot com


--- Comment #17 from t7 at gmail dot com  2010-09-18 01:14 ---
(In reply to comment #15)
 (In reply to comment #14)
  Created an attachment (id=21820)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21820action=view) [edit]
  testcase for problem
  
  As this test need more then on header, please extract it and compile then
  main.c to reproduce it. At least I was able to do this on linux64 by this
  testcase.
  
 
 Patch for it posted to ML. See
 http://gcc.gnu.org/ml/gcc-patches/2010-09/msg01394.html
 

Thanks a-lot Kai! This patch fixes ICE in PR45666.


-- 


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



[Bug preprocessor/45362] [4.6 Regression] Dangling reference about saved cpp_macro for push/pop macro

2010-09-16 Thread pinskia at gcc dot gnu dot org


-- 

pinskia at gcc dot gnu dot org changed:

   What|Removed |Added

   Keywords||build, GC, ice-on-valid-code
Summary|Dangling reference about|[4.6 Regression] Dangling
   |saved cpp_macro for push/pop|reference about saved
   |macro   |cpp_macro for push/pop macro
   Target Milestone|--- |4.6.0


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



[Bug preprocessor/45362] [4.6 Regression] Dangling reference about saved cpp_macro for push/pop macro

2010-09-16 Thread pinskia at gcc dot gnu dot org


--- Comment #9 from pinskia at gcc dot gnu dot org  2010-09-16 22:00 ---
GC issues normally don't show at different times depending on the layout of
memory and such.  Sometimes it depends on env variables being slightly
different.


-- 


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



[Bug preprocessor/45362] [4.6 Regression] Dangling reference about saved cpp_macro for push/pop macro

2010-09-16 Thread t66667 at gmail dot com


--- Comment #10 from t7 at gmail dot com  2010-09-16 22:03 ---
Program received signal SIGSEGV, Segmentation fault.
gt_ggc_mx_cpp_macro (x_p=value optimized out) at gtype-desc.c:2078
2078  ((*x).params[i0]) ? HT_IDENT_TO_GCC_IDENT (HT_NODE
(((*x).params[i0]))) : NULL;
(gdb) bt
#0  gt_ggc_mx_cpp_macro (x_p=value optimized out) at gtype-desc.c:2078
#1  0x004caee5 in gt_ggc_mx_lang_tree_node (x_p=value optimized out)
at ./gt-c-decl.h:537
#2  0x004cb0c3 in gt_ggc_mx_lang_tree_node (x_p=value optimized out)
at ./gt-c-decl.h:370
#3  0x004cbcc8 in gt_ggc_mx_c_binding (x_p=value optimized out) at
./gt-c-decl.h:103
#4  0x004cbcf2 in gt_ggc_mx_c_binding (x_p=value optimized out) at
./gt-c-decl.h:106
#5  0x004caea6 in gt_ggc_mx_lang_tree_node (x_p=value optimized out)
at ./gt-c-decl.h:549


-- 


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



[Bug preprocessor/45362] [4.6 Regression] Dangling reference about saved cpp_macro for push/pop macro

2010-09-16 Thread t66667 at gmail dot com


--- Comment #11 from t7 at gmail dot com  2010-09-16 22:06 ---
But too bad this file 'gtype-desc.c' is automatically generated at build time.


-- 


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



[Bug preprocessor/45362] [4.6 Regression] Dangling reference about saved cpp_macro for push/pop macro

2010-09-16 Thread jakub at gcc dot gnu dot org


--- Comment #12 from jakub at gcc dot gnu dot org  2010-09-16 22:28 ---
Can you try compiling it with
--param ggc-min-expand=0 --param ggc-min-heapsize=0
?  Perhaps you'll trigger it then more reliably...


-- 


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



[Bug preprocessor/45362] [4.6 Regression] Dangling reference about saved cpp_macro for push/pop macro

2010-09-16 Thread t66667 at gmail dot com


--- Comment #13 from t7 at gmail dot com  2010-09-16 22:33 ---
(In reply to comment #12)
 Can you try compiling it with
 --param ggc-min-expand=0 --param ggc-min-heapsize=0
 ?  Perhaps you'll trigger it then more reliably...
 

Without it:
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: 7ccff28a2de01cef50407f25bf137180

Program received signal SIGSEGV, Segmentation fault.
gt_ggc_mx_cpp_macro (x_p=value optimized out) at gtype-desc.c:2078
2078  ((*x).params[i0]) ? HT_IDENT_TO_GCC_IDENT (HT_NODE
(((*x).params[i0]))) : NULL;
(gdb) bt
#0  gt_ggc_mx_cpp_macro (x_p=value optimized out) at gtype-desc.c:2078

With it:
GGC heuristics: --param ggc-min-expand=0 --param ggc-min-heapsize=0
Compiler executable checksum: 7ccff28a2de01cef50407f25bf137180

Program received signal SIGSEGV, Segmentation fault.
gt_ggc_mx_cpp_macro (x_p=value optimized out) at gtype-desc.c:2078
2078  ((*x).params[i0]) ? HT_IDENT_TO_GCC_IDENT (HT_NODE
(((*x).params[i0]))) : NULL;
(gdb) bt
#0  gt_ggc_mx_cpp_macro (x_p=value optimized out) at gtype-desc.c:2078
#1  0x004caee5 in gt_ggc_mx_lang_tree_node (x_p=value optimized out)
at ./gt-c-decl.h:537
#2  0x004cb0c3 in gt_ggc_mx_lang_tree_node (x_p=value optimized out)
at ./gt-c-decl.h:370
#3  0x004cbcc8 in gt_ggc_mx_c_binding (x_p=value optimized out) at
./gt-c-decl.h:103
#4  0x004cbcf2 in gt_ggc_mx_c_binding (x_p=value optimized out) at
./gt-c-decl.h:106
#5  0x004caea6 in gt_ggc_mx_lang_tree_node (x_p=value optimized out)
at ./gt-c-decl.h:549
#6  0x004cad62 in gt_ggc_mx_lang_tree_node (x_p=value optimized out)
at ./gt-c-decl.h:350
#7  0x004cb00d in gt_ggc_mx_lang_tree_node (x_p=value optimized out)
at ./gt-c-decl.h:413
#8  0x004caf8c in gt_ggc_mx_lang_tree_node (x_p=value optimized out)
at ./gt-c-decl.h:393

I see no diff, do you mean compile the code that caused crash or compile the
xgcc or gcc over again?


-- 


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