[Bug target/34982] [4.3 regression] calling a function with undefined parameters causes segmentation fault at -O1 or higher

rguenth at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Sat Jan 26 19:36:00 GMT 2008



------- Comment #4 from rguenth at gcc dot gnu dot org  2008-01-26 19:23 -------
So we use the local info before it is available and thus the following will
ICE:

Index: config/i386/i386.c
===================================================================
--- config/i386/i386.c  (revision 131861)
+++ config/i386/i386.c  (working copy)
@@ -3199,6 +3199,7 @@ ix86_function_regparm (const_tree type, 
     {
       /* FIXME: remove this CONST_CAST when cgraph.[ch] is constified.  */
       struct cgraph_local_info *i = cgraph_local_info (CONST_CAST_TREE(decl));
+      gcc_assert (cgraph_node (CONST_CAST_TREE(decl))->analyzed);
       if (i && i->local)
        {
          int local_regparm, globals = 0, regno;


and if it is just not available (i == NULL) might give inconsistent
answers.


-- 


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



More information about the Gcc-bugs mailing list