Commit 5f26a230 by Jakub Jelinek Committed by Jakub Jelinek

re PR c/38700 (ICE with __builtin_expect and label)

	PR c/38700
	* builtins.c (fold_builtin_expect): Only check DECL_WEAK for VAR_DECLs
	and FUNCTION_DECLs.

	* gcc.dg/pr38700.c: New test.

From-SVN: r143028
parent fafe34f9
2009-01-03 Jakub Jelinek <jakub@redhat.com>
PR c/38700
* builtins.c (fold_builtin_expect): Only check DECL_WEAK for VAR_DECLs
and FUNCTION_DECLs.
2009-01-02 Kenneth Zadeck <zadeck@naturalbridge.com> 2009-01-02 Kenneth Zadeck <zadeck@naturalbridge.com>
PR rtl-optimization/35805 PR rtl-optimization/35805
......
/* Expand builtin functions. /* Expand builtin functions.
Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
Free Software Foundation, Inc. Free Software Foundation, Inc.
This file is part of GCC. This file is part of GCC.
...@@ -7324,7 +7324,9 @@ fold_builtin_expect (tree arg0, tree arg1) ...@@ -7324,7 +7324,9 @@ fold_builtin_expect (tree arg0, tree arg1)
} }
while (TREE_CODE (inner) == COMPONENT_REF while (TREE_CODE (inner) == COMPONENT_REF
|| TREE_CODE (inner) == ARRAY_REF); || TREE_CODE (inner) == ARRAY_REF);
if (DECL_P (inner) && DECL_WEAK (inner)) if ((TREE_CODE (inner) == VAR_DECL
|| TREE_CODE (inner) == FUNCTION_DECL)
&& DECL_WEAK (inner))
return NULL_TREE; return NULL_TREE;
} }
......
2009-01-03 Jakub Jelinek <jakub@redhat.com>
PR c/38700
* gcc.dg/pr38700.c: New test.
2009-01-02 Jason Merrill <jason@redhat.com> 2009-01-02 Jason Merrill <jason@redhat.com>
* g++.dg/cpp0x/initlist11.C: New test. * g++.dg/cpp0x/initlist11.C: New test.
......
/* PR c/38700 */
/* { dg-do compile } */
/* { dg-options "-O0" } */
int
foo ()
{
__SIZE_TYPE__ s = __builtin_expect ((__SIZE_TYPE__)&&L, 0);
L:
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment